/* Modern Theme Extensions for Medora - Hybrid Medical Edition */

:root {
    --bg-page: #F8FAFC;       /* Slate 50 */
    --surface-card: #FFFFFF;
    --text-primary: #0F172A;  /* Slate 900 */
    --text-secondary: #64748B; /* Slate 500 */
    --accent-blue: #0F172A;   /* Midnight Blue */
    --primary-light: #0EA5E9;
}

body {
    background-color: var(--bg-page) !important;
    color: var(--text-primary) !important;
}

/* --- Modern Hero Section (Retain Dark Impact) --- */
.modern-hero {
    position: relative;
    min-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 2rem 80px;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.15), transparent 50%),
                radial-gradient(circle at bottom left, rgba(45, 212, 191, 0.1), transparent 50%),
                #0F172A; /* Dark Blue Base */
    overflow: hidden;
    padding-top: 100px;
    color: white; /* Force white text in hero */
}
/* Ensure header is visible on modern theme */
/* Modern Floating Navigation */
.site-nav {
    background: rgb(255, 255, 255) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    height: 80px !important;
    padding: 0 4rem !important;
    margin-top: 20px;
    width: 90% !important;
    left: 50% !important;
    transform: translateX(-50%);
    border-radius: 100px;
}

.site-nav.scrolled {
    margin-top: 10px;
    width: 95% !important;
    height: 70px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1);
}

.nav-links a {
    font-weight: 600 !important;
    color: var(--text-main) !important;
    padding: 8px 16px;
    border-radius: 100px;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    will-change: color, background-color, transform;
}

.nav-links a:hover, 
.nav-links a.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary) !important;
}

.mobile-nav-header {
    display: none;
}

/* Ensure mobile toggle is visible */
.mobile-nav-toggle {
    color: var(--text-main) !important;
}

@media (max-width: 992px) {
    .site-nav {
        width: 95% !important;
        padding: 0 1.25rem !important;
        margin-top: 10px;
        border-radius: 20px;
        justify-content: space-between;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(105%);
        width: 85%;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 40px 2rem;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: -15px 0 40px rgba(15, 23, 42, 0.1);
        display: flex !important;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        width: 100%;
        font-size: 1.1rem;
        padding: 1.25rem 1rem;
        border-radius: 12px;
        margin-bottom: 0.5rem;
        transition: all 0.2s ease;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        z-index: 999;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: #F8FAFC;
        border-radius: 10px;
        border: 1.5px solid #E2E8F0;
        z-index: 1001;
        color: #0F172A !important;
    }

    .mobile-nav-header {
        display: block;
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #E2E8F0;
        text-align: left;
    }

    .mobile-nav-logo {
        height: 38px;
    }
}

/* Student Portal CTA Button */
.nav-cta-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 18px !important;
    background: rgba(14, 165, 233, 0.08) !important;
    color: #0EA5E9 !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    border: 1.5px solid rgba(14, 165, 233, 0.2) !important;
    transition: all 0.25s ease !important;
    margin-left: 12px;
}

.nav-cta-btn:hover {
    background: rgba(14, 165, 233, 0.12) !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
    color: #0284C7 !important;
}

/* Don't apply typical nav-link hover states to CTA */
.nav-links a.nav-cta-btn:hover {
    background: rgba(14, 165, 233, 0.12) !important;
}

@media (max-width: 992px) {
    .nav-cta-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 8px;
    }
}


.modern-hero-content {
    max-width: 1400px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.modern-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(14, 165, 233, 0.2);
}


.modern-title {
    font-size: clamp(3.5rem, 6vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #FFFFFF 0%, #94A3B8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modern-subtitle {
    font-size: 1.25rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 3rem;
}

/* Fix Logo Visibility */
/* Fix Logo Visibility - High Priority */
.nav-lux .brand-logo,
.site-nav .brand-logo {
    filter: brightness(0) saturate(100%) !important; /* Force black logo */
    opacity: 0.9 !important;
    transition: filter 0.3s ease;
}

.modern-cta-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.modern-btn {
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    will-change: transform, opacity, background-color, box-shadow;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.modern-btn-primary {
    background: white;
    color: var(--primary) !important;
    box-shadow: 0 10px 30px -5px rgba(14, 165, 233, 0.4);
}

.modern-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.6);
}

