/* ═══════════════════════════════════════════════════════════════════════════
   INTERACTIVE CASES - MAIN STYLESHEET
   Revolutionary Medical Education Design System 2026
   ═══════════════════════════════════════════════════════════════════════════ */

/* Core Design System */
@import url('./design-system.css');

/* Component Library */
@import url('./components.css');

/* Animation System */
@import url('./animations.css');

/* Utility Classes */
@import url('./utilities.css');

/* Visual Intent System */
@import url('./visual-intent.css');

/* Visual Primitives */
@import url('./primitives.css');

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    background: rgba(10, 10, 10, 0.8);
    
    -webkit-
    border-bottom: 1px solid var(--border-subtle);
    z-index: var(--z-sticky);
    transition: background var(--duration-base);
}

.site-header.scrolled {
    background: rgba(10, 10, 15, 0.95);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: var(--weight-bold);
    font-size: var(--text-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: transform var(--duration-fast) var(--ease-spring);
}

.header-logo:hover {
    transform: scale(1.02);
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.header-nav-link {
    position: relative;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition:
        color var(--duration-fast),
        background var(--duration-fast);
}

.header-nav-link:hover {
    color: var(--text-primary);
    background: var(--depth-20);
}

.header-nav-link.active {
    color: var(--primary-400);
}

/* Animated underline */
.header-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--duration-base) var(--ease-spring), left var(--duration-base) var(--ease-spring);
}

.header-nav-link:hover::after,
.header-nav-link.active::after {
    width: 60%;
    left: 20%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UI CONTROLS (Toggles & Dropdowns)
   ═══════════════════════════════════════════════════════════════════════════ */

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
    cursor: pointer;
}

.toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-overlay);
    border-color: var(--border-strong);
    
}

/* Theme Toggle Icons */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    transition: transform var(--duration-base) var(--ease-spring);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

/* Language Dropdown */
.lang-toggle-wrapper {
    position: relative;
}

.lang-toggle-text {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.05em;
}

.lang-dropdown,
.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 180px;
    background: var(--bg-overlay);
    
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--duration-base) var(--ease-spring);
    z-index: 1000;
}

.lang-dropdown.open,
.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option,
.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.lang-option:hover,
.dropdown-item:hover {
    color: var(--text-primary);
    background: var(--bg-interactive);
}

.lang-option.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.lang-code {
    font-weight: var(--weight-bold);
    min-width: 24px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.page {
    min-height: 100vh;
    padding-top: var(--header-height);
}

.page-content {
    padding: var(--space-8) var(--space-4);
}

/* ─── Marketing Sections ─── */
.section-disruption,
.section-promise {
    padding: var(--space-20) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.disruption-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-10);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.disruption-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    font-size: var(--text-xl);
    color: var(--text-secondary);
}

.disruption-list li::before {
    content: "•";
    margin-right: var(--space-2);
    color: var(--primary-500);
}

.promise-card {
    max-width: 800px;
    margin: 0 auto;
}

.promise-text {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
    color: var(--text-primary);
}

.promise-text:last-child {
    margin-bottom: 0;
}

.section {
    padding: var(--space-16) 0;
}

.section-header {
    margin-bottom: var(--space-10);
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-3);
}

.section-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-20) var(--space-4);
    overflow: hidden;
}

/* Static gradient mesh background - no animation for performance */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(27, 107, 196, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 20%, rgba(20, 120, 90, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--primary-soft);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--primary-400);
    margin-bottom: var(--space-6);
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: var(--weight-black);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-6);
    color: var(--text-primary);
}

.hero-title .text-gradient-hero {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-10);
    max-width: 600px;
    margin-inline: auto;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.stat-card {
    position: relative;
    padding: var(--space-6);
    background: var(--glass-bg);
    
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition:
        transform var(--duration-base) var(--ease-spring),
        box-shadow var(--duration-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-4);
}

/* Rotating gradient border on hover */
.stat-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(from 0deg,
            transparent,
            var(--primary-500),
            transparent 30%);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: rotateBorder 3s linear infinite paused;
    transition: opacity var(--duration-base);
}

.stat-card:hover::before {
    opacity: 0.6;
    animation-play-state: running;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--depth-10);
    border-radius: calc(var(--radius-xl) - 1px);
    z-index: -1;
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.mode-card {
    position: relative;
    padding: var(--space-8);
    background: var(--glass-bg);
    
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    cursor: pointer;
    overflow: hidden;
    transition:
        transform var(--duration-base) var(--ease-spring),
        box-shadow var(--duration-base),
        border-color var(--duration-fast);
}

.mode-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-5);
    border-color: var(--border-strong);
}

/* Morphing blob background */
.mode-card::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: radial-gradient(circle, var(--card-accent, var(--primary-glow)) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--duration-slow);
    animation: blobMorph 8s ease-in-out infinite paused;
}

.mode-card:hover::before {
    opacity: 0.15;
    animation-play-state: running;
}

@keyframes blobMorph {

    0%,
    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    67% {
        border-radius: 50% 60% 30% 60% / 70% 40% 70% 30%;
    }
}

