/**
 * Education V2 - Modern Design System
 * ====================================
 * A refreshed design language for the E3 Learning education pages.
 * 
 * HOW TO USE:
 * -----------
 * 1. Development/Testing: Add this CSS alongside existing education.css
 *    <link rel="stylesheet" href="css/education.css">
 *    <link rel="stylesheet" href="css/education-v2.css">
 * 
 * 2. The v2 classes use a "v2-" prefix to avoid conflicts with existing styles.
 *    Gradually migrate elements by adding v2 classes.
 * 
 * 3. When ready to go live, you can either:
 *    - Replace education.css with this file
 *    - Or keep both and remove the v2- prefixes
 * 
 * DESIGN TOKENS:
 * --------------
 * These CSS custom properties define the design system.
 * Override them in a parent element to theme sections differently.
 */

:root {
    /* ============================================
       COLOR PALETTE
       ============================================ */
    
    /* Background colors - dark mode first */
    --v2-bg-primary: #0f172a;       /* Deepest background */
    --v2-bg-secondary: #1e293b;     /* Cards, elevated surfaces */
    --v2-bg-tertiary: #1a2436;      /* Subtle variation */
    --v2-bg-hover: #263349;         /* Hover states */
    
    /* Border colors */
    --v2-border-subtle: #334155;
    --v2-border-hover: #60a5fa;
    --v2-border-focus: #3b82f6;
    
    /* Text colors */
    --v2-text-primary: #f1f5f9;     /* Headings, important text */
    --v2-text-secondary: #e2e8f0;   /* Body text */
    --v2-text-muted: #94a3b8;       /* Subtle text, descriptions */
    --v2-text-dimmed: #64748b;      /* Very subtle text */
    
    /* Accent colors */
    --v2-accent-blue: #3b82f6;
    --v2-accent-blue-light: #60a5fa;
    --v2-accent-blue-lighter: #93c5fd;
    --v2-accent-purple: #8b5cf6;
    --v2-accent-purple-light: #a78bfa;
    --v2-accent-green: #10b981;
    --v2-accent-green-light: #34d399;
    --v2-accent-amber: #f59e0b;
    --v2-accent-red: #ef4444;
    --v2-accent-cyan: #06b6d4;
    
    /* Gradients */
    --v2-gradient-hero: linear-gradient(-45deg, #1e3a8a, #0f172a, #1e293b, #3b82f6);
    --v2-gradient-card: linear-gradient(145deg, #1e293b, #1a2436);
    --v2-gradient-accent: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --v2-gradient-accent-hover: linear-gradient(135deg, #60a5fa, #a78bfa);
    --v2-gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --v2-gradient-warning: linear-gradient(135deg, #f59e0b, #ef4444);
    
    /* Shadows */
    --v2-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --v2-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --v2-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --v2-shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.5);
    --v2-shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.15);
    --v2-shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.15);
    
    /* ============================================
       TYPOGRAPHY
       ============================================ */
    --v2-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --v2-font-mono: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    
    --v2-font-size-xs: 0.75rem;     /* 12px */
    --v2-font-size-sm: 0.875rem;    /* 14px */
    --v2-font-size-base: 1rem;      /* 16px */
    --v2-font-size-lg: 1.125rem;    /* 18px */
    --v2-font-size-xl: 1.25rem;     /* 20px */
    --v2-font-size-2xl: 1.5rem;     /* 24px */
    --v2-font-size-3xl: 1.875rem;   /* 30px */
    --v2-font-size-4xl: 2.25rem;    /* 36px */
    --v2-font-size-5xl: 3rem;       /* 48px */
    
    --v2-line-height-tight: 1.25;
    --v2-line-height-normal: 1.5;
    --v2-line-height-relaxed: 1.75;
    
    /* ============================================
       SPACING
       ============================================ */
    --v2-space-1: 0.25rem;   /* 4px */
    --v2-space-2: 0.5rem;    /* 8px */
    --v2-space-3: 0.75rem;   /* 12px */
    --v2-space-4: 1rem;      /* 16px */
    --v2-space-5: 1.25rem;   /* 20px */
    --v2-space-6: 1.5rem;    /* 24px */
    --v2-space-8: 2rem;      /* 32px */
    --v2-space-10: 2.5rem;   /* 40px */
    --v2-space-12: 3rem;     /* 48px */
    --v2-space-16: 4rem;     /* 64px */
    --v2-space-20: 5rem;     /* 80px */
    
    /* ============================================
       BORDERS & RADIUS
       ============================================ */
    --v2-radius-sm: 4px;
    --v2-radius-md: 8px;
    --v2-radius-lg: 12px;
    --v2-radius-xl: 16px;
    --v2-radius-2xl: 24px;
    --v2-radius-full: 9999px;
    
    /* ============================================
       TRANSITIONS
       ============================================ */
    --v2-transition-fast: 0.15s ease;
    --v2-transition-normal: 0.3s ease;
    --v2-transition-slow: 0.5s ease;
    
    /* ============================================
       Z-INDEX SCALE
       ============================================ */
    --v2-z-dropdown: 100;
    --v2-z-sticky: 200;
    --v2-z-modal-backdrop: 300;
    --v2-z-modal: 400;
    --v2-z-tooltip: 500;
}


/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes v2-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes v2-fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes v2-fadeInDown {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes v2-slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(40px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes v2-slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-40px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes v2-scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes v2-gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes v2-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes v2-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes v2-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}


/* ============================================
   BASE STYLES
   ============================================ */

/* Prevent horizontal overflow on mobile */
html.v2-page,
body.v2-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.v2-page {
    background: var(--v2-bg-primary);
    color: var(--v2-text-secondary);
    font-family: var(--v2-font-family);
    line-height: var(--v2-line-height-normal);
    min-height: 100vh;
}

.v2-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--v2-space-4);
}

.v2-container--narrow {
    max-width: 900px;
}

.v2-container--wide {
    max-width: 1440px;
}


/* ============================================
   HERO SECTIONS
   ============================================ */

.v2-hero {
    background: var(--v2-gradient-hero);
    background-size: 400% 400%;
    animation: v2-gradientShift 15s ease infinite;
    padding: var(--v2-space-16) var(--v2-space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.v2-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233b82f6' fill-opacity='0.07'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.v2-hero__content {
    position: relative;
    z-index: 1;
}

.v2-hero__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: var(--v2-radius-xl);
    margin-bottom: var(--v2-space-6);
    color: var(--v2-accent-blue-light);
    animation: v2-float 3s ease-in-out infinite;
}

.v2-hero__title {
    font-size: var(--v2-font-size-4xl);
    font-weight: 800;
    color: var(--v2-text-primary);
    margin: 0 0 var(--v2-space-4);
    letter-spacing: -0.02em;
}

.v2-hero__subtitle {
    font-size: var(--v2-font-size-xl);
    color: var(--v2-text-muted);
    margin: 0;
    max-width: 600px;
    margin-inline: auto;
}

/* Floating orbs for hero backgrounds */
.v2-hero__orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.v2-hero__orb--1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: v2-pulse 4s ease-in-out infinite;
}

.v2-hero__orb--2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    bottom: -50px;
    left: 10%;
    animation: v2-pulse 5s ease-in-out infinite 1s;
}

.v2-hero__orb--3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    top: 20%;
    left: -50px;
    animation: v2-pulse 6s ease-in-out infinite 0.5s;
}

/* Compact hero for inner pages */
.v2-hero--compact {
    padding: var(--v2-space-10) var(--v2-space-6);
}

.v2-hero--compact .v2-hero__title {
    font-size: var(--v2-font-size-3xl);
}


/* ============================================
   SECTION LAYOUT
   ============================================ */

.v2-section {
    padding: var(--v2-space-12) 0;
}

.v2-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--v2-space-6);
    flex-wrap: wrap;
    gap: var(--v2-space-4);
}

.v2-section__title {
    font-size: var(--v2-font-size-2xl);
    font-weight: 700;
    color: var(--v2-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--v2-space-3);
}

.v2-section__title-icon {
    width: 28px;
    height: 28px;
    color: var(--v2-accent-blue);
}

.v2-section__link {
    color: var(--v2-accent-blue-light);
    text-decoration: none;
    font-size: var(--v2-font-size-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--v2-space-2);
    transition: color var(--v2-transition-fast);
}

.v2-section__link:hover {
    color: var(--v2-accent-blue-lighter);
}


/* ============================================
   CARDS - STANDARD
   ============================================ */

.v2-card {
    background: var(--v2-gradient-card);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-xl);
    padding: var(--v2-space-6);
    transition: all var(--v2-transition-normal);
    position: relative;
    overflow: hidden;
}

.v2-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--v2-gradient-accent);
    opacity: 0;
    transition: opacity var(--v2-transition-normal);
}

.v2-card:hover {
    border-color: var(--v2-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--v2-shadow-lg), var(--v2-shadow-glow-blue);
}

.v2-card:hover::before {
    opacity: 1;
}

.v2-card--clickable {
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.v2-card--animated {
    opacity: 0;
    animation: v2-slideInRight 0.5s ease forwards;
}

.v2-card__icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--v2-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-accent-blue-light);
    margin-bottom: var(--v2-space-4);
    transition: transform var(--v2-transition-normal);
}

.v2-card:hover .v2-card__icon {
    transform: scale(1.1) rotate(5deg);
}

.v2-card__title {
    font-size: var(--v2-font-size-lg);
    font-weight: 600;
    color: var(--v2-text-primary);
    margin: 0 0 var(--v2-space-2);
}

.v2-card__description {
    font-size: var(--v2-font-size-sm);
    color: var(--v2-text-muted);
    margin: 0;
    line-height: var(--v2-line-height-relaxed);
}

.v2-card__tag {
    display: inline-block;
    font-size: var(--v2-font-size-xs);
    color: var(--v2-accent-purple-light);
    background: rgba(139, 92, 246, 0.15);
    padding: var(--v2-space-1) var(--v2-space-3);
    border-radius: var(--v2-radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--v2-space-4);
}


/* ============================================
   CARDS - PREVIEW (Horizontal scroll)
   ============================================ */

.v2-preview-card {
    flex: 0 0 290px;
    background: var(--v2-gradient-card);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-xl);
    padding: var(--v2-space-6);
    text-decoration: none;
    transition: all var(--v2-transition-normal);
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-3);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: v2-slideInRight 0.5s ease forwards;
}

.v2-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--v2-gradient-accent);
    opacity: 0;
    transition: opacity var(--v2-transition-normal);
}

.v2-preview-card:hover {
    border-color: var(--v2-border-hover);
    transform: translateY(-6px);
    box-shadow: var(--v2-shadow-lg), var(--v2-shadow-glow-blue);
}

.v2-preview-card:hover::before {
    opacity: 1;
}

.v2-preview-card__icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--v2-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-accent-blue-light);
    transition: transform var(--v2-transition-normal);
}

.v2-preview-card:hover .v2-preview-card__icon {
    transform: scale(1.1) rotate(5deg);
}

.v2-preview-card__title {
    font-size: var(--v2-font-size-base);
    font-weight: 600;
    color: var(--v2-text-primary);
    margin: 0;
    line-height: var(--v2-line-height-tight);
}

.v2-preview-card__description {
    font-size: var(--v2-font-size-sm);
    color: var(--v2-text-muted);
    margin: 0;
    line-height: var(--v2-line-height-relaxed);
    flex-grow: 1;
}

.v2-preview-card__tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    color: var(--v2-accent-purple-light);
    background: rgba(139, 92, 246, 0.15);
    padding: var(--v2-space-1) var(--v2-space-3);
    border-radius: var(--v2-radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* View All card variant */
.v2-preview-card--cta {
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
    border-color: #7c3aed;
}

.v2-preview-card--cta:hover {
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.3);
}

.v2-preview-card--cta .v2-preview-card__icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.v2-preview-card--cta .v2-preview-card__title,
.v2-preview-card--cta .v2-preview-card__description {
    color: #fff;
}


/* ============================================
   CARDS - INFO (For content sections)
   ============================================ */

.v2-info-card {
    background: var(--v2-bg-secondary);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-6);
    margin-bottom: var(--v2-space-6);
}

.v2-info-card__header {
    display: flex;
    align-items: center;
    gap: var(--v2-space-3);
    margin-bottom: var(--v2-space-4);
    padding-bottom: var(--v2-space-4);
    border-bottom: 1px solid var(--v2-border-subtle);
}

.v2-info-card__icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: var(--v2-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-accent-blue);
}

.v2-info-card__title {
    font-size: var(--v2-font-size-lg);
    font-weight: 600;
    color: var(--v2-accent-blue-light);
    margin: 0;
}

.v2-info-card__content {
    color: var(--v2-text-muted);
    line-height: var(--v2-line-height-relaxed);
}

.v2-info-card__content p {
    margin: 0 0 var(--v2-space-4);
}

.v2-info-card__content p:last-child {
    margin-bottom: 0;
}

.v2-info-card__content ul,
.v2-info-card__content ol {
    margin: var(--v2-space-2) 0 var(--v2-space-4) var(--v2-space-6);
    padding: 0;
}

.v2-info-card__content li {
    margin-bottom: var(--v2-space-2);
}

/* Info card color variants */
.v2-info-card--warning {
    border-left: 4px solid var(--v2-accent-amber);
}

.v2-info-card--warning .v2-info-card__icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--v2-accent-amber);
}

.v2-info-card--warning .v2-info-card__title {
    color: var(--v2-accent-amber);
}

.v2-info-card--danger {
    border-left: 4px solid var(--v2-accent-red);
}

.v2-info-card--danger .v2-info-card__icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--v2-accent-red);
}

.v2-info-card--danger .v2-info-card__title {
    color: var(--v2-accent-red);
}

.v2-info-card--success {
    border-left: 4px solid var(--v2-accent-green);
}

.v2-info-card--success .v2-info-card__icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--v2-accent-green);
}

.v2-info-card--success .v2-info-card__title {
    color: var(--v2-accent-green);
}


/* ============================================
   HORIZONTAL SCROLL CONTAINER
   ============================================ */

.v2-scroll-container {
    position: relative;
}

.v2-scroll-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--v2-space-2) 0;
}

.v2-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.v2-scroll-track {
    display: flex;
    gap: var(--v2-space-5);
    padding: var(--v2-space-2) 0;
}

.v2-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 1px solid var(--v2-border-subtle);
    border-radius: 50%;
    background: var(--v2-bg-secondary);
    color: var(--v2-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--v2-transition-fast);
    z-index: 10;
}

.v2-scroll-btn:hover {
    background: var(--v2-bg-hover);
    border-color: var(--v2-accent-blue);
    color: var(--v2-accent-blue-light);
}

.v2-scroll-btn--prev {
    left: -22px;
}

.v2-scroll-btn--next {
    right: -22px;
}

@media (max-width: 768px) {
    .v2-scroll-btn {
        display: none;
    }
}


/* ============================================
   BUTTONS
   ============================================ */

.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--v2-space-2);
    padding: var(--v2-space-3) var(--v2-space-6);
    border-radius: var(--v2-radius-lg);
    font-size: var(--v2-font-size-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--v2-transition-fast);
    border: none;
    outline: none;
}

.v2-btn--primary {
    background: var(--v2-gradient-accent);
    color: #fff;
    box-shadow: var(--v2-shadow-sm);
}

.v2-btn--primary:hover {
    background: var(--v2-gradient-accent-hover);
    box-shadow: var(--v2-shadow-md), var(--v2-shadow-glow-blue);
    transform: translateY(-2px);
}

.v2-btn--secondary {
    background: transparent;
    border: 1px solid var(--v2-border-subtle);
    color: var(--v2-text-secondary);
}

.v2-btn--secondary:hover {
    border-color: var(--v2-accent-blue);
    color: var(--v2-accent-blue-light);
    background: rgba(59, 130, 246, 0.1);
}

.v2-btn--ghost {
    background: transparent;
    color: var(--v2-text-muted);
    padding: var(--v2-space-2) var(--v2-space-4);
}

.v2-btn--ghost:hover {
    color: var(--v2-accent-blue-light);
    background: rgba(59, 130, 246, 0.1);
}

.v2-btn--lg {
    padding: var(--v2-space-4) var(--v2-space-8);
    font-size: var(--v2-font-size-base);
}

.v2-btn--sm {
    padding: var(--v2-space-2) var(--v2-space-4);
    font-size: var(--v2-font-size-xs);
}


/* ============================================
   BADGES & TAGS
   ============================================ */

.v2-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--v2-space-1);
    padding: var(--v2-space-1) var(--v2-space-3);
    border-radius: var(--v2-radius-md);
    font-size: var(--v2-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v2-badge--blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--v2-accent-blue-light);
}

.v2-badge--purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--v2-accent-purple-light);
}

.v2-badge--green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--v2-accent-green-light);
}

.v2-badge--amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--v2-accent-amber);
}

.v2-badge--red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--v2-accent-red);
}


/* ============================================
   NAVIGATION - MODERN HEADER
   ============================================ */

.v2-header {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(15, 23, 42, 0.98) 50%, rgba(88, 28, 135, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: var(--v2-z-sticky);
    transition: all var(--v2-transition-normal);
    overflow: visible;
}

/* Animated gradient glow on header */
.v2-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--v2-accent-blue) 0%, 
        var(--v2-accent-purple) 25%, 
        var(--v2-accent-blue-light) 50%, 
        var(--v2-accent-purple) 75%, 
        var(--v2-accent-blue) 100%);
    background-size: 200% 100%;
    animation: v2-gradientShift 8s linear infinite;
}

/* Floating orb effects in header */
.v2-header::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -100px;
    right: 5%;
    pointer-events: none;
    animation: v2-pulse 6s ease-in-out infinite;
}

.v2-header--scrolled {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
    box-shadow: 0 4px 30px rgba(59, 130, 246, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.v2-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--v2-space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
    position: relative;
    z-index: 1;
    gap: var(--v2-space-4);
}

/* Logo / Brand */
.v2-header__brand {
    display: flex;
    align-items: center;
    gap: var(--v2-space-3);
    text-decoration: none;
    color: var(--v2-text-primary);
    font-weight: 700;
    font-size: var(--v2-font-size-lg);
    transition: all var(--v2-transition-fast);
    flex-shrink: 0;
}

.v2-header__brand:hover {
    transform: translateX(2px);
}

.v2-header__logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--v2-accent-blue) 0%, var(--v2-accent-purple) 100%);
    border-radius: var(--v2-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: var(--v2-font-size-xl);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4), 0 0 20px rgba(139, 92, 246, 0.2);
    transition: all var(--v2-transition-fast);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on logo */
.v2-header__logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.v2-header__brand:hover .v2-header__logo::before {
    transform: translateX(100%);
}

.v2-header__brand:hover .v2-header__logo {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 0 30px rgba(139, 92, 246, 0.3);
}

/* Custom logo image - full horizontal logo with hover swap */
.v2-header__brand {
    position: relative;
}

.v2-header__logo-img {
    height: 56px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.v2-header__logo-img.logo-hover {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
}

.v2-header__brand:hover .v2-header__logo-img.logo-default {
    opacity: 0;
}

.v2-header__brand:hover .v2-header__logo-img.logo-hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.03);
}

@media (max-width: 768px) {
    .v2-header__logo-img {
        height: 42px;
        max-width: 200px;
    }
}

/* Fallback for pages without hover logo */
.v2-header__brand:hover .v2-header__logo-img:only-child {
    opacity: 1;
    transform: scale(1.05);
}

/* Legacy star icon support */
.v2-header__logo-icon {
    width: 46px;
    height: 46px;
    display: block;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    mask: url("../images/Star.png") center/contain no-repeat;
    -webkit-mask: url("../images/Star.png") center/contain no-repeat;
    transition: transform var(--v2-transition-fast);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.v2-header__brand:hover .v2-header__logo-icon {
    transform: scale(1.1) rotate(15deg);
}

.v2-header__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.v2-header__brand-name {
    font-weight: 700;
    font-size: var(--v2-font-size-lg);
    background: linear-gradient(135deg, #fff 0%, var(--v2-accent-blue-lighter) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.v2-header__brand-tagline {
    font-size: var(--v2-font-size-xs);
    color: var(--v2-accent-purple-light);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Navigation Links */
.v2-header__nav {
    display: flex;
    align-items: center;
    gap: var(--v2-space-2);
    flex-shrink: 0;
}

.v2-header__nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-header__nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--v2-radius-lg);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--v2-transition-fast);
    position: relative;
    border: 1px solid transparent;
    white-space: nowrap;
}

.v2-header__nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

.v2-header__nav-link--active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
}

.v2-header__nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, var(--v2-accent-blue), var(--v2-accent-purple));
    border-radius: 1px;
    box-shadow: 0 0 8px var(--v2-accent-purple);
}

/* Nav link with icon */
.v2-header__nav-link i {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    transition: all var(--v2-transition-fast);
}

.v2-header__nav-link:hover i,
.v2-header__nav-link--active i {
    opacity: 1;
    color: var(--v2-accent-blue-light);
}

/* CTA Button in Nav */
.v2-header__cta {
    margin-left: var(--v2-space-2);
    flex-shrink: 0;
}

.v2-header__cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--v2-accent-blue) 0%, var(--v2-accent-purple) 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--v2-radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--v2-transition-fast);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4), 0 0 20px rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.v2-header__cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.v2-header__cta-btn:hover::before {
    left: 100%;
}

.v2-header__cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 0 30px rgba(139, 92, 246, 0.3);
}

/* Stacked CTA button with subtitle */
.v2-header__cta-btn--stacked {
    padding: var(--v2-space-2) var(--v2-space-5);
    border-radius: var(--v2-radius-xl);
    cursor: pointer;
    background: linear-gradient(135deg, 
        var(--v2-accent-blue) 0%, 
        var(--v2-accent-purple) 25%,
        #ec4899 50%,
        var(--v2-accent-purple) 75%,
        var(--v2-accent-blue) 100%);
    background-size: 300% 300%;
    animation: rouletteGlow 6s ease infinite;
}

@keyframes rouletteGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.v2-header__cta-btn--stacked:hover {
    animation-duration: 1.5s;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5), 
                0 0 40px rgba(236, 72, 153, 0.3),
                0 0 60px rgba(59, 130, 246, 0.2);
}

.v2-header__cta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.v2-header__cta-title {
    font-weight: 600;
    font-size: var(--v2-font-size-sm);
}

.v2-header__cta-subtitle {
    font-size: 0.65rem;
    opacity: 0.75;
    font-weight: 400;
}

/* Mobile Menu Toggle */
.v2-header__toggle {
    display: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #fff;
    padding: var(--v2-space-3);
    border-radius: var(--v2-radius-lg);
    cursor: pointer;
    transition: all var(--v2-transition-fast);
    position: relative;
    z-index: 100;
}

.v2-header__toggle:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.v2-header__hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.v2-header__hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all var(--v2-transition-fast);
    box-shadow: 0 0 4px rgba(139, 92, 246, 0.5);
}

.v2-header__hamburger span:nth-child(2) {
    width: 70%;
}

/* Hamburger animation when open */
.v2-header__toggle[aria-expanded="true"] .v2-header__hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.v2-header__toggle[aria-expanded="true"] .v2-header__hamburger span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.v2-header__toggle[aria-expanded="true"] .v2-header__hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hide tap-to-dismiss on desktop */
.v2-header__nav-dismiss {
    display: none;
}

/* Mobile Styles */
@media (max-width: 900px) {
    .v2-header__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .v2-header__nav {
        display: flex !important;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100vw;
        height: calc(100vh - 72px);
        height: calc(100dvh - 72px); /* Dynamic viewport height for mobile browsers */
        /* Enhanced glassmorphism background */
        background: linear-gradient(180deg, 
            rgba(15, 23, 42, 0.85) 0%, 
            rgba(30, 27, 75, 0.80) 50%, 
            rgba(15, 23, 42, 0.85) 100%);
        backdrop-filter: blur(30px) saturate(150%);
        -webkit-backdrop-filter: blur(30px) saturate(150%);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: var(--v2-space-6);
        gap: var(--v2-space-3);
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-left: 1px solid rgba(139, 92, 246, 0.3);
        z-index: 9999;
    }
    
    /* Tap to dismiss zone */
    .v2-header__nav-dismiss {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: var(--v2-space-6);
        cursor: pointer;
        border: 2px dashed rgba(139, 92, 246, 0.3);
        border-radius: var(--v2-radius-xl);
        min-height: 80px;
        transition: all 0.2s ease;
    }
    
    .v2-header__nav-dismiss span {
        color: var(--v2-text-dimmed);
        font-size: var(--v2-font-size-sm);
        opacity: 0.6;
    }
    
    .v2-header__nav-dismiss:hover,
    .v2-header__nav-dismiss:active {
        border-color: rgba(139, 92, 246, 0.5);
        background: rgba(139, 92, 246, 0.1);
    }
    
    .v2-header__nav-dismiss:active span {
        opacity: 1;
    }
    
    /* Decorative orb in mobile menu */
    .v2-header__nav::before {
        content: '';
        position: fixed;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
        border-radius: 50%;
        top: 20%;
        right: -100px;
        pointer-events: none;
        animation: v2-pulse 5s ease-in-out infinite;
    }
    
    .v2-header__nav::after {
        content: '';
        position: fixed;
        width: 200px;
        height: 200px;
        background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
        border-radius: 50%;
        bottom: 20%;
        left: -50px;
        pointer-events: none;
        animation: v2-pulse 6s ease-in-out infinite 1s;
    }
    
    .v2-header__nav--open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .v2-header__nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: var(--v2-space-2);
        position: relative;
        z-index: 1;
    }
    
    .v2-header__nav-link {
        padding: var(--v2-space-4) var(--v2-space-5);
        font-size: var(--v2-font-size-lg);
        border-radius: var(--v2-radius-xl);
        background: rgba(30, 41, 59, 0.5);
        border: 1px solid rgba(51, 65, 85, 0.5);
    }
    
    .v2-header__nav-link:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
        border-color: rgba(139, 92, 246, 0.5);
        transform: translateX(8px);
    }
    
    .v2-header__nav-link--active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
        border-color: rgba(139, 92, 246, 0.6);
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    }
    
    .v2-header__nav-link--active::after {
        display: none;
    }
    
    .v2-header__nav-link i {
        width: 20px;
        height: 20px;
    }
    
    .v2-header__cta {
        margin-left: 0;
        margin-top: var(--v2-space-6);
        position: relative;
        z-index: 1;
    }
    
    .v2-header__cta-btn {
        width: 100%;
        justify-content: center;
        padding: var(--v2-space-5);
        font-size: var(--v2-font-size-base);
    }
}

/* Dropdown support (for future use) */
.v2-header__dropdown {
    position: relative;
}

.v2-header__dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--v2-space-2);
}

.v2-header__dropdown-trigger::after {
    content: '';
    border: 4px solid transparent;
    border-top-color: currentColor;
    margin-top: 2px;
    transition: transform var(--v2-transition-fast);
}

.v2-header__dropdown:hover .v2-header__dropdown-trigger::after {
    transform: rotate(180deg);
}

.v2-header__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 200px;
    background: var(--v2-bg-secondary);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-2);
    box-shadow: var(--v2-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--v2-transition-fast);
}

.v2-header__dropdown:hover .v2-header__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.v2-header__dropdown-item {
    display: block;
    padding: var(--v2-space-3) var(--v2-space-4);
    color: var(--v2-text-muted);
    text-decoration: none;
    font-size: var(--v2-font-size-sm);
    border-radius: var(--v2-radius-md);
    transition: all var(--v2-transition-fast);
}

.v2-header__dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--v2-accent-blue-light);
}


/* ============================================
   GLOBAL SEARCH
   ============================================ */

.v2-header__search {
    position: relative;
    flex-shrink: 0;
    margin-left: var(--v2-space-3);
}

.v2-header__search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.v2-header__search-icon {
    position: absolute;
    left: 10px;
    color: var(--v2-text-muted);
    pointer-events: none;
    z-index: 1;
}

.v2-header__search-icon i,
.v2-header__search-icon svg {
    width: 14px;
    height: 14px;
}

.v2-header__search-input {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-full);
    padding: 6px 12px;
    padding-left: 32px;
    color: var(--v2-text-primary);
    font-size: 0.8rem;
    width: 140px;
    transition: all var(--v2-transition-fast);
}

.v2-header__search-input::placeholder {
    color: var(--v2-text-muted);
}

.v2-header__search-input:focus {
    outline: none;
    border-color: var(--v2-accent-blue);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    width: 240px;
}

.v2-header__search-kbd {
    position: absolute;
    right: var(--v2-space-3);
    background: rgba(51, 65, 85, 0.6);
    color: var(--v2-text-muted);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    pointer-events: none;
    opacity: 0.7;
}

.v2-header__search-input:focus ~ .v2-header__search-kbd {
    opacity: 0;
}

/* Search Results Dropdown */
.v2-header__search-results {
    position: absolute;
    top: calc(100% + var(--v2-space-2));
    left: 0;
    right: 0;
    min-width: 320px;
    max-width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--v2-bg-secondary);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow-lg), 0 0 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

.v2-header__search-results--open {
    display: block;
    animation: searchDropdownIn 0.2s ease-out;
}

@keyframes searchDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category headers in search results */
.v2-search-category {
    padding: var(--v2-space-2) var(--v2-space-4);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--v2-text-muted);
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--v2-border-subtle);
    display: flex;
    align-items: center;
    gap: var(--v2-space-2);
    position: sticky;
    top: 0;
    z-index: 1;
}

.v2-search-category i,
.v2-search-category svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

/* Individual search result items */
.v2-search-result {
    display: flex;
    align-items: center;
    gap: var(--v2-space-3);
    padding: var(--v2-space-3) var(--v2-space-4);
    color: var(--v2-text-secondary);
    text-decoration: none;
    transition: all var(--v2-transition-fast);
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

.v2-search-result:last-child {
    border-bottom: none;
}

.v2-search-result:hover,
.v2-search-result--active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--v2-text-primary);
}

.v2-search-result--active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
}

.v2-search-result__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--v2-radius-md);
    background: rgba(59, 130, 246, 0.1);
}

.v2-search-result__icon i,
.v2-search-result__icon svg {
    width: 16px;
    height: 16px;
    color: var(--v2-accent-blue-light);
}

/* Category-specific icon colors */
.v2-search-result[data-category="medications"] .v2-search-result__icon {
    background: rgba(16, 185, 129, 0.15);
}
.v2-search-result[data-category="medications"] .v2-search-result__icon i,
.v2-search-result[data-category="medications"] .v2-search-result__icon svg {
    color: var(--v2-accent-green);
}

.v2-search-result[data-category="procedures"] .v2-search-result__icon {
    background: rgba(6, 182, 212, 0.15);
}
.v2-search-result[data-category="procedures"] .v2-search-result__icon i,
.v2-search-result[data-category="procedures"] .v2-search-result__icon svg {
    color: var(--v2-accent-cyan);
}

.v2-search-result[data-category="labValues"] .v2-search-result__icon,
.v2-search-result[data-category="labPanels"] .v2-search-result__icon {
    background: rgba(139, 92, 246, 0.15);
}
.v2-search-result[data-category="labValues"] .v2-search-result__icon i,
.v2-search-result[data-category="labValues"] .v2-search-result__icon svg,
.v2-search-result[data-category="labPanels"] .v2-search-result__icon i,
.v2-search-result[data-category="labPanels"] .v2-search-result__icon svg {
    color: var(--v2-accent-purple);
}

.v2-search-result[data-category="criticalCare"] .v2-search-result__icon {
    background: rgba(239, 68, 68, 0.15);
}
.v2-search-result[data-category="criticalCare"] .v2-search-result__icon i,
.v2-search-result[data-category="criticalCare"] .v2-search-result__icon svg {
    color: #ef4444;
}

.v2-search-result[data-category="ecgAnatomy"] .v2-search-result__icon {
    background: rgba(245, 158, 11, 0.15);
}
.v2-search-result[data-category="ecgAnatomy"] .v2-search-result__icon i,
.v2-search-result[data-category="ecgAnatomy"] .v2-search-result__icon svg {
    color: #f59e0b;
}

.v2-search-result__content {
    flex: 1;
    min-width: 0;
}

.v2-search-result__title {
    font-size: var(--v2-font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-search-result__title mark {
    background: rgba(59, 130, 246, 0.3);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.v2-search-result__subtitle {
    font-size: 0.7rem;
    color: var(--v2-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No results state */
.v2-search-no-results {
    padding: var(--v2-space-6) var(--v2-space-4);
    text-align: center;
    color: var(--v2-text-muted);
}

.v2-search-no-results i,
.v2-search-no-results svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
    margin-bottom: var(--v2-space-2);
}

.v2-search-no-results p {
    font-size: var(--v2-font-size-sm);
    margin: 0;
}

/* Loading state */
.v2-search-loading {
    padding: var(--v2-space-4);
    text-align: center;
    color: var(--v2-text-muted);
}

.v2-search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--v2-border-subtle);
    border-top-color: var(--v2-accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: var(--v2-space-2);
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile search styles */
@media (max-width: 900px) {
    .v2-header__search {
        display: none;
    }
    
    /* Mobile search shown in nav menu */
    .v2-header__nav .v2-header__search {
        display: block;
        margin: 0 0 var(--v2-space-4) 0;
        order: -1;
        width: 100%;
        position: relative;
    }
    
    .v2-header__nav .v2-header__search-input-wrapper {
        width: 100%;
    }
    
    .v2-header__nav .v2-header__search-input {
        width: 100%;
        padding: 12px 16px;
        padding-left: 40px;
        font-size: 1rem;
        border-radius: var(--v2-radius-xl);
        background: rgba(30, 41, 59, 0.8);
    }
    
    .v2-header__nav .v2-header__search-icon {
        left: 14px;
    }
    
    .v2-header__nav .v2-header__search-icon i,
    .v2-header__nav .v2-header__search-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .v2-header__nav .v2-header__search-input:focus {
        width: 100%;
    }
    
    .v2-header__nav .v2-header__search-results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: var(--v2-space-2);
        max-width: none;
        max-height: 45vh;
        z-index: 1001;
    }
    
    .v2-header__search-kbd {
        display: none;
    }
}


/* ============================================
   NAVIGATION
   ============================================ */
.v2-nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--v2-border-subtle);
    padding: var(--v2-space-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--v2-z-sticky);
}

.v2-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--v2-space-6);
}

.v2-nav__brand {
    font-size: var(--v2-font-size-xl);
    font-weight: 700;
    color: var(--v2-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--v2-space-2);
}

.v2-nav__links {
    display: flex;
    align-items: center;
    gap: var(--v2-space-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-nav__link {
    color: var(--v2-text-muted);
    text-decoration: none;
    padding: var(--v2-space-2) var(--v2-space-4);
    border-radius: var(--v2-radius-md);
    font-size: var(--v2-font-size-sm);
    font-weight: 500;
    transition: all var(--v2-transition-fast);
}

.v2-nav__link:hover {
    color: var(--v2-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.v2-nav__link--active {
    color: var(--v2-accent-blue-light);
    background: rgba(59, 130, 246, 0.1);
}


/* ============================================
   GRID LAYOUTS
   ============================================ */

.v2-grid {
    display: grid;
    gap: var(--v2-space-6);
}

.v2-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.v2-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.v2-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.v2-grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 1024px) {
    .v2-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .v2-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .v2-grid--4,
    .v2-grid--3,
    .v2-grid--2 {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   TABLES (for lab values, dosing, etc.)
   ============================================ */

.v2-table-wrapper {
    overflow-x: auto;
    border-radius: var(--v2-radius-lg);
    border: 1px solid var(--v2-border-subtle);
}

.v2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--v2-font-size-sm);
}

.v2-table th,
.v2-table td {
    padding: var(--v2-space-4);
    text-align: left;
    border-bottom: 1px solid var(--v2-border-subtle);
}

.v2-table th {
    background: var(--v2-bg-secondary);
    color: var(--v2-text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.v2-table td {
    color: var(--v2-text-muted);
}

.v2-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.v2-table tbody tr:last-child td {
    border-bottom: none;
}


/* ============================================
   MEDICATION DETAIL STYLES
   ============================================ */

.v2-med-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-xl);
    padding: var(--v2-space-8);
    margin-bottom: var(--v2-space-6);
}

.v2-med-title {
    font-size: var(--v2-font-size-3xl);
    color: var(--v2-accent-blue-lighter);
    margin: 0 0 var(--v2-space-2);
    font-weight: 700;
}

.v2-med-pronunciation {
    font-size: var(--v2-font-size-base);
    color: var(--v2-text-muted);
    font-style: italic;
    margin-bottom: var(--v2-space-4);
}

.v2-med-class-badge {
    display: inline-block;
    background: var(--v2-accent-blue);
    color: #fff;
    padding: var(--v2-space-2) var(--v2-space-4);
    border-radius: var(--v2-radius-md);
    font-size: var(--v2-font-size-sm);
    font-weight: 600;
}

.v2-med-section {
    background: var(--v2-bg-secondary);
    border: 1px solid var(--v2-border-subtle);
    border-radius: var(--v2-radius-lg);
    padding: var(--v2-space-6);
    margin-bottom: var(--v2-space-6);
}

.v2-med-section__title {
    font-size: var(--v2-font-size-xl);
    color: var(--v2-accent-blue-light);
    margin: 0 0 var(--v2-space-4);
    font-weight: 600;
    border-bottom: 2px solid var(--v2-border-subtle);
    padding-bottom: var(--v2-space-3);
}

.v2-med-section__content {
    color: var(--v2-text-muted);
    line-height: var(--v2-line-height-relaxed);
}


/* ============================================
   FOOTER
   ============================================ */

.v2-footer {
    background: var(--v2-bg-secondary);
    border-top: 1px solid var(--v2-border-subtle);
    padding: var(--v2-space-12) 0 var(--v2-space-8);
    margin-top: var(--v2-space-16);
}

.v2-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--v2-space-8);
    margin-bottom: var(--v2-space-8);
}

.v2-footer__heading {
    font-size: var(--v2-font-size-sm);
    font-weight: 600;
    color: var(--v2-text-primary);
    margin: 0 0 var(--v2-space-4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v2-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-footer__links li {
    margin-bottom: var(--v2-space-2);
}

.v2-footer__links a {
    color: var(--v2-text-muted);
    text-decoration: none;
    font-size: var(--v2-font-size-sm);
    transition: color var(--v2-transition-fast);
}

.v2-footer__links a:hover {
    color: var(--v2-accent-blue-light);
}

.v2-footer__bottom {
    padding-top: var(--v2-space-6);
    border-top: 1px solid var(--v2-border-subtle);
    text-align: center;
}

.v2-footer__copyright {
    font-size: var(--v2-font-size-sm);
    color: var(--v2-text-dimmed);
    margin: 0;
}


/* ============================================
   UTILITIES
   ============================================ */

/* Text utilities */
.v2-text-primary { color: var(--v2-text-primary); }
.v2-text-secondary { color: var(--v2-text-secondary); }
.v2-text-muted { color: var(--v2-text-muted); }
.v2-text-blue { color: var(--v2-accent-blue-light); }
.v2-text-purple { color: var(--v2-accent-purple-light); }
.v2-text-green { color: var(--v2-accent-green); }
.v2-text-amber { color: var(--v2-accent-amber); }
.v2-text-red { color: var(--v2-accent-red); }

.v2-text-center { text-align: center; }
.v2-text-left { text-align: left; }
.v2-text-right { text-align: right; }

/* Spacing utilities */
.v2-mt-4 { margin-top: var(--v2-space-4); }
.v2-mt-6 { margin-top: var(--v2-space-6); }
.v2-mt-8 { margin-top: var(--v2-space-8); }
.v2-mb-4 { margin-bottom: var(--v2-space-4); }
.v2-mb-6 { margin-bottom: var(--v2-space-6); }
.v2-mb-8 { margin-bottom: var(--v2-space-8); }
.v2-py-4 { padding-top: var(--v2-space-4); padding-bottom: var(--v2-space-4); }
.v2-py-8 { padding-top: var(--v2-space-8); padding-bottom: var(--v2-space-8); }

/* Display utilities */
.v2-hidden { display: none; }
.v2-flex { display: flex; }
.v2-flex-center { display: flex; align-items: center; justify-content: center; }
.v2-flex-between { display: flex; align-items: center; justify-content: space-between; }

/* Animation utilities */
.v2-animate-fadeIn { animation: v2-fadeIn 0.5s ease forwards; }
.v2-animate-fadeInUp { animation: v2-fadeInUp 0.5s ease forwards; }
.v2-animate-slideInRight { animation: v2-slideInRight 0.5s ease forwards; }

/* Skeleton loading */
.v2-skeleton {
    background: linear-gradient(90deg, 
        var(--v2-bg-secondary) 25%, 
        var(--v2-bg-hover) 50%, 
        var(--v2-bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: v2-shimmer 1.5s infinite;
    border-radius: var(--v2-radius-md);
}

.v2-skeleton--text {
    height: 1em;
    width: 100%;
}

.v2-skeleton--title {
    height: 1.5em;
    width: 60%;
}

.v2-skeleton--card {
    height: 200px;
    width: 100%;
}


/* ============================================
   RESPONSIVE HELPERS
   ============================================ */

@media (max-width: 768px) {
    .v2-hero {
        padding: var(--v2-space-10) var(--v2-space-4);
    }
    
    .v2-hero__title {
        font-size: var(--v2-font-size-2xl);
    }
    
    .v2-hero__subtitle {
        font-size: var(--v2-font-size-base);
    }
    
    .v2-section {
        padding: var(--v2-space-8) 0;
    }
    
    .v2-section__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .v2-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .v2-hide-desktop {
        display: none !important;
    }
}


/* ============================================
   SCROLLABLE CONTENT INDICATORS
   ============================================
   Use these classes to indicate horizontally scrollable content.
   
   Usage:
   <div class="scroll-container">
       <div class="scroll-content">
           <!-- Your wide content here (tables, code blocks, etc.) -->
       </div>
   </div>
   
   Or for tables specifically:
   <div class="table-scroll-wrapper">
       <table class="reference-table">...</table>
   </div>
*/

/* Base scroll container with fade indicators */
.scroll-container,
.table-scroll-wrapper {
    position: relative;
    overflow: hidden;
}

.scroll-container::after,
.table-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--v2-bg-primary, #0f172a));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 2;
}

/* Hide fade when scrolled to end (requires JS) */
.scroll-container.scrolled-end::after,
.table-scroll-wrapper.scrolled-end::after {
    opacity: 0;
}

/* Left fade for when scrolled right */
.scroll-container::before,
.table-scroll-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, transparent, var(--v2-bg-primary, #0f172a));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.scroll-container.scrolled-start::before,
.table-scroll-wrapper.scrolled-start::before {
    opacity: 1;
}

/* Inner scrollable content */
.scroll-content,
.table-scroll-wrapper > table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--v2-border-subtle, #334155) transparent;
}

/* Styled scrollbar for webkit browsers */
.scroll-content::-webkit-scrollbar,
.table-scroll-wrapper > table::-webkit-scrollbar,
.table-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.scroll-content::-webkit-scrollbar-track,
.table-scroll-wrapper > table::-webkit-scrollbar-track,
.table-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 4px;
}

.scroll-content::-webkit-scrollbar-thumb,
.table-scroll-wrapper > table::-webkit-scrollbar-thumb,
.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--v2-border-subtle, #334155);
    border-radius: 4px;
}

.scroll-content::-webkit-scrollbar-thumb:hover,
.table-scroll-wrapper > table::-webkit-scrollbar-thumb:hover,
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--v2-text-muted, #94a3b8);
}

/* Swipe hint indicator (optional - add class 'with-swipe-hint') */
.scroll-container.with-swipe-hint::after,
.table-scroll-wrapper.with-swipe-hint::after {
    /* Animated gradient pulse */
    animation: scroll-hint-pulse 2s ease-in-out 0.5s 2;
}

@keyframes scroll-hint-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Mobile-specific: swipe icon indicator */
.scroll-hint-icon {
    display: none;
}

@media (max-width: 768px) {
    .scroll-hint-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        margin-bottom: 0.5rem;
        color: var(--v2-text-muted, #94a3b8);
        font-size: 0.8rem;
        animation: swipe-hint 1.5s ease-in-out 1s 2;
    }
    
    .scroll-hint-icon svg,
    .scroll-hint-icon i {
        width: 16px;
        height: 16px;
    }
    
    @keyframes swipe-hint {
        0%, 100% { transform: translateX(0); opacity: 0.7; }
        50% { transform: translateX(10px); opacity: 1; }
    }
    
    /* Ensure fade is visible on mobile */
    .scroll-container::after,
    .table-scroll-wrapper::after {
        width: 30px;
    }
}