.modern-btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white !important;
}

.modern-btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Simple Theme Matching Buttons */
.btn-simple {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    text-decoration: none !important;
}

.btn-simple-primary {
    background: #0EA5E9;
    color: white !important;
}

.btn-simple-primary:hover {
    background: #0284C7;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(14, 165, 233, 0.3);
}

.btn-simple-outline {
    background: transparent;
    border: 1.5px solid #E2E8F0;
    color: #64748B !important;
}

.btn-simple-outline:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A !important;
    transform: translateY(-2px);
}

.btn-simple-glass {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    will-change: background-color, transform;
}

.btn-simple-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}


/* --- Hero Visuals --- */
.modern-visual {
    position: relative;
    height: 600px;
    /* overflow: visible to let cards float out */
    z-index: 10;
}

.visual-inner {
    width: 100%;
    height: 100%;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 40px 80px -20px rgba(15, 23, 42, 0.15);
}

.visual-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modern-visual:hover .visual-inner img {
    transform: scale(1.05);
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

.float-1 { bottom: 40px; left: -30px; }
.float-2 { top: 60px; right: -30px; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* --- Bento Grid Section --- */
.bento-section {
    padding: 120px 2rem;
    background: #F8FAFC;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 240px;
    gap: 1.5rem;
    margin-top: 1rem;
}

.bento-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid #E2E8F0;
    will-change: transform, box-shadow;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-card h3 { 
    color: var(--text-primary); 
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.bento-card p { 
    color: var(--text-secondary); 
    font-size: 0.95rem;
    line-height: 1.6;
}

.bento-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.08);
    border-color: rgba(14, 165, 233, 0.3);
}

.bento-large { 
    grid-column: span 2; 
    flex-direction: row !important;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem;
}

.bento-large .bento-content {
    flex: 1;
}

.bento-tall { 
    grid-row: span 2; 
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: white !important; 
    border: none;
}

.bento-tall h3, .bento-tall p {
    color: white !important;
}

.bento-icon {
    width: 50px;
    height: 50px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0EA5E9;
    margin-bottom: 1.5rem;
}

.bento-tall .bento-icon {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.bento-visual-mini {
    position: relative;
    width: 45%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* Adjust for smaller bento cards that might use absolute positioning */
.bento-card:not(.bento-large) .bento-visual-mini {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60%;
    height: 120px;
    mask-image: linear-gradient(to top left, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top left, black 50%, transparent 100%);
    border-top-left-radius: 20px;
}

.bento-stat-pill {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: inline-block;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Marquee (Light) --- */
.logo-ticker {
    padding: 60px 0;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    background: white;
    overflow: hidden;
}

.ticker-track {
    display: flex;
    gap: 4rem;
    animation: scroll 30s linear infinite;
    width: max-content;
}

.ticker-item {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 0.5;
    white-space: nowrap;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Mobile Responsive Enhancements --- */
@media (max-width: 992px) {
    .modern-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .modern-badge { margin-inline: auto; }
    .modern-subtitle { margin-inline: auto; }
    .modern-cta-group { justify-content: center; }
    .modern-visual { height: 400px; }
    
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: min-content;
        gap: 1.5rem;
    }
    .bento-large {
        flex-direction: column !important;
        text-align: center;
        gap: 1.5rem;
    }
    .bento-large .bento-icon {
        margin-inline: auto;
    }
    .bento-large .bento-visual-mini {
        width: 100%;
        height: 200px;
        min-height: 200px;
    }
    .bento-large, .bento-tall { grid-column: auto; grid-row: auto; min-height: min-content; padding: 2rem; }
    
    .float-1 { bottom: 20px; left: 10px; right: auto; }
    .float-2 { top: 20px; right: 10px; }
}

@media (max-width: 768px) {
    .modern-hero { padding: 120px 1.25rem 60px; }
    .modern-title { font-size: 2.5rem; }
    .modern-btn { width: 100%; justify-content: center; }
    .ticker-track { gap: 2.5rem; }
    .subject-grid { grid-template-columns: 1fr; }
    
    .lux-container { padding: 0 1.25rem; }
    
    section { padding: 60px 0 !important; }
    
    .section-head h2 { font-size: 2rem !important; }
}

/* --- Subject Cards (Non-commercial) --- */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.subject-card {
    position: relative;
    height: 280px;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    /* transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); */ 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #0F172A; /* Keep cards dark for image overlay contrast */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.subject-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
}

.subject-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.subject-card:hover .subject-bg {
    transform: scale(1.1);
}

.subject-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    color: white;
}

.subject-arrow {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    opacity: 0;
    transform: translate(-10px, 10px);
    transition: all 0.4s ease;
}

.subject-card:hover .subject-arrow {
    opacity: 1;
    transform: translate(0, 0);
    background: white;
    color: var(--primary);
}

/* --- Catalog / Media Interface --- */
.catalog-hero {
    position: relative;
    padding: 160px 2rem 80px;
    background: #0F172A;
    color: white;
    text-align: center;
    background-image: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.15), transparent 60%);
}

.catalog-search-wrapper {
    max-width: 600px;
    margin: 2rem auto 0;
    position: relative;
}

.catalog-search-input {
    width: 100%;
    padding: 16px 24px 16px 54px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.catalog-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* --- Dark Command Bar (Sticky) --- */
.control-bar-sticky {
    position: sticky;
    top: 80px; /* Below Main Nav */
    z-index: 90;
    background: rgba(15, 23, 42, 0.95); /* Slate 900 Glass */
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cb-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.cb-bottom-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 4px; /* Space for scrollbar if needed */
    scrollbar-width: none;
}
.cb-bottom-row::-webkit-scrollbar { display: none; }

/* Dark Search Input */
.compact-search {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.compact-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.compact-search input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #38BDF8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
    outline: none;
}

.compact-search input::placeholder { color: #64748B; }

/* Dark Filter Pills */
.filter-pill {
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.filter-pill:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-pill.active {
    background: #38BDF8;
    color: #0F172A; /* Dark text on bright button */
    border-color: #38BDF8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

/* View Toggles (Dark) */
.view-toggles {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.view-btn {
    padding: 8px;
    border-radius: 6px;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .control-bar-sticky { padding: 1rem; }
    .cb-top-row { flex-direction: column; align-items: stretch; gap: 1rem; }
    .compact-search { max-width: 100%; }
    .view-toggles { align-self: flex-end; }
}
/* --- 2.0 ROBUST CATALOG DESIGN --- */
.catalog-2-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem; /* Added top padding */
    display: grid;
    grid-template-columns: 240px 1fr; /* Reduced sidebar width */
    gap: 2.5rem;
    position: relative;
}

/* Sidebar (Desktop) */
.catalog-2-sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 1rem;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #E2E8F0 transparent;
}

.catalog-2-sidebar::-webkit-scrollbar { width: 4px; }
.catalog-2-sidebar::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }

/* RE-ADDED FILTER STYLES */
.sidebar-section {
    margin-bottom: 1.5rem; /* Compact spacing */
    border-bottom: 1px solid #F1F5F9;
    padding-bottom: 1rem;
}

.sidebar-section:last-child { border-bottom: none; }

.sidebar-title {
    font-size: 0.8rem; /* Smaller title */
    font-weight: 800;
    color: #475569; /* Softer color */
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 0;
    cursor: pointer;
    color: #64748B;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border-radius: 12px;
}

.filter-option:hover { 
    background: rgba(14, 165, 233, 0.05);
    color: #0EA5E9; 
}

.filter-option.active {
    background: rgba(14, 165, 233, 0.1);
    color: #0EA5E9;
    font-weight: 700;
}

/* Detailed Hero Section */
.catalog-2-hero {
    background: #0F172A;
    padding: 140px 2rem 80px; /* Increased top padding to clear header */
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.catalog-2-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.9rem;
    color: #94A3B8;
    margin-bottom: 1.5rem;
}

.hero-stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    color: #E2E8F0;
    margin-top: 1.5rem;
}
/* Mobile Filter Trigger */
.mobile-filter-bar {
    display: none; /* Hidden on desktop */

    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 100px; /* Adjusted to be below the floating header (80px + 20px margin) */
    z-index: 40;
}

.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0EA5E9;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    color: #FFFFFF;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
    transition: all 0.2s;
}

.mobile-filter-btn:active {
    transform: scale(0.95);
}

/* Grid Layout */
.catalog-2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* List/Table Layout */
.catalog-2-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Card Design (Grid) */
.course-card-2 {
    background: white;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.course-card-2:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(15, 23, 42, 0.1);
    border-color: #E2E8F0;
}

.cc2-thumb-container {
    position: relative;
    aspect-ratio: 16/9;
}

.cc2-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc2-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cc2-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.cc2-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.cc2-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #64748B;
    font-size: 0.85rem;
}