.mode-card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    border-radius: var(--radius-xl);
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
    transition:
        transform var(--duration-base) var(--ease-spring),
        box-shadow var(--duration-base);
}

.mode-card:hover .mode-card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: none;
}

.mode-card-title {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
}

.mode-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* Mode card variants */
.mode-card[data-mode="emergency"] {
    --card-accent: var(--danger-glow);
}

.mode-card[data-mode="story"] {
    --card-accent: var(--accent-teal);
}

.mode-card[data-mode="lab"] {
    --card-accent: var(--accent-cyan);
}

.mode-card[data-mode="surgery"] {
    --card-accent: var(--success-glow);
}

.mode-card[data-mode="forensic"] {
    --card-accent: var(--mode-forensic-accent, #64748B);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION (Mobile)
   ═══════════════════════════════════════════════════════════════════════════ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(10, 10, 15, 0.95);
    
    border-top: 1px solid var(--border-subtle);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: var(--z-sticky);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: var(--text-2xs);
    transition: color var(--duration-fast);
}

.bottom-nav-item.active {
    color: var(--primary-400);
}

.bottom-nav-icon {
    font-size: var(--text-xl);
}

/* Active indicator pill */
.bottom-nav-item.active .bottom-nav-icon {
    position: relative;
}

.bottom-nav-item.active .bottom-nav-icon::after {
    content: '';
    position: absolute;
    inset: -6px -12px;
    background: var(--primary-soft);
    border-radius: var(--radius-full);
    z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer {
    padding: var(--space-16) var(--space-4) var(--space-20);
    background: var(--depth-05);
    border-top: 1px solid var(--border-subtle);
    margin-bottom: var(--nav-height);
    /* Space for mobile nav */
}

@media (min-width: 768px) {
    .site-footer {
        margin-bottom: 0;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
    max-width: var(--container-xl);
    margin: 0 auto;
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.footer-tagline {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

.footer-nav-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.footer-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-nav-link {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--duration-fast);
}

.footer-nav-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: var(--container-xl);
    margin: var(--space-12) auto 0;
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 120;
    padding: 0;
}

.mobile-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* ========== MODE PAGES & BACK BUTTON ========== */
.back-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    transition: all var(--duration-base) var(--ease-out);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
}

.back-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-default);
    transform: translateX(-4px);
}

.mode-page {
    padding-top: calc(64px + var(--space-10));
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: var(--space-20);
}

.mode-hero {
    text-align: center;
    margin-bottom: var(--space-12);
}

.mode-icon-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    font-size: var(--text-3xl);
    box-shadow: var(--shadow-lg);
}

.mode-title {
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-2);
    letter-spacing: var(--tracking-tight);
}

.mode-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.mode-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.mode-feature-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    gap: var(--space-5);
    transition: all var(--duration-base) var(--ease-out);
}

.mode-feature-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.mode-feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.mode-feature-content h4 {
    margin-bottom: var(--space-1);
    font-weight: var(--weight-semibold);
}

.mode-feature-content p {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    line-height: var(--leading-relaxed);
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .site-header {
        padding: 0 var(--space-4);
        z-index: 100;
    }

    .mobile-toggle {
        display: flex;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: var(--surface-1);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px var(--space-6) var(--space-6);
        border-left: 1px solid var(--border-subtle);
        transition: right 0.3s ease-out;
        z-index: 99;
        box-shadow: var(--shadow-xl);
    }

    .header-nav-link {
        width: 100%;
        padding: var(--space-3);
        font-size: var(--text-lg);
        border-bottom: 1px solid var(--border-subtle);
        border-radius: 0;
    }

    .header-nav .btn {
        width: 100%;
        margin-top: var(--space-4);
        text-align: center;
    }

    /* Open State */
    body.mobile-menu-open .header-nav {
        right: 0;
    }

    body.mobile-menu-open .mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-menu-open .mobile-toggle span:first-child {
        transform: rotate(45deg);
    }

    body.mobile-menu-open .mobile-toggle span:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    body.mobile-menu-open .mobile-toggle span:last-child {
        transform: rotate(-45deg);
    }

    body.mobile-menu-open {

            overflow: hidden;

        }

    }

    

    /* Blocked choice styling */

    .choice-button.choice-blocked {

        opacity: 0.5;

        cursor: not-allowed;

        background: var(--surface-2, #2a2a2a);

        color: var(--text-3, #808080);

        border-color: var(--border-2, #404040);

    }

    

    .choice-button.choice-blocked:hover {

        transform: none; /* Disable hover effect */

        box-shadow: none;

    }

    

    .choice-badge-blocked {

        font-size: 0.75em;

        margin-left: 8px;

        padding: 2px 6px;

        border-radius: 4px;

        background: rgba(255, 0, 0, 0.1);

        color: #C8202A;

    }

    

    /* Mode-specific blocked states */

    [data-mode="emergency"] .choice-button.choice-blocked {

        border-left-color: rgba(122, 12, 12, 0.5);

    }

    

    [data-mode="practice"] .choice-button.choice-blocked {

        border-left-color: rgba(46, 111, 149, 0.5);

    }

    