/* ============================================================
   MacroSnap Coach — Page-specific CSS
   Only: complex selectors, gradient text, pseudo-elements,
         overflow fallbacks, JS-state selectors
   ============================================================ */

body.page-macrosnap-coach { overflow-x: clip; }

/* Section clips the 1440px image-treatment on smaller viewports */
.msc-hero       { overflow: hidden; overflow: clip; }

/* ── Hero lottie animation ───────────────────────────────────── */
@media (min-width: 1280px) {
    #msc-lottie svg { height: auto !important; }
}

/* Replay button — shown after animation completes */
.msc-lottie-replay {
    display: none;
    position: absolute;
        bottom: 11%;
    right: 10%;
    z-index: 10;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #fff;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    color: #1f1f1f;
    cursor: pointer;
    transition: background 0.2s;
}
.msc-lottie-replay svg { width: 14.5px; height: auto; }
.msc-lottie-replay:hover { background: #f0f0f0; }
.msc-lottie-replay.visible { display: flex; }
@media (min-width: 768px) {
    .msc-lottie-replay {
       bottom: 11.5%;
        right: 8%;
        width: 36.5px;
        height: 36.5px;
    }
    .msc-lottie-replay svg { width: 20px; }
}
@media (min-width: 1024px) {
    .msc-lottie-replay {
        bottom: 11.5%;
        right: 9%;
        width: 44px;
        height: 44px;
    }
}
@media (min-width: 1280px) {
    .msc-lottie-replay {
    bottom: 12%;
    right: 9.5%;
    }
}
@media (min-width: 1920px) {
    .msc-lottie-replay {
        right: 9%;
    }
}

/* Trust-by-coaches — continuous testimonial marquee (right → left).
   Track holds 4 copies of the set; -50% = 2 copies = one seamless loop period. */
@keyframes msc-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.msc-marquee-track { animation: msc-marquee 40s linear infinite; will-change: transform; }
.msc-marquee:hover .msc-marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
    .msc-marquee-track { animation: none; }
}

/* Referral section background: Figma frame fill = blue radial gradient rising from below (per breakpoint).
   Stretched 100% x 100% like Figma's frame fill. Desktop gradients added per-breakpoint later. */