/* ROW VERSION FOR LIST VIEW */
.course-card-2-row {
    display: flex;
    background: white;
    border: 1px solid #F1F5F9;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 180px;
}

.course-card-2-row:hover {
    transform: translateX(6px);
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    border-color: #0EA5E9;
}

.cc2-row-thumb {
    width: 280px;
    position: relative;
    flex-shrink: 0;
}

.cc2-row-body {
    flex: 1;
    padding: 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 992px) {
    .cc2-row-thumb { width: 220px; }
    .cc2-row-body { padding: 1.5rem; }
}

@media (max-width: 768px) {
    .course-card-2-row { flex-direction: column; }
    .cc2-row-thumb { width: 100%; height: 200px; }
}

.catalog-2-list .cc2-thumb-container {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid #F1F5F9;
    aspect-ratio: auto;
}

.catalog-2-list .cc2-body {
    justify-content: center;
    padding: 1.5rem 2rem;
}

.catalog-2-list .cc2-meta {
    border-top: none;
    padding-top: 0;
    margin-top: 1rem;
    justify-content: flex-start;
    gap: 2rem;
}

/* Search Bar (In Content) */
.content-search-bar {
    position: relative;
    margin-bottom: 2rem;
    max-width: 100%;
}

.content-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.content-search-input:focus {
    border-color: #38BDF8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    outline: none;
}

