/* ========================================
   NAVIMED - PREMIUM HEADER STYLES
   Industry-Level UX/UI Design
   ======================================== */

/* CSS Variables - Premium Design System */
:root {
    /* Primary Brand Colors */
    /* Neutralize brand tones (remove purple/blue intensity) */
    --brand-primary: #4b5563; /* slate-600 */
    --brand-primary-light: #6b7280; /* slate-500 */
    --brand-primary-dark: #374151; /* slate-700 */
    --brand-secondary: #6b7280; /* slate-500 */
    --brand-accent: #9ca3af; /* slate-400 */
    
    /* Neutral Colors */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --header-height: 5rem;
    --container-max-width: 80rem;
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
}


/* ========================================
   MINIMAL + MODERN LOADING SCREEN
   ======================================== */


        /* Loader container */
        #loadingScreen {
            position: fixed;
            inset: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.5s ease;
        }

    /* Spinner removed */

        /* Brand text */
        .brand-text {
            margin-top: 1.2rem;
            font-size: 1.8rem;
            font-weight: 700;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--brand-accent);
            text-shadow: 0 0 10px var(--brand-accent);
            animation: fadeIn 1.2s ease-in-out infinite alternate;
        }

    @keyframes fadeIn { from { opacity: 0.5; } to { opacity: 1; } }

    /* Loading screen background (default + dark override) */
    #loadingScreen { background: #0f172a; }
    html.dark #loadingScreen { background: #0b1220; }

    /* Spinner styles removed */

        html.light .brand-text, html.dark .brand-text { color: var(--brand-accent); text-shadow: 0 0 10px var(--brand-accent); }

        /* Loader progress bar */
        .loader-bar {
            width: 220px;
            height: 6px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.12);
            margin-top: 12px;
            overflow: hidden;
        }
        .loader-progress {
            width: 0%;
            height: 100%;
            background: #e5e7eb; /* neutral */
            border-radius: inherit;
            transition: width 0.25s ease;
        }
   

/* ========================================
   PREMIUM NAVIGATION BAR
   ======================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    box-shadow: var(--shadow-lg);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

html.dark .navbar {
    background: rgba(15, 23, 42, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html.dark .navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.navbar-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* ========================================
   PREMIUM LOGO DESIGN
   ======================================== */

.logo {
    flex-shrink: 0;
    position: relative;
}

.logo-link {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-decoration: none;
    letter-spacing: -0.025em;
    transition: all var(--transition-normal);
    position: relative;
    display: inline-block;
}

.logo-link::before {
    content: '';
    position: absolute;
    inset: -0.5rem;
    background: rgba(0,0,0,0.06);
    border-radius: var(--border-radius);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.logo-link:hover {
    color: white;
    transform: translateY(-2px);
}

.logo-link:hover::before {
    opacity: 1;
}

html.dark .logo-link {
    color: var(--brand-primary-light);
}

/* ========================================
   DESKTOP NAVIGATION
   ======================================== */

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: block;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    position: relative;
    color: var(--neutral-700);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    letter-spacing: 0.025em;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--neutral-400);
    border-radius: 1px;
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

.nav-link:hover::before {
    width: 60%;
}

.nav-link.active {
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

.nav-link.active::before {
    width: 80%;
}

html.dark .nav-link {
    color: var(--neutral-300);
}

html.dark .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
}

html.dark .nav-link.active {
    background: rgba(59, 130, 246, 0.15);
}

/* ========================================
   PREMIUM DARK MODE TOGGLE
   ======================================== */

.dark-mode-toggle {
    position: relative;
    color: var(--neutral-600);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dark-mode-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.08);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.dark-mode-toggle:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dark-mode-toggle:hover::before {
    opacity: 1;
}

.dark-mode-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform var(--transition-bounce);
}

.dark-mode-toggle:hover .dark-mode-icon {
    transform: rotate(180deg);
}

html.dark .dark-mode-toggle {
    color: var(--neutral-300);
}

/* ========================================
   MOBILE MENU BUTTON
   ======================================== */

.mobile-menu-wrapper {
    display: block;
}

@media (min-width: 768px) {
    .mobile-menu-wrapper {
        display: none;
    }
}

.mobile-menu-button {
    position: relative;
    color: var(--neutral-600);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-button:hover {
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.05);
    transform: scale(1.05);
}

.mobile-menu-button svg {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform var(--transition-normal);
}

.mobile-menu-button.active svg {
    transform: rotate(90deg);
}

html.dark .mobile-menu-button {
    color: var(--neutral-300);
}

html.dark .mobile-menu-button:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

