@import url("style.css");

/* =========================================
   Staging Redesign Overrides
   ========================================= */

:root {
    --color-emsa-blue: #0d1941;
    /* Deep Blue */
    --color-emsa-yellow: #FFD700;
    /* Vibrant Yellow */
    --color-text-main: #ffffff;
    --glass-bg: rgba(13, 25, 65, 0.65);
    /* Darker blue, transparent */
    --glass-blur: 12px;
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Outfit', sans-serif;
    --pill-radius: 50px;
}

body.staging-redesign {
    font-family: var(--font-primary);
    background-color: #ffffff;
}

/* --- Navigation Pill --- */

/* Override existing .main-header from style.css */
.main-header.sticky-header {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 20px 0;
    position: fixed;
    /* fix to top */
    width: 100%;
    top: 0;
    z-index: 9999;
    pointer-events: none;
    /* Let clicks pass through outside the pill */
}

.nav-container-pill {
    pointer-events: auto;
    max-width: 900px;
    /* Thinner/Elongated containment */
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--pill-radius);
    padding: 10px 30px;
    /* Thinner height */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-area img {
    height: 35px;
    /* Smaller for thin pill */
    width: auto;
    transition: transform 0.3s;
}

.logo-area .logo-text {
    color: var(--color-text-main);
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-emsa-yellow);
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--color-text-main);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.btn-pill-action {
    background-color: var(--color-emsa-yellow);
    color: var(--color-emsa-blue);
    padding: 8px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.2s;
}

.btn-pill-action:hover {
    background-color: #e6c200;
    /* Darker Yellow/Gold */
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}



/* Mobile Toggle Override */
.mobile-menu-toggle {
    display: none;
    /* Hidden on desktop */
}

.mobile-menu-toggle span {
    background-color: white !important;
}

/* --- Hero Section --- */

.new-hero-section {
    position: relative;
    height: 100vh;
    /* Full viewport height */
    min-height: 600px;
    width: 100%;
    overflow: visible;
    /* Ensure wave SVG at bottom is not clipped */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -100px;
    /* Pull up behind the fixed header */
    padding-top: 100px;
    /* Compensate content */
    padding-bottom: 50px;
    /* Space for wave */
}

/* Wave Transition (Home & Subpages) */
/* Wave Transition (Home & Subpages) */
.new-hero-section::after,
.project-hero-v3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 120px;
    /* Simplified SVG: A defined yellow stroke path sitting on top of the white fill */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='1' d='M0,224L1440,224L1440,320L0,320Z'%3E%3C/path%3E%3Cpath fill='none' stroke='%23FFD700' stroke-width='15' d='M0,224 C480,224 960,120 1440,224'%3E%3C/path%3E%3Cpath fill='%23ffffff' d='M0,230 C480,230 960,130 1440,230 L1440,320 L0,320 Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: bottom;
    /* CRITICAL FIX: Ensures the bottom-aligned wave is seen */
    z-index: 10;
    pointer-events: none;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/emsa-reminin.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax Effect */
    z-index: -2;
}

.hero-bg-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(13, 25, 65, 0.85) 0%,
            rgba(13, 25, 65, 0.4) 100%);
    /* Deep blue overlay */
    z-index: -1;
}

.hero-content-centered {
    text-align: center;
    max-width: 800px;
    padding: 20px;
    animation: fadeIn 1s ease-out;
}

.hero-title {
    font-family: var(--font-secondary);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--color-emsa-yellow);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-primary-pill {
    background-color: var(--color-emsa-yellow);
    color: var(--color-emsa-blue);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid var(--color-emsa-yellow);
}