/* View Switcher */
.view-switcher-2 {
    display: flex;
    gap: 4px;
    background: #F1F5F9;
    padding: 4px;
    border-radius: 8px;
}

.vs-btn {
    padding: 6px;
    border-radius: 6px;
    color: #94A3B8;
    cursor: pointer;
}

.vs-btn.active { background: white; color: #0F172A; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* MOBILE RESPONSIVE OVERRIDES */
.mobile-filters-modal { display: none; } /* Default hidden on desktop */

@media (max-width: 1024px) {
    .catalog-2-container { grid-template-columns: 1fr; padding-top: 1rem; }
    .catalog-2-sidebar { display: none; /* Hide desktop sidebar */ }
    .mobile-filter-bar { display: flex; }
    
    /* Force Grid on Mobile even if List is selected (UX Best Practice) */
    .catalog-2-list .course-card-2 {
        flex-direction: column;
        height: auto;
    }
    
    .catalog-2-list .cc2-thumb-container {
        width: 100%;
        border-right: none;
        aspect-ratio: 16/9;
    }

    /* Filters Modal (Hidden by default) */
    .mobile-filters-modal {
        position: fixed;
        inset: 0;
        z-index: 100;
        background: white;
        padding: 2rem;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: block !important; /* Always valid DOM, hidden by transform */
    }
    
    .mobile-filters-modal.open { transform: translateY(0); }
}

/* --- List View Transformations --- */
.media-grid.list-view {
    grid-template-columns: 1fr; /* Single column */
    gap: 1.5rem;
}

.media-grid.list-view .media-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    align-items: center;
    border-radius: 12px;
}

.media-grid.list-view .media-thumb-wrapper {
    height: 100%;
    aspect-ratio: auto; /* Let it fill height */
    min-height: 180px;
}

.media-grid.list-view .media-content {
    padding: 1.5rem 2rem;
}

.media-grid.list-view .media-card:hover {
    transform: translateX(4px); /* Side nudge instead of up */
}

