/* ========================================
   AI Autopilot Ads - Modern Glass Theme
   Glassmorphism + Dark/Light Mode + Responsive
   ======================================== */

/* ========================================
   CSS Variables - Dark Mode (Default)
   ======================================== */
:root {
    /* Theme Toggle */
    --theme-mode: dark;
    
    /* Background Colors */
    --bg-primary: #0a0e14;
    --bg-secondary: #0f1419;
    --bg-tertiary: #151b23;
    --bg-card: rgba(21, 27, 35, 0.74);
    --bg-hover: rgba(26, 34, 44, 0.9);
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-bg-hover: rgba(255, 255, 255, 0.075);
    --glass-border: rgba(255, 255, 255, 0.11);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
    --glass-blur: blur(20px);
    --glass-saturate: saturate(180%);
    
    /* Borders */
    --border-primary: rgba(255, 255, 255, 0.06);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(99, 102, 241, 0.5);
    --border-color: var(--border-primary);
    
    /* Text Colors */
    --text-primary: #f0f6fc;
    --text-secondary: #9aa8ba;
    --text-muted: #7f8ea1;
    --text-tertiary: var(--text-muted);
    --text-inverse: #0a0e14;
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-hover: var(--accent-secondary);
    --primary: var(--accent-primary);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-glow: 0 0 20px rgba(99, 102, 241, 0.4);
    
    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --success-border: rgba(34, 197, 94, 0.3);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.15);
    --info-border: rgba(6, 182, 212, 0.3);
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Typography */
    --font-xs: 0.75rem;
    --font-sm: 0.9rem;
    --font-base: 1.02rem;
    --font-lg: 1.15rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.36);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.46);
    --shadow-xl: 0 24px 46px rgba(0, 0, 0, 0.58);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 70px;
    --content-max-width: 1440px;
    
    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-tooltip: 400;
    --z-toast: 500;
}

/* ========================================
   Light Mode Variables
   ======================================== */
[data-theme="light"] {
    --theme-mode: light;

    /* Background Colors — airy blue-white palette */
    --bg-primary: #eef2f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2eaf5;
    --bg-card: rgba(255, 255, 255, 0.97);
    --bg-hover: rgba(226, 234, 248, 0.88);
    --bg-overlay: rgba(15, 23, 42, 0.35);

    /* Glass Effects — crisp frosted clarity */
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-bg-hover: rgba(255, 255, 255, 0.97);
    --glass-border: rgba(15, 23, 42, 0.10);
    --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    --glass-blur: blur(20px);
    --glass-saturate: saturate(140%);

    /* Borders — clearly visible in light */
    --border-primary: rgba(15, 23, 42, 0.09);
    --border-secondary: rgba(15, 23, 42, 0.15);
    --border-accent: rgba(79, 70, 229, 0.35);
    --border-color: var(--border-primary);

    /* Text Colors — strong readable contrast */
    --text-primary: #0f172a;
    --text-secondary: #2d3f55;
    --text-muted: #5c6e8a;
    --text-tertiary: var(--text-muted);
    --text-inverse: #f8fafc;

    /* Accent Colors */
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --accent-hover: var(--accent-secondary);
    --primary: var(--accent-primary);
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    --accent-glow: 0 0 20px rgba(79, 70, 229, 0.18);

    /* Shadows — natural drop-shadows for depth */
    --shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 8px 28px rgba(15, 23, 42, 0.13);
    --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.17);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.08);

    /* Status backgrounds — slightly more opaque for light visibility */
    --success-bg: rgba(34, 197, 94, 0.12);
    --success-border: rgba(34, 197, 94, 0.28);
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.28);
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.28);
    --info-bg: rgba(6, 182, 212, 0.12);
    --info-border: rgba(6, 182, 212, 0.28);
}

/* ========================================
   Base Reset & Defaults
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 768px) {
    html { font-size: 14px; }
}

@media (min-width: 1200px) {
    html { font-size: 16px; }
}

@media (min-width: 1600px) {
    html { font-size: 16px; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

/* ========================================
   Glass Card Component
   ======================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.glass-card-static {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
}

/* ========================================
   Theme Toggle Button
   ======================================== */