.btn-primary-pill:hover {
    background-color: transparent;
    color: var(--color-emsa-yellow);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.btn-secondary-pill {
    background-color: transparent;
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary-pill:hover {
    background-color: white;
    color: var(--color-emsa-blue);
    border-color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container-pill {
        width: 90%;
        padding: 10px 20px;
    }

    .logo-text,
    .nav-links,
    .nav-actions {
        display: none;
        /* Hide for hamburger menu logic if implementing later, for now just hiding links on mobile per simplified instruction or showing basic toggle */
    }

    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
    }

    /* Re-show logo image */
    .logo-area img {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    /* --- Subpage Hero (V3) --- */
    .project-hero-v3 {
        position: relative;
        height: 60vh;
        /* Shorter for subpages */
        min-height: 400px;
        width: 100%;
        margin-top: -100px;
        /* Behind header */
        padding-top: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .hero-bg-overlay-sub {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('../images/emsa-reminin.jpg');
        /* Reuse same nice BG */
        background-size: cover;
        background-position: center;
        z-index: -2;
    }

    .hero-bg-overlay-sub::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg,
                rgba(13, 25, 65, 0.9) 0%,
                /* Darker than home for readability */
                rgba(13, 25, 65, 0.6) 100%);
        z-index: -1;
    }

    .hero-content-v3 {
        text-align: center;
        color: white;
        z-index: 1;
        max-width: 800px;
        animation: fadeIn 1s ease-out;
    }

    .project-title-v3 {
        font-family: var(--font-secondary);
        font-size: 3rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        color: var(--color-emsa-yellow);
        /* Branding pop */
    }

    .project-tagline-v3 {
        font-family: var(--font-primary);
        font-size: 1.5rem;
    }

    /* Footer override for consistncy */
    .main-footer {
        background: var(--color-emsa-blue);
        color: white;
    }
}

/* --- About Section V3 (Premium) --- */
.about-section-v3 {
    padding: 80px 0;
    background-color: #ffffff !important;
    /* Force White with !important */
    /* Changed to white per user request */
}


.about-content-v3 {
    max-width: 1200px;
    /* Wider for side-by-side */
    margin: 0 auto;
    padding: 0 20px;
}

.about-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 60px;
}

.about-image-col {
    position: relative;
}

.about-featured-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    height: 400px;
    /* Consistent height */
}

.about-text-col {
    text-align: left;
}

.section-title-left {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    color: var(--color-emsa-blue);
    font-weight: 700;
    margin-bottom: 15px;
}

.underline-left {
    width: 60px;
    height: 4px;
    background-color: var(--color-emsa-yellow);
    /* Yellow accent like mockup reference? Or Blue? Mockup had blue text, maybe yellow underline. Keeping yellow for contrast */
    margin: 0 0 30px 0;
    border-radius: 2px;
}

.about-text-col p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    font-family: var(--font-primary);
}

/* Responsiveness for About */
@media (max-width: 900px) {
    .about-grid-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-text-col {
        text-align: center;
    }

    .underline-left {
        margin: 0 auto 30px;
    }
}

.about-stats-v3 {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    /* Closer to about text if separate, but user wants same flow */
    flex-wrap: wrap;
}

.stat-card-v3 {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Premium soft shadow */
    text-align: center;
    min-width: 250px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card-v3:hover {
    transform: translateY(-5px);
}

.stat-card-v3 .stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-emsa-blue);
    margin-bottom: 5px;
    font-family: var(--font-secondary);
}

.stat-card-v3 .stat-label {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* --- Mission Section V3 (Premium Grid) --- */
.mission-section {
    padding: 80px 0;
    background-color: white;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Force 4 columns on large screens */
    gap: 30px;
    margin-top: 50px;
}

/* Response for Mission Grid */
@media (max-width: 1024px) {
    .mission-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .mission-grid {
        grid-template-columns: 1fr;
    }
}


.mission-card {
    background: transparent;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mission-card:hover {
    transform: translateY(-5px);
}

.mission-icon {
    font-size: 3.5rem;
    /* Larger icons */
    color: var(--color-emsa-blue);
    margin-bottom: 25px;
    /* Optional: Add a yellow accent circle or shadow if possible, but keeping it simple for FA */
    text-shadow: 2px 2px 0px rgba(255, 215, 0, 0.2);
    /* Subtle yellow pop */
}

.mission-card h3 {
    font-size: 1.3rem;
    color: var(--color-emsa-blue);
    margin-bottom: 15px;
    font-weight: 700;
}

.mission-card p {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 25px;
    flex-grow: 1;
    /* Push the accent line to bottom if needed */
}

/* The yellow bottom line from the mockup */
.mission-accent-line {
    width: 40px;
    height: 4px;
    background-color: var(--color-emsa-yellow);
    border-radius: 2px;
    margin-top: auto;
    /* Push to bottom */
}

/* =========================================
   App Mode Toggles (managed by pwa-init.js)
   ========================================= */
body.app-mode .main-header,
body.app-mode header,
body.app-mode footer,
body.app-mode .main-footer {
    display: none !important;
}

body.app-mode #bottomNav {
    display: flex !important;
}

body:not(.app-mode) #bottomNav {
    display: none !important;
}

