/* ===========================================================
   Visual polish add-ons: scroll progress bar, testimonials
   section, and extra hover/micro-interactions layered on top of
   the existing design system in styles.css. Link this after
   styles.css and gallery.css:
     <link rel="stylesheet" href="enhancements.css">
   =========================================================== */

/* ----- Scroll progress bar ----- */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-gold), #f5dc9b);
    z-index: 2000;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ----- Testimonials section ----- */
.testimonials {
    background: #08080a;
}

/* Carousel track: a flex row inside .carousel-viewport (shared with the
   gallery section's carousel-wrapper/-viewport/-arrow classes in
   gallery.css) instead of a static grid, so testimonials-carousel.js can
   scroll it one card at a time. */
.testimonials-grid {
    display: flex;
    gap: 2rem;
}

.testimonials-carousel-wrapper {
    margin-top: 1rem;
}

.testimonials-viewport {
    scroll-snap-type: x mandatory;
}

.testimonial-card {
    scroll-snap-align: start;
    /* 3 visible per "page" on desktop, matching the two-gap math used for
       the gallery's own 3-up layout */
    flex: 0 0 calc((100% - 4rem) / 3);
}

@media (max-width: 900px) {
    .testimonial-card {
        flex: 0 0 calc((100% - 2rem) / 2);
    }
}

@media (max-width: 640px) {
    .testimonial-card {
        flex: 0 0 88%;
    }

    /* One visible card at a time on a phone, with lighter padding and a
       smaller quote mark so the card doesn't dwarf the actual review
       text (the 3.5rem quote glyph and 90px min-height were sized for
       the 3-up desktop grid, not a single narrow card). */
    .testimonial-card {
        padding: 1.8rem 1.5rem 1.6rem;
    }

    .testimonial-quote-mark {
        font-size: 2.6rem;
        margin-bottom: 0.3rem;
    }

    .testimonial-text {
        font-size: 0.95rem;
        min-height: 0;
        margin-bottom: 1.4rem;
    }

    .testimonials-note {
        font-size: 0.85rem;
    }
}

.testimonials-note {
    max-width: 640px;
    margin: 0.8rem auto 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.testimonials-source {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2.5rem;
    opacity: 0.75;
}

.testimonials-source a {
    color: var(--primary-gold);
    text-decoration: none;
}

.testimonials-source a:hover {
    text-decoration: underline;
}

.testimonial-card {
    padding: 2.4rem 2rem 2rem;
    position: relative;
    transition: var(--transition-smooth);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 25px var(--accent-glow);
}

.testimonial-quote-mark {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    color: var(--primary-gold);
    line-height: 1;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.testimonial-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.8rem;
    min-height: 90px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    color: var(--text-light);
    font-size: 0.95rem;
}

.testimonial-author span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

/* ----- Richer hover / micro-interactions on existing elements ----- */

/* Buttons: a quick, subtle scale-down on click gives tactile feedback */
.btn:active {
    transform: scale(0.97);
}

/* Config (floor plan) cards: lift + glow like the highlight cards, so every
   card-style block in the page behaves consistently */
.config-card {
    transition: var(--transition-smooth);
}

.config-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
    border-color: rgba(212, 175, 55, 0.35);
}

/* Premium/"Most Popular" config card gets a slow breathing glow so it
   naturally draws the eye without being distracting */
@keyframes premium-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
    50% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.25); }
}

.premium-card {
    animation: premium-glow 3.5s ease-in-out infinite;
}

/* Logo: a faint lift on hover instead of sitting completely static */
.logo img {
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.04);
}

/* WhatsApp float button: soft pulse ring so it doesn't blend into the
   corner of the page */
@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-float {
    animation: whatsapp-pulse 2.5s infinite;
}

/* Section subtitles ("LIFESTYLE", "CONNECTIVITY", etc.): a thin gold
   underline that grows in in when the section scrolls into view, matching
   the existing .reveal fade-up pattern */
.section-subtitle {
    position: relative;
    display: inline-block;
}

.section-subtitle::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    height: 1px;
    width: 100%;
    background: var(--primary-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease 0.15s;
}

/* .eh-inview is added by enhancements.js via its own IntersectionObserver -
   kept independent of whatever reveal-on-scroll mechanism script.js uses,
   so this works regardless of that file's internals */
.section-subtitle.eh-inview::after {
    transform: scaleX(1);
}
