/* Theme CSS Variables */
:root {
    /* Light Theme Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-accent: #e2e8f0;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #f1f5f9;
    
    /* Border Colors */
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --border-accent: #94a3b8;
    
    /* Brand Colors */
    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;
    --brand-secondary: #1d4ed8;
    --brand-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
    
    /* Status Colors */
    --success: #10b981;
    --success-hover: #059669;
    --success-bg: #dcfce7;
    --success-border: #bbf7d0;
    --success-text: #166534;
    
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-bg: #fefce8;
    --warning-border: #fef08a;
    --warning-text: #ca8a04;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #dc2626;
    
    --info: #6366f1;
    --info-hover: #4f46e5;
    --info-bg: #eef2ff;
    --info-border: #c7d2fe;
    --info-text: #4338ca;
    
    /* Sidebar Colors */
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    --sidebar-text: #f1f5f9;
    --sidebar-text-secondary: #cbd5e1;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(59, 130, 246, 0.15);
    --sidebar-border: rgba(255, 255, 255, 0.1);
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-brand: 0 8px 25px rgba(59, 130, 246, 0.4);
    
    /* Form Colors */
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-focus-border: #3b82f6;
    --input-focus-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    
    /* Transition */
    --transition: all 0.2s ease;
    --transition-fast: all 0.15s ease;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-accent: #475569;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #1e293b;
    
    /* Border Colors */
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-accent: #64748b;
    
    /* Brand Colors remain similar but adjusted for dark theme */
    --brand-primary: #60a5fa;
    --brand-primary-hover: #3b82f6;
    --brand-secondary: #2563eb;
    --brand-gradient: linear-gradient(135deg, #60a5fa, #3b82f6);
    
    /* Status Colors - adjusted for dark theme */
    --success: #34d399;
    --success-hover: #10b981;
    --success-bg: #064e3b;
    --success-border: #065f46;
    --success-text: #6ee7b7;
    
    --warning: #fbbf24;
    --warning-hover: #f59e0b;
    --warning-bg: #451a03;
    --warning-border: #78350f;
    --warning-text: #fcd34d;
    
    --danger: #f87171;
    --danger-hover: #ef4444;
    --danger-bg: #450a0a;
    --danger-border: #7f1d1d;
    --danger-text: #fca5a5;
    
    --info: #818cf8;
    --info-hover: #6366f1;
    --info-bg: #1e1b4b;
    --info-border: #312e81;
    --info-text: #a5b4fc;
    
    /* Sidebar Colors - darker in dark theme */
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --sidebar-text: #f1f5f9;
    --sidebar-text-secondary: #cbd5e1;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(96, 165, 250, 0.2);
    --sidebar-border: rgba(255, 255, 255, 0.1);
    
    /* Shadow Colors - adjusted for dark theme */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
    --shadow-brand: 0 8px 25px rgba(96, 165, 250, 0.3);
    
    /* Form Colors */
    --input-bg: #334155;
    --input-border: #475569;
    --input-focus-border: #60a5fa;
    --input-focus-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Theme Toggle Button Styles */
.theme-toggle {
    position: relative;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--sidebar-text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

/* Theme transition for smooth switching */
* {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Disable transitions during theme switch to prevent flash */
.theme-switching * {
    transition: none !important;
}

/* Theme toggle animations */
.theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(180deg);
    position: absolute;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Scrollbar theming */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-accent);
}

::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
