/* Training & Success section styles - Simplified single-column flow */
.programs {
  position: relative;
  background: var(--card);
  padding: 3.5rem 0;
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: scroll-position;
}

/* Water/flow pattern overlay - subtle blue background effect */
.programs::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(8, 145, 178, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(2, 132, 199, 0.1) 0%, transparent 70%);
  background-size: 100% 100%, 100% 100%, 150% 150%;
  background-position: 0% 0%, 100% 100%, 50% 50%;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: auto;
  contain: strict;
}

/* Subtle wave pattern */
.programs::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 3px,
      rgba(8, 145, 178, 0.05) 3px,
      rgba(8, 145, 178, 0.05) 6px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 3px,
      rgba(6, 182, 212, 0.04) 3px,
      rgba(6, 182, 212, 0.04) 6px
    );
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: auto;
  contain: strict;
}

.programs > .container {
  position: relative;
  z-index: 2;
}

.programs .section-header .gradient-divider {
  width: 100px;
  height: 6px;
  background: linear-gradient(90deg, var(--brand) 0, var(--brandAccent) 50%, var(--brandMedium) 100%);
  margin: 0 auto var(--spacing-md);
  border-radius: 3px;
  box-shadow: 0 0 20px rgba(8, 145, 178, 0.6),
              0 0 40px rgba(6, 182, 212, 0.3);
}

.programs .section-header h2 {
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.programs .section-intro {
  font-size: 1.15rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: var(--ink);
}

/* Removed complex nested layouts, created simple single-column flow */
.training-success-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.training-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.training-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.55);
  position: relative;
  z-index: 10;
  /* Adding scroll animation support - only animates when section is visible */
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: opacity, transform;
  transition: opacity var(--anim-duration) ease-out, transform var(--anim-duration) ease-out;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
  contain: layout style paint;
  isolation: isolate;
  transform-style: preserve-3d;
}

.section-reveal.visible .training-card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.training-card:nth-child(1) {
  transition-delay: 0.2s;
}

.training-card:nth-child(2) {
  transition-delay: 0.35s;
}

.training-card:nth-child(3) {
  transition-delay: 0.5s;
}

.training-card:hover {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.22);
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 16px 48px rgba(0, 188, 212, 0.5),
              0 0 30px rgba(8, 145, 178, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.training-card .card-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand) 0, var(--brandAccent) 50%, var(--brandMedium) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 188, 212, 0.3),
              0 0 20px rgba(8, 145, 178, 0.2);
  transition: all 0.3s ease;
  flex-shrink: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.training-card:hover .card-icon {
  transform: translateZ(0) scale(1.05);
  -webkit-transform: translateZ(0) scale(1.05);
  box-shadow: 0 6px 24px rgba(0, 188, 212, 0.4),
              0 0 30px rgba(6, 182, 212, 0.3);
}

.training-card .card-icon svg {
  width: 24px;
  height: 24px;
}

