/* 
  Nurse Stat Lab - Base Styles & Variables
*/

:root {
    /* Color Palette */
    --primary-blue: #2563eb;
    --primary-blue-light: #eff6ff;
    --primary-blue-hover: #1d4ed8;

    --secondary-teal: #0d9488;
    --secondary-teal-light: #f0fdfa;

    --accent-orange: #ea580c;
    --accent-orange-light: #fff7ed;

    --danger-red: #ef4444;
    --danger-red-light: #fef2f2;

    --success-green: #10b981;
    --success-green-light: #ecfdf5;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    --border-color: #e2e8f0;

    /* Typography */
    --font-family: 'Inter', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
}

/* Stealth Mode (Dark/Clinical Theme) */
body.stealth-mode {
    --primary-blue: #60a5fa;
    /* Muted blue */
    --primary-blue-light: #1e3a8a;
    --primary-blue-hover: #93c5fd;

    --secondary-teal: #2dd4bf;
    --secondary-teal-light: #134e4a;

    --accent-orange: #fb923c;
    --accent-orange-light: #7c2d12;

    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;

    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;

    --border-color: #334155;

    /* Clinical typography override (optional) */
    --font-family: 'Courier New', Courier, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    z-index: 40;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.mobile-close-btn {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Mini User Stats in Sidebar */
.user-stats-compact {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--primary-blue-light);
}

.user-level {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.xp-bar-container {
    height: 6px;
    background-color: #cbd5e1;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.xp-bar {
    height: 100%;
    background-color: var(--primary-blue);
    transition: width 0.5s ease-in-out;
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
    color: var(--text-light);
    transition: color var(--transition-fast);
}

.nav-link:hover {
    background-color: var(--bg-main);
    color: var(--primary-blue);
}

.nav-link:hover i {
    color: var(--primary-blue);
}

.nav-link.active {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
    border-right: 3px solid var(--primary-blue);
}

.nav-link.active i {
    color: var(--primary-blue);
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    display: none;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 30;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 1rem;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

/* Typography Utilities */
.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .mobile-close-btn {
        display: block;
    }

    .topbar {
        display: flex;
    }

    .content-area {
        padding: 1rem;
    }
}