/* ===============================
   SECTION
=============================== */

.courses {
  margin: 80px 0;
  width: 100%;
}

.courses h2 {
  font-size: 42px;
  font-weight: 500;
  text-align: center;
  margin: 0 auto 12px;
    margin-bottom: 1.5rem;
}

.subtitle {
  color: #666;
  text-align: center;
  max-width: 600px;
  font-size: 18px;
  line-height: 24px;
  margin: 0 auto 50px;
}

/* ===============================
   CAROUSEL
=============================== */

.carousel-wrapper {
  overflow-x: auto;
}

.carousel {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.carousel::-webkit-scrollbar {
  display: none;
}

/* ===============================
   DESKTOP CARD
=============================== */

.course-card {
  position: relative;
  flex: 0 0 350px;
  max-width: 350px;
  aspect-ratio: 1 / 1;
  margin-left: 24px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: center;
}

@media (min-width: 641px) {
  .course-card:first-child {
    margin-left: 3rem;
  }

  .course-card:last-child {
    margin-right: 3rem;
  }
}

/* Desktop image ONLY */
.desktop-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ===============================
   DESKTOP TOP STATE
=============================== */

.card-top {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 20px;
  color: #fff;
  padding: 1.8rem;
  pointer-events: none;
}

.card-top h3 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 600;
}

.arrow {
  width: 40px;
  height: 40px;
  z-index: 5;
}

/* ===============================
   DESKTOP HOVER
=============================== */

.card-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card-overlay h3 {
  font-size: 24px;
  font-weight: 700;
}

.card-overlay p {
  font-size: 24px;
  line-height: 30px;
  color: #e5e5e5;
  max-width: 90%;
}

.course-card:hover .card-overlay {
  opacity: 1;
}

.course-card:hover .card-top {
  opacity: 0;
}
.course-card:hover .card-overlay .arrow img{
  transform: rotate(45deg);
  transition: transform 0.3s ease; /* optional smooth effect */
}

/* ===============================
   MOBILE LAYOUT
=============================== */

.mobile-header,
.mobile-content {
  display: none;
}

@media (max-width: 640px) {
  /* Layout */
  .carousel {
    flex-direction: column;
  }

  .courses h2 {
    font-size: 30px;
  }

  .subtitle {
    font-size: 16px;
    line-height: 20px;
    padding: 0rem 3rem;
  }

  /* Card */
  .course-card {
    flex: none;
    max-width: 100%;
    aspect-ratio: auto;
    margin: 3px 15px;
    padding: 12px 2rem;
    border-radius: 40px;
    background: #fafafa;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    transition: all 0.35s ease;
  }

  .course-card.active {
    padding: 2rem;
        height: 252px;
  }

  /* Hide desktop-only elements */
  .desktop-image,
  .card-top,
  .card-overlay {
    display: none;
  }

  /* ===============================
     MOBILE HEADER
  =============================== */

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-logo {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
  }

  .mobile-left h3 {
    font-size: 15px;
    line-height: 18px;
    font-weight: 500;
    margin: 0;
  }

  /* Arrow */
  .mobile-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;

    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .course-card.active .mobile-toggle {
    transform: rotate(180deg);
  }

  /* ===============================
     MOBILE ACCORDION CONTENT
  =============================== */

  .mobile-content {
    display: block;
  }

  .mobile-content p,
  .mobile-content a {
    display: none;
  }

  /* Active state (colors from JS vars) */
  .course-card {
    background: var(--mobile-bg);
    border-color: var(--mobile-border);
  }

  .course-card.active .mobile-content p{
        display: block;
    max-width: 90%;
    font-size: 16px;
    line-height: 20px;
  }
  .course-card.active .mobile-content a {
    display: block;
    max-width: 90%;
    font-size: 14px;
    line-height: 20px;
  }

  .course-card.active .mobile-content p {
    margin-top: 12px;
    color: #5b5b5b;
  }

  .course-card.active a {
    font-weight: 500;
    font-size: 14px;
    margin-top: 2rem;
    text-decoration: underline;
    color: #0077ff;
  }
}

/* ===============================
   DESKTOP INDICATOR
=============================== */

.desktop-only {
  display: none;
}

@media (min-width: 641px) {
  .desktop-only {
    display: flex;
    justify-content: center;
    margin-top: 32px;
  }

  /* Track */
  .indicator-track {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(6px);
  }

  /* Dots */
  .indicator-dot {
    width: 12px;
    height: 12px;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.25);
    background: transparent;
    transition:
      transform 0.25s ease,
      border-color 0.25s ease,
      background-color 0.25s ease,
      opacity 0.25s ease;
    opacity: 0.6;
  }

  .indicator-dot:hover {
    transform: scale(1.15);
    opacity: 1;
  }

  /* Active dot (optional) */
  .indicator-dot.active {
    border-color: rgba(0, 0, 0, 0.85);
    background: rgba(0, 0, 0, 0.85);
    opacity: 1;
  }

  /* Sliding pill */
  .indicator-pill {
    position: absolute;
    left: 12px;
    width: 42px;
    height: 14px;
    border-radius: 999px;

    background: linear-gradient(
      135deg,
      #111 0%,
      #333 50%,
      #111 100%
    );

    box-shadow:
      0 6px 16px rgba(0, 0, 0, 0.25),
      inset 0 0 0 1px rgba(255, 255, 255, 0.1);

    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
  }
}