.training-card h3 {
  color: var(--ink);
  font-size: 1.25rem;
  margin-bottom: 0.875rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.training-card p {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
  word-break: break-word;
  overflow-wrap: break-word;
  font-weight: 400;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

/* Styled partner link - elegant and subtle */
.training-card .partner-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
  display: inline;
  word-break: keep-all;
}

.training-card .partner-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0, var(--brandMedium) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.training-card .partner-link:hover {
  color: var(--brandMedium);
}

.training-card .partner-link:hover::before {
  transform: scaleX(1);
}

.training-card .partner-link::after {
  content: " ↗";
  font-size: 0.75em;
  margin-left: 2px;
  opacity: 0.6;
  transition: opacity var(--transition), transform var(--transition);
  display: inline-block;
}

.training-card .partner-link:hover::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

.topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.topic-list li {
  padding-left: 1.75rem;
  position: relative;
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

.topic-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--brandAccent);
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* Removed software-tags grid styling, replaced with simple text paragraph styling */
.software-list {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 0.5rem;
  font-weight: 400;
}

/* Centered carousel wrapper between training cards and success stories */
/* Ensuring carousel is always visible and not affected by scroll animations */
.training-carousel-wrapper {
  max-width: 900px;
  margin: 3rem auto;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  min-height: 450px;
  /* Create new stacking and rendering context to isolate from background */
  z-index: 100;
  isolation: isolate;
  /* Remove contain which can cause rendering artifacts */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.training-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f5f5f5;
  min-height: 450px;
  /* Create isolated rendering context */
  isolation: isolate;
  z-index: 1;
  /* Remove transforms that might cause rendering issues */
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  /* Remove all transforms - they can cause rendering artifacts */
  will-change: opacity;
  /* Eliminate any borders or gaps that could cause lines */
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* Create new rendering layer */
  isolation: isolate;
}

.carousel-slide.active {
  opacity: 1;
  will-change: auto;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Remove all transforms and filters that might cause rendering artifacts */
  will-change: auto;
  /* Standard image rendering - let browser handle it naturally */
  image-rendering: auto;
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
  background: transparent;
  /* Force new rendering layer to prevent artifacts from other elements */
  isolation: isolate;
  /* Ensure images render cleanly */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  -webkit-transform: translateX(-50%) translateZ(0);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
  will-change: auto;
}

.carousel-indicators .indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.carousel-indicators .indicator.active {
  background: var(--brand);
  width: 24px;
  border-radius: 5px;
}

.carousel-indicators .indicator:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Adjusted positioning for specific images to show more of top (Ted and screen) */
.carousel-slide-adjusted img {
  object-position: center 20%;
  object-fit: cover;
}

/* Simple 2-column grid for success stories */
.success-stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.success-story {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.55);
  position: relative;
  z-index: 10;
  /* Adding scroll animation support - only animates when section is visible */
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: opacity, transform;
  transition: opacity var(--anim-duration) ease-out, transform var(--anim-duration) ease-out;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
  contain: layout style paint;
  isolation: isolate;
  transform-style: preserve-3d;
}

.section-reveal.visible .success-story {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.success-story:nth-child(1) {
  transition-delay: 0.2s;
}

.success-story:nth-child(2) {
  transition-delay: 0.35s;
}

.success-story:hover {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.22);
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 16px 48px rgba(0, 188, 212, 0.5),
              0 0 30px rgba(8, 145, 178, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.success-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand) 0, var(--brandAccent) 50%, var(--brandMedium) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 188, 212, 0.3),
              0 0 20px rgba(8, 145, 178, 0.2);
  transition: all 0.3s ease;
  flex-shrink: 0;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.success-story:hover .success-icon {
  transform: translateZ(0) scale(1.05);
  -webkit-transform: translateZ(0) scale(1.05);
  box-shadow: 0 6px 24px rgba(0, 188, 212, 0.4),
              0 0 30px rgba(6, 182, 212, 0.3);
}

.success-icon svg {
  width: 24px;
  height: 24px;
}

.success-story h3 {
  color: var(--ink);
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.success-story p {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
}

/* Updated responsive layout for mobile */
@media (max-width: 1024px) {
  .training-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .success-stories-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Ensure carousel is responsive on mobile */
  .training-carousel-wrapper {
    max-width: 100%;
    margin: 1.5rem 0;
  }
}

@media (max-width: 768px) {
  .programs {
    padding: 2rem 0;
  }

  .programs .section-header h2 {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .programs .section-intro {
    font-size: 1rem;
    padding: 0 var(--spacing-sm);
  }

  .training-cards-grid {
    gap: 1rem;
  }

  .training-card {
    padding: 1.25rem;
  }

  .training-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }

  .training-card p {
    font-size: 0.9rem;
    margin-bottom: 0.875rem;
  }

  .training-card .card-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.875rem;
  }

  .training-card .card-icon svg {
    width: 20px;
    height: 20px;
  }

  .topic-list li {
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
  }

  .success-stories-grid {
    gap: 1rem;
  }

  .success-story {
    padding: 1.25rem;
  }

  .success-story h3 {
    font-size: 1.15rem;
    margin-bottom: 0.625rem;
  }

  .success-story p {
    font-size: 0.9rem;
  }

  .success-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.875rem;
  }

  .success-icon svg {
    width: 20px;
    height: 20px;
  }

  .training-carousel-wrapper {
    margin: 2rem 0;
    min-height: 300px;
  }

  .training-carousel {
    min-height: 300px;
  }

  .carousel-indicators {
    display: none;
  }
}

@media (max-width: 480px) {
  .training-card,
  .success-story {
    padding: 1rem;
  }

  .training-card h3,
  .success-story h3 {
    font-size: 1rem;
  }

  .training-card p,
  .success-story p {
    font-size: 0.85rem;
  }
}