@media (max-width: 1024px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-sidebar { display: none; /* Hide sidebar on mobile for now or use drawer */ }
    .media-grid.list-view .media-card { grid-template-columns: 1fr; }
    .media-grid.list-view .media-thumb-wrapper { height: 200px; }
}

.glass-stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
}

.course-list-row {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden;
    display: grid;
    grid-template-columns: 280px 1fr auto;
}

.course-list-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05);
    border-color: #CBD5E1;
}

.course-list-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 180px;
}

.course-list-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.course-list-actions {
    padding: 2rem;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-left: 1px solid #E2E8F0;
    min-width: 180px;
}

/* --- Search Animations --- */
.media-card {
    /* existing styles... */
    transition: all 0.3s ease-out;
}

.media-card.hidden {
    display: none;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
    font-size: 1.25rem;
    display: none;
}

@media (max-width: 900px) {
    .subject-intro-grid { grid-template-columns: 1fr; }
    .course-list-row { grid-template-columns: 1fr; }
    .course-list-thumb { height: 200px; }
    .course-list-actions { 
        border-left: none; 
        border-top: 1px solid #E2E8F0; 
        flex-direction: row; 
        gap: 1rem;
        padding: 1.5rem;
    }
}
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0 2rem 4rem;
    max-width: 1600px;
    margin: 0 auto;
}

.media-card {
    border-radius: 16px;
    overflow: hidden;
    background: white;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: 1px solid #F1F5F9;
}

.media-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.1);
}

.media-thumb-wrapper {
    position: relative;
    aspect-ratio: 16/9; /* Cinematic Ratio */
    overflow: hidden;
}

.media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.media-card:hover .media-thumb { transform: scale(1.05); }

.media-content {
    padding: 1.5rem;
}

.media-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.filter-header {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: color 0.2s;
}

.filter-option:hover { color: var(--primary); }

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #CBD5E1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: white;
}

.filter-option.active .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* --- App Course Card (Light) --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.app-course-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.app-course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
    border-color: rgba(14, 165, 233, 0.3);
}

.app-card-thumb {
    height: 180px;
    width: 100%;
    object-fit: cover;
    opacity: 1;
}

.app-card-body {
    padding: 1.5rem;
}

.app-card-body h3 { color: var(--text-primary); }
.app-card-body .text-muted { color: var(--text-secondary) !important; }

/* ... Badges retain existing free/pro styles ... */

.access-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.badge-free {
    background: rgba(255, 255, 255, 0.9);
    color: #10B981; 
    border: none;
}

.badge-pro {
    background: rgba(15, 23, 42, 0.9);
    color: #FBBF24;
    border: none;
}