/* =========================================
   PWA Bottom Navigation (Styles)
   ========================================= */
:root {
    --emsa-blue: #2563eb;
    /* Note: This differs from --color-emsa-blue (#181d4d). Keeping user's requested blue for this specific component. */
    --glass-bg-nav: rgba(255, 255, 255, 0.75);
    --liquid-border: rgba(255, 255, 255, 0.5);
}

/* Main Navigation Container - Default hidden, styled globally */
.pill-nav {
    font-family: 'Inter', sans-serif;
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 380px;
    height: 72px;
    background: var(--glass-bg-nav);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border-radius: 40px;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px 0 rgba(255, 255, 255, 0.8);
    border: 1.5px solid var(--liquid-border);
    z-index: 99999 !important;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
    text-decoration: none;
    flex: 1;
    height: 60px;
    z-index: 2;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.nav-item.active {
    color: var(--emsa-blue);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item:active svg {
    transform: scale(0.85);
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* Sliding Active Indicator */
.active-pill {
    position: absolute;
    height: 52px;
    width: 76px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-radius: 28px;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(37, 99, 235, 0.1);
    pointer-events: none;
}

/* Projects Popover Bubble */
.popover {
    font-family: 'Inter', sans-serif;
    position: absolute;
    bottom: 85px;
    background: var(--glass-bg-nav);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-radius: 24px;
    padding: 10px;
    width: 170px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15), inset 0 1px 3px rgba(255, 255, 255, 0.6);
    border: 1.5px solid var(--liquid-border);
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px) scale(0.9);
    transform-origin: bottom center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1001;
}

.popover.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.popover-link {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.popover-link:active {
    background: rgba(37, 99, 235, 0.08);
    transform: scale(0.97);
}

/* Triangle tail */
.popover::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--liquid-border);
    opacity: 0.5;
}

/* Handle Notch/Home Bar on iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pill-nav {
        bottom: calc(32px + env(safe-area-inset-bottom));
    }
}

/* Strict Override for Header Sign Up Button (Global Staging) */
.btn-static-yellow,
.btn-static-yellow:focus,
.btn-static-yellow:active {
    background-color: #FDC800 !important;
    color: #181d4d !important;
    border: 2px solid #FDC800 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transform: none !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

/* =========================================
   App Mode Logic (Overrides everything)
   ========================================= */
/* FORCE display flex if body has .app-mode class, regardless of media queries */
body.app-mode .pill-nav,
body.app-mode #bottomNav {
    display: flex !important;
}


.btn-static-yellow:hover {
    box-shadow: 0 0 15px rgba(253, 200, 0, 0.7) !important;
}

/* =========================================
   SAFE PADDING UTILITIES (Prevent Layout Shift)
   ========================================= */

/* Standardized Page Padding (Matches Header Height + Breathing Room) */
.standard-page-padding {
    padding-top: 140px !important;
}

@media (min-width: 1024px) {
    .standard-page-padding {
        padding-top: 180px !important;
    }
}



/* =========================================
   Turbo / Hotwire Animations
   ========================================= */

@keyframes fadeInTurbo {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animate MAIN content on load */
/* This gives the "fade up" effect when a new page renders */
body main,
body>.container,
body>.w-full {
    animation: fadeInTurbo 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Optional: Fade content OUT when clicking a link */
html.turbo-loading main,
html.turbo-loading body>.container,
html.turbo-loading body>.w-full {
    opacity: 0.6;
    transform: scale(0.99);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Ensure Persistent Elements (Menu) DO NOT Animate */
.pill-nav,
.main-header {
    animation: none !important;
    transition: none !important;
    /* Opacity is handled by PWA logic, don't let Turbo override it */
}