.mobile-nav {
    position: fixed;
    top: var(--header-height); /* start below the fixed navbar */
    bottom: 0;
    right: 0;
    width: min(90vw, 360px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-2xl);
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
    z-index: 1100;
    height: calc(100vh - var(--header-height)); /* fit viewport below navbar */
    overflow-y: auto; /* allow drawer to scroll independently */
}

.mobile-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

html.dark .mobile-nav {
    background: rgba(15, 23, 42, 0.98);
    border-left-color: rgba(255, 255, 255, 0.08);
}

.mobile-nav-content {
    padding: 1.25rem 1rem;
    height: 100%;
    overflow-y: auto;
    max-height: 100%; /* cap to the drawer height */
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    color: var(--neutral-700);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: block;
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: rgba(0,0,0,0.08);
    opacity: 0.1;
    transition: width var(--transition-normal);
    z-index: -1;
}

.mobile-nav-link:hover {
    color: var(--brand-primary);
    transform: translateX(0.5rem);
}

.mobile-nav-link:hover::before {
    width: 100%;
}

.mobile-nav-link.active {
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

html.dark .mobile-nav-link {
    color: var(--neutral-300);
}

html.dark .mobile-nav-link:hover::before {
    opacity: 0.15;
}

html.dark .mobile-nav-link.active {
    background: rgba(59, 130, 246, 0.15);
}

/* ========================================
   MOBILE DARK MODE TOGGLE
   ======================================== */

.mobile-dark-mode-toggle {
    width: 100%;
    text-align: left;
    color: var(--neutral-700);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-dark-mode-toggle:hover {
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(0.5rem);
}

.mobile-dark-mode-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform var(--transition-bounce);
}

.mobile-dark-mode-toggle:hover svg {
    transform: rotate(180deg);
}

html.dark .mobile-dark-mode-toggle {
    color: var(--neutral-300);
}

html.dark .mobile-dark-mode-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Mobile overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-height); /* keep navbar visible and clickable */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1095;
}

/* Prevent body scroll when drawer open */
.no-scroll {
    overflow: hidden;
    height: 100vh;
}



/* ========================================
   PREMIUM UTILITY CLASSES
   ======================================== */

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.gradient-bg { background: var(--neutral-100); }
.medical-gradient { background: var(--neutral-100); }

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hover-lift {
    transition: all var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ========================================
   ADVANCED INTERACTION EFFECTS
   ======================================== */

.magnetic-hover {
    transition: transform var(--transition-bounce);
}

.magnetic-hover:hover {
    transform: scale(1.05) rotate(2deg);
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform var(--transition-normal);
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(20px);
}

.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: rgba(255,255,255,0.08);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal);
    animation: none;
}

.glow-effect:hover::before {
    opacity: 1;
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-normal), height var(--transition-normal);
}

.ripple-effect:hover::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   PREMIUM SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-500);
    border-radius: 5px;
    border: 2px solid var(--neutral-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-600);
}

html.dark ::-webkit-scrollbar-track {
    background: var(--neutral-800);
}

html.dark ::-webkit-scrollbar-thumb {
    border-color: var(--neutral-800);
}

/* ========================================
   PREMIUM ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes glowShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 767px) {
    .navbar-container {
        padding: 0 1rem;
    }
    
    .mobile-nav-content {
        padding: 1rem;
    }
    
    .logo-link {
        font-size: 1.5rem;
    }

    /* Improve tap targets and spacing */
    .mobile-nav-link,
    .mobile-dark-mode-toggle {
        padding: 0.875rem 0.75rem;
        border-radius: 0.75rem;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 4.5rem;
    }
    
    .navbar-container {
        padding: 0 0.75rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .navbar,
    .mobile-nav,
    #loadingScreen {
        display: none !important;
    }
    

}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.nav-link:focus,
.dark-mode-toggle:focus,
.mobile-menu-button:focus,
.mobile-nav-link:focus,
.mobile-dark-mode-toggle:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .navbar {
        border-bottom-width: 2px;
    }
    
    .nav-link::before,
    .mobile-nav-link::before {
        height: 3px;
    }
}

/* ========================================
   PREMIUM SELECTION & FOCUS STYLES
   ======================================== */

::selection { background: rgba(156, 163, 175, 0.35); color: #111827; }
::-moz-selection { background: rgba(156, 163, 175, 0.35); color: #111827; }

/* Custom focus ring for interactive elements */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(37, 99, 235, 0.5);
}

/* Smooth focus transitions */
.focus-smooth:focus {
    transition: box-shadow var(--transition-fast);
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Hardware acceleration for animations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimized transitions */
.transition-optimized {
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    will-change: transform, opacity;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hero-section {
        animation: none;
    }
    
    .hero-pattern {
        animation: none;
    }
    
    .hero-glow {
        animation: none;
    }
    
    .hero-title-main {
        animation: none;
    }
}