/* --- Course Details Page (Hero Dark, Content Light) --- */
.course-header-hero {
    background: #0F172A; /* Keep Hero Dark */
    padding: 140px 2rem 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.course-header-hero h1 { color: white; }
.course-header-hero p { color: #94A3B8; }

.lesson-list {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.2s;
    cursor: pointer;
    background: white;
}

.lesson-item:hover { background: #F8FAFC; }
.lesson-item:last-child { border-bottom: none; }

.item-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.lesson-item.unlocked .item-status-icon {
    background: #DCFCE7; /* Green 100 */
    color: #10B981;
}

.lesson-item.locked { opacity: 0.6; pointer-events: none; }
.lesson-item .text-main { color: var(--text-primary); } /* Restore dark text */

/* --- Lesson Viewer (Cinematic Design) --- */
.lesson-hero {
    background: #0F172A;
    padding: 140px 2rem 40px;
    color: white;
}

.lesson-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 5rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    align-items: start;
}

.video-wrapper-standard {
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.3);
    aspect-ratio: 16/9;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.lesson-content-tabs {
    display: flex;
    gap: 3rem;
    border-bottom: 2px solid #F1F5F9;
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.lesson-content-tabs::-webkit-scrollbar { display: none; }

.lesson-tab {
    padding: 0 0 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    color: #94A3B8;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    white-space: nowrap;
}

.lesson-tab.active {
    color: #0EA5E9;
}

.lesson-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0EA5E9;
    box-shadow: 0 -2px 10px rgba(14, 165, 233, 0.4);
}

.lesson-sidebar-card {
    background: white;
    border: 1px solid #F1F5F9;
    border-radius: 24px;
    overflow: hidden;
    position: sticky;
    top: 100px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05);
}

.sidebar-header {
    background: #0F172A;
    padding: 1.5rem 2rem;
    color: white;
    font-family: 'Outfit';
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-list {
    max-height: 500px;
    overflow-y: auto;
}

.playlist-item {
    padding: 1.5rem 2rem;
    transition: background 0.2s;
    cursor: pointer;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.playlist-item:hover { background: #F8FAFC; }
.playlist-item.active { background: #F0F9FF; border-left: 4px solid #0EA5E9; }

@media (max-width: 1200px) {
    .lesson-container { grid-template-columns: 1fr; gap: 4rem; }
    .lesson-sidebar-card { position: relative; top: 0; }
    aside { order: -1; }
}

/* --- Subject Detail View (Restored) --- */
.subject-hero {
    background: #0F172A;
    color: white;
    padding: 140px 2rem 80px;
    position: relative;
    overflow: hidden;
}

.subject-intro-grid {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

.glass-stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.course-list-row {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    gap: 2rem;
}

.course-list-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.1);
    border-color: #CBD5E1;
}

.course-list-thumb {
    width: 240px;
    height: 150px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.course-list-content { flex: 1; }

.course-list-actions {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 2rem;
    border-left: 1px solid #F1F5F9;
}


@media (max-width: 1024px) {
    .subject-intro-grid { 
        grid-template-columns: 1fr; 
        gap: 3rem;
    }
    .glass-stat-card { margin-top: 1rem; }
    
    .course-list-row { 
        flex-direction: column; 
        gap: 1.5rem;
    }
    .course-list-thumb { 
        width: 100%; 
        height: 220px; 
    }
    .course-list-actions { 
        width: 100%; 
        padding-left: 0; 
        border-left: none; 
        padding-top: 1.5rem; 
        border-top: 1px solid #F1F5F9; 
        flex-direction: row; 
    }
}

@media (max-width: 768px) {
    .modern-hero {
        padding: 120px 1.25rem 60px !important;
    }
    
    .section-head h2 { font-size: 2.25rem !important; }
    
    .bento-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .subject-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

/* --- Optimized Medical Preloader --- */
#site-preloader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 999999; /* Higher priority */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.5s;
    will-change: opacity, visibility;
    transform: translateZ(0);
}

#site-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.medical-loader {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-logo-container {
    position: relative;
    z-index: 2;
    animation: heartbeat 1.5s ease-in-out infinite;
    will-change: transform;
}

.loader-logo-inner {
    width: 80px;
    height: auto;
    filter: brightness(0); /* Clean black logo */
}

/* Unique Medical Heartbeat Rings */
.pulse-ring {
    position: absolute;
    border: 2px solid #0EA5E9;
    border-radius: 50%;
    opacity: 0;
    animation: ringPulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    will-change: transform, opacity;
}

.pulse-ring:nth-child(2) { animation-delay: 0.5s; }
.pulse-ring:nth-child(3) { animation-delay: 1s; }

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.12); }
    20% { transform: scale(1); }
    30% { transform: scale(1.08); }
    40% { transform: scale(1); }
}

@keyframes ringPulse {
    0% { width: 40px; height: 40px; opacity: 0.8; }
    100% { width: 200px; height: 200px; opacity: 0; }
}

/* --- Grid Specific Loader --- */
.grid-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: none; /* Controlled by JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-loader-overlay.active {
    display: flex;
    opacity: 1;
}

.medical-heartbeat-small {
    width: 60px;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.medical-heartbeat-small::before,
.medical-heartbeat-small::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #0EA5E9;
    border-radius: 50%;
    animation: medicalPulseSmall 1.5s ease-out infinite;
}

.medical-heartbeat-small::after {
    animation-delay: 0.5s;
}

@keyframes medicalPulseSmall {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}
.footer-link {
    display: block;
    color: #94A3B8;
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #0EA5E9 !important;
    transform: translateX(5px);
}

.footer-bottom a:hover i {
    color: #0EA5E9 !important;
    transition: color 0.3s ease;
}