.theme-toggle {
    position: relative;
    width: 56px;
    height: 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
}

.theme-toggle-track {
    position: absolute;
    inset: 2px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.theme-toggle-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: all var(--transition-normal);
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--accent-gradient);
    border-radius: 50%;
    box-shadow: var(--shadow-md), var(--accent-glow);
    transition: all var(--transition-bounce);
}

[data-theme="light"] .theme-toggle-thumb {
    left: calc(100% - 25px);
}

/* ========================================
   Modern Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-sm);
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md), var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-base);
    border-radius: var(--radius-xl);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-xs);
    border-radius: var(--radius-md);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

/* ========================================
   Modern Inputs
   ======================================== */
.input-group {
    position: relative;
    width: 100%;
}

.input-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-base);
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    transition: all var(--transition-fast);
}

.input::placeholder {
    color: var(--text-muted);
}

.input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), var(--accent-glow);
}

.input:hover:not(:focus) {
    border-color: var(--border-secondary);
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon {
    padding-left: var(--space-10);
}

/* ========================================
   Status Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

.badge-neutral {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

/* Pulsing dot for active status */
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ========================================
   Metric Cards
   ======================================== */
.metric-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--accent-glow);
}

.metric-value {
    font-size: var(--font-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-1);
}

.metric-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-sm);
    font-weight: 600;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

/* ========================================
   Data Tables
   ======================================== */
.table-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--glass-border);
}

.table td {
    padding: var(--space-4) var(--space-5);
    font-size: var(--font-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
    transition: background var(--transition-fast);
}

.table tbody tr:hover td {
    background: var(--glass-bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Sidebar Styles (Glass)
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sticky);
    transition: all var(--transition-normal);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--accent-glow);
}

.sidebar-logo-text {
    font-size: var(--font-lg);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-1);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--accent-glow);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: white;
    border-radius: var(--radius-full);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========================================
   Main Content Area
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    padding: 0 var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: var(--z-sticky);
}

.page-title {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.page-content {
    padding: var(--space-8);
    max-width: var(--content-max-width);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 72px;
    }
    
    .sidebar-logo-text,
    .nav-label {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: var(--space-3);
    }
    
    .page-content {
        padding: var(--space-6);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --header-height: 60px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-logo-text,
    .nav-label {
        display: block;
    }
    
    .nav-item {
        justify-content: flex-start;
        padding: var(--space-3) var(--space-4);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 0 var(--space-4);
    }
    
    .page-content {
        padding: var(--space-4);
    }
    
    .metric-card {
        padding: var(--space-4);
    }
    
    .metric-value {
        font-size: var(--font-2xl);
    }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: var(--bg-overlay);
        z-index: calc(var(--z-sticky) - 1);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .metric-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .btn-lg {
        width: 100%;
    }
}

/* ========================================
   Grid Layouts
   ======================================== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Loading States
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--glass-bg) 25%,
        var(--glass-bg-hover) 50%,
        var(--glass-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(-20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-up {
    animation: slideUp var(--transition-normal) ease-out;
}

.animate-slide-in {
    animation: slideIn var(--transition-normal) ease-out;
}

/* Staggered animations for lists */
.stagger-animate > * {
    animation: slideUp var(--transition-normal) ease-out both;
}

.stagger-animate > *:nth-child(1) { animation-delay: 0ms; }
.stagger-animate > *:nth-child(2) { animation-delay: 50ms; }
.stagger-animate > *:nth-child(3) { animation-delay: 100ms; }
.stagger-animate > *:nth-child(4) { animation-delay: 150ms; }
.stagger-animate > *:nth-child(5) { animation-delay: 200ms; }
.stagger-animate > *:nth-child(6) { animation-delay: 250ms; }

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Touch-friendly sizing for mobile */
@media (pointer: coarse) {
    .btn, .nav-item, .input {
        min-height: 44px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --glass-border: var(--text-secondary);
        --border-primary: var(--text-secondary);
    }
}