.msc-referral {
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
@media (max-width: 767.98px) {
    .msc-referral { background-image: url("../images/macrosnap/referral-gradient-375.svg"); }
}
/* 768..1920 share the same normalized radial gradient (verified from Figma fills). */
@media (min-width: 768px) {
    .msc-referral { background-image: url("../images/macrosnap/referral-gradient-768.svg"); }
}

/* Coach badge: glossy radial-gradient bevel (all breakpoints). Layout/weight handled by utility classes. */
.msc-trust .msc-badge-coach {
    background-image: url("../images/macrosnap/badge-coach-bg.svg");
    background-size: 100% 100%;
}

/* FAQ accordion — only one item open at a time, JS toggles .is-expanded */
.msc-faq-item {
  transition: background-color 0.3s ease, padding 0.3s ease;
  border-radius: 12px;
  background: transparent;
}

.msc-faq-item.is-expanded {
  background: #060606;
  padding-bottom: 6px;
}

.msc-faq-item .msc-faq-item__header p {
  transition: color 0.3s ease;
  color: #000;
}

.msc-faq-item.is-expanded .msc-faq-item__header p {
  color: #fff;
}

.msc-faq-item .msc-faq-item__icon {
  transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
  background: #f6f6f6;
  border: 1px solid transparent;
}

.msc-faq-item.is-expanded .msc-faq-item__icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.msc-faq-item .msc-faq-icon-minus,
.msc-faq-item .msc-faq-icon-plus {
  position: absolute;
  transition: opacity 0.3s ease;
}

.msc-faq-item .msc-faq-icon-minus { opacity: 0; }
.msc-faq-item .msc-faq-icon-plus { opacity: 1; }
.msc-faq-item.is-expanded .msc-faq-icon-minus { opacity: 1; }
.msc-faq-item.is-expanded .msc-faq-icon-plus { opacity: 0; }

.msc-faq-item .msc-faq-icon-plus path {
  transition: fill 0.3s ease;
  fill: black;
}

.msc-faq-item.is-expanded .msc-faq-icon-plus path {
  fill: white;
}

.msc-faq-item__answer {
  overflow: hidden;
  height: 0;
  opacity: 0;
  /* Always active (not scoped to .is-expanded) so collapsing animates too —
     JS sets height:0 and removes .is-expanded in the same tick with no forced
     reflow between them, so the browser only sees the final (collapsed) style
     when it recalculates. If transition only lived on .is-expanded, that final
     style would have no transition and the collapse would snap instantly. */
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.msc-faq-item.is-expanded .msc-faq-item__answer {
  opacity: 1;
  transition-delay: 0s, 0.05s;
}

/* Figma never shows a divider touching the expanded (dark) item — it reads as
   redundant next to the rounded dark box. Hide the divider on whichever side
   currently borders .is-expanded (only one item is ever expanded at a time). */
.msc-faq-item.is-expanded + .msc-faq-divider,
.msc-faq-divider:has(+ .msc-faq-item.is-expanded) {
  opacity: 0;
}

.msc-faq-link {
  color: #38a9ff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.msc-faq-link:hover {
  text-decoration: underline;
}

.msc-faq-link-arrow {
  display: inline-block;
  vertical-align: -1px;
  margin-left: 3px;
}

/* Explore section — Swiper pagination, same pattern as .comm-cross-promo-pagination */
.msc-explore-pagination.swiper-pagination {
  position: static;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 2px;
}

.msc-explore-pagination .swiper-pagination-bullet {
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background: #333;
  opacity: 0.2;
  transition: opacity 0.3s, width 0.3s;
  margin: 0 !important;
}

.msc-explore-pagination .swiper-pagination-bullet-active {
  opacity: 1;
}

.msc-explore-pagination.swiper-pagination-lock {
  display: none;
}

@media (min-width: 768px) {
  .msc-faq-link {
    font-size: 15px;
  }
}

@media (min-width: 1440px) {
  .msc-faq-link {
    font-size: 16px;
  }
}


/* Rainbow gradient — top of snap section, positioned to show rainbow strip (md+ only) */
.msc-snap-gradient {
    top: -609px;
    left: -15%;
    transform: translateX(-9%);
    width: 1254.46px;
    z-index: 0;
    opacity: 0.9;
}

@media (min-width: 1024px) {
    .msc-snap-gradient {
        top: -76%;
        left: -13%;
        width: 1570px;
    }
}

@media (min-width: 1440px) {
    .msc-snap-gradient {
        top: -55%;
        left: -4%;
        width: 2037px;
    }
}

@media (min-width: 1920px) {
    .msc-snap-gradient {
        top: -64%;
        left: -17%;
        width: 3037px;
    }
}

/* Prevent JS from locking accordion list height or stretching active item at md */
@media (min-width: 768px) and (max-width: 1023px) {
    .page-macrosnap-coach .according-text-image .according-select {
        max-height: none !important;
    }
    .page-macrosnap-coach .according-text-image .according-item.active {
        min-height: auto !important;
    }
}

/* Image panel fade transition */
.page-macrosnap-coach .according-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.page-macrosnap-coach .according-image.active {
    opacity: 1;
    pointer-events: auto;
}

/* JS-state: class "active" is toggled by main.js at runtime */
.page-macrosnap-coach .according-select .according-item {
    border-color: #ededed;
}
.page-macrosnap-coach .according-select .according-item.active {
    background-color: #f6f6f6;
    border-color: transparent;
    opacity: 1;
}
.page-macrosnap-coach .according-select .according-item:not(.active) {
    opacity: 0.6;
}

/*
 * "AI Powered" badge background
 * Figma: SVG radial gradient from warm yellow (bottom-left) through lime → cyan → blue → transparent
 * over a solid black base.
 */
.msc-hero-badge {
    background-image:
        radial-gradient(
            ellipse at 13% 204%,
            rgba(255, 247, 227, 1)  5.2%,
            rgba(246, 248, 185, 1) 10.1%,
            rgba(238, 249, 144, 1) 15.0%,
            rgba(229, 250, 103, 1) 19.9%,
            rgba(220, 252,  61, 1) 24.7%,
            rgba(194, 241,  86, 1) 27.8%,
            rgba(168, 230, 110, 1) 30.9%,
            rgba(117, 209, 158, 1) 37.1%,
            rgba( 91, 198, 182, 1) 40.2%,
            rgba( 65, 188, 207, 1) 43.3%,
            rgba( 39, 177, 231, 1) 46.4%,
            rgba( 13, 166, 255, 1) 49.5%,
            rgba( 33, 142, 225, 0.75) 64.6%,
            rgba( 52, 118, 195, 0.5)  79.7%,
            rgba( 26,  59,  97, 0.25) 89.8%,
            rgba(  0,   0,   0, 0)   100%
        ),
        linear-gradient(90deg, #000 0%, #000 100%);
}

/*
 * Mobile vignette — dark gradient overlay on the food photo for text readability.
 * Figma 375/768/1024: the subtract SVG acts as a vignette; at mobile we replicate
 * this with a simple bottom-heavy radial gradient.
 */
.msc-hero-mobile-vignette {
    background:
        radial-gradient(ellipse 80% 60% at 50% 35%, transparent 30%, rgba(8, 3, 2, 0.6) 100%),
        linear-gradient(to bottom, rgba(8, 3, 2, 0.15) 0%, rgba(8, 3, 2, 0.55) 100%);
}

/*
 * Colorful glow blob — bottom-left of image treatment
 * Figma: rotated ellipse with a colorful multi-color light effect
 * Approximated with a blurred radial gradient
 */
.msc-hero-glow {
    background: radial-gradient(
        ellipse 60% 50% at 30% 60%,
        rgba(80, 200, 120, 0.35)  0%,
        rgba(30, 140, 255, 0.25) 35%,
        rgba(180, 80, 255, 0.15) 60%,
        transparent              100%
    );
    filter: blur(80px);
    transform: rotate(-16deg);
    pointer-events: none;
}
