/* ━━━━━━━━━━━━━━━━━━━━━━━
   PREMIUM HERO SECTION STYLES
   ━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
    --hero-bg-dark: #050b14;
    --hero-mesh-1: rgba(0, 51, 102, 0.4);
    --hero-mesh-2: rgba(0, 168, 107, 0.15);
    --hero-mesh-3: rgba(0, 86, 179, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --gold-accent: #FFC107;
}

/* Base Wrapper */
.hero-premium-wrapper {
    position: relative;
    width: 100%;
    background-color: var(--hero-bg-dark);
    /* Remove strict overflow:hidden to allow sticky to work properly in parents */
    overflow: clip; 
    color: #ffffff;
    font-family: var(--font-body);
}

/* Scroll Container (Sticky Storytelling) */

@media (min-width: 769px) {
    .hero-premium-wrapper {
        height: auto;
        min-height: 100vh;
    }
    .hero-sticky-container {
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding-top: 100px;
        padding-bottom: 50px;
    }
}

.hero-sticky-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Safe here as it only clips children of the sticky item */
    padding-top: 60px; /* Account for navbar */
    box-sizing: border-box;
}

/* Mesh Gradient Background */
.hero-bg-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(circle at 15% 50%, var(--hero-mesh-1), transparent 50%),
                radial-gradient(circle at 85% 30%, var(--hero-mesh-2), transparent 50%),
                radial-gradient(circle at 50% 80%, var(--hero-mesh-3), transparent 50%);
    filter: blur(60px);
    opacity: 0.8;
    animation: meshBreathing 15s ease-in-out infinite alternate;
}

@keyframes meshBreathing {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 0.9; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Floating Particles Container */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Layout Grid - 3 Columns (Desktop) */
.hero-grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    width: 95%;
    max-width: 1600px;
    height: 100%;
    align-items: center;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━
   COLUMN 1: CONTENT
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.hero-col-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 20px;
    z-index: 15;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-accent);
    margin-bottom: 20px;
    width: max-content;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-col-content h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background: linear-gradient(to right, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-col-content .hero-subtitle {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    color: #cccccc;
    margin-bottom: 30px;
    max-width: 90%;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #00d285);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 10px 20px rgba(0, 168, 107, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 168, 107, 0.4);
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.hero-trust-indicators {
    display: flex;
    gap: 30px;
    align-items: center;
}
.trust-metric {
    display: flex;
    flex-direction: column;
}
.trust-metric .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}
.trust-metric .label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.trust-avatars {
    display: flex;
    align-items: center;
}
.trust-avatars img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--hero-bg-dark);
    margin-left: -10px;
}
.trust-avatars img:first-child { margin-left: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━
   COLUMN 2: DOCTOR CENTER
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.hero-col-doctor {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
    z-index: 20;
}

/* Layered depth effects for Doctor */
.doctor-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
}

.doctor-image-wrapper {
    position: relative;
    height: 90%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transform-style: preserve-3d;
    will-change: transform;
}

.doctor-cutout {
    max-height: 100%;
    max-width: 140%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
    animation: floatIdle 6s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes floatIdle {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.01); }
    100% { transform: translateY(0px) scale(1); }
}

/* Floating Trust Cards around Doctor */
.floating-card {
    position: absolute;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 25;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.floating-card:hover {
    transform: translateY(-5px) scale(1.05) !important; /* Override parallax temp */
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2);
}

.fc-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-accent);
    font-size: 1.2rem;
}

.fc-content h2, .fc-content h3, .fc-content h4 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    font-family: var(--font-heading);
}
.fc-content p {
    margin: 0;
    font-size: 0.75rem;
    color: #bbb;
}

/* Card Positioning (Desktop) */
.card-rating { top: 20%; left: -10%; animation-delay: 0s; }
.card-experience { bottom: 25%; left: -20%; animation-delay: 1s; }
.card-recovery { top: 40%; right: -15%; animation-delay: 0.5s; }
.card-homevisit { bottom: 15%; right: -5%; animation-delay: 1.5s; }

/* ━━━━━━━━━━━━━━━━━━━━━━━
   COLUMN 3: MOBILE MOCKUP
   ━━━━━━━━━━━━━━━━━━━━━━━ */
.hero-col-phone {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 15;
    perspective: 1200px;
}

/* Enhance existing phone presentation */
.phone-presentation-wrapper {
    position: relative;
    /* The internal phone structure is kept identical to original */
}

/* Premium glows behind phone */
.phone-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(0, 168, 107, 0.2) 0%, transparent 60%);
    z-index: -1;
    filter: blur(40px);
    animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE DESIGN (SCROLL STORYTELLING)
   ━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet */
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    .hero-col-phone {
        grid-column: 1 / -1;
        margin-top: 40px;
    }
    .card-experience { left: 0; }
    .card-rating { left: 0; }
    .card-recovery { right: 0; }
    .hero-premium-wrapper { height: auto; }
}

@media (max-width: 768px) {
    /* Mobile Cinematic Scroll Story (Sticky) */
    
    .hero-premium-wrapper {
        height: 250vh; /* Reduced for single scroll change */
    }

    .hero-sticky-container {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        padding-top: 70px;
    }

    .hero-grid {
        position: relative;
        display: block; /* We'll absolute position children */
        width: 100%;
        height: 100%;
    }

    /* ALL COLUMNS: Absolute positioning in same spot, stacked */
    .hero-col-content, 
    .hero-col-doctor, 
    .hero-col-phone {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0; /* Default invisible, managed by JS */
        pointer-events: none; /* Ignore clicks when hidden */
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        padding: 20px;
        box-sizing: border-box;
    }

    /* Active state makes it clickable */
    .hero-col-content.active,
    .hero-col-doctor.active,
    .hero-col-phone.active {
        pointer-events: auto;
    }

    /* STEP 1: Content Area */
    .hero-col-content {
        flex-direction: column;
        text-align: center;
        opacity: 1; /* First frame visible initially */
        transform: translateY(0);
        z-index: 10;
        padding-bottom: 80px; /* Space for scroll */
    }

    .hero-col-content h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .hero-actions {
        justify-content: center;
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-btn-primary, .hero-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-trust-indicators {
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }

    /* STEP 2: Doctor Area */
    .hero-col-doctor {
        padding-top: 20px;
        z-index: 20;
    }

    .doctor-image-wrapper {
        height: 60vh;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: flex-end;
    }
    
    .doctor-cutout {
        max-width: 100%;
        max-height: 100%;
    }

    .floating-card {
        padding: 8px 12px;
        transform: scale(0.8); /* Smaller on mobile */
        opacity: 0; /* JS handles fade in */
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .fc-icon { width: 30px; height: 30px; font-size: 1rem; }
    .fc-content h2, .fc-content h3, .fc-content h4 { font-size: 0.9rem; }
    .fc-content p { font-size: 0.65rem; }

    /* Reposition cards for mobile */
    .card-rating { top: 5%; left: 0%; }
    .card-experience { bottom: 20%; left: 0%; }
    .card-recovery { top: 20%; right: 0%; }
    .card-homevisit { bottom: 5%; right: 0%; }

    /* STEP 3: Phone Area */
    .hero-col-phone {
        z-index: 30;
    }

    .phone-mockup {
        transform: scale(0.85); /* Fit smaller screens */
    }
    
    .phone-mockup:hover {
        transform: scale(0.85); /* Disable heavy hover transform on mobile */
    }
}
