/* Light Theme (Default) - Soft & Comfortable */
:root {
    /* Backgrounds - soft warm tones */
    --bg-primary: #f2f4f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecf0;
    --bg-hover: #edf0f4;
    --bg-stripe: #f8f9fb;

    /* Text - good contrast */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    /* Accent - balanced blue */
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.1);

    /* Borders - subtle */
    --border: #d1d5db;
    --border-light: #e5e7eb;

    /* Status colors - with good text contrast */
    --success: #059669;
    --success-text: #065f46;
    --success-bg: #d1fae5;
    --warning: #d97706;
    --warning-text: #92400e;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-text: #991b1b;
    --danger-bg: #fee2e2;
    --info: #0284c7;
    --info-text: #075985;
    --info-bg: #e0f2fe;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);

    /* Sidebar - light theme */
    --sidebar-bg: #f2f4f7;
    --sidebar-text: #111827;
    --sidebar-text-secondary: #6b7280;
    --sidebar-item-bg: #ffffff;
    --sidebar-hover: #e9ecf0;
    --sidebar-active: #dde1e7;
    --sidebar-border: #d1d5db;
}

/* Dark Theme - Easy on eyes */
[data-theme="dark"] {
    /* Backgrounds - true dark, not pure black */
    --bg-primary: #0f0f10;
    --bg-secondary: #1a1a1c;
    --bg-tertiary: #252528;
    --bg-hover: #2a2a2d;
    --bg-stripe: #1f1f22;

    /* Text - not pure white */
    --text-primary: #f0f0f2;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Accent - muted blue-gray for dark */
    --accent: #6b7a8f;
    --accent-hover: #7d8ca1;
    --accent-light: rgba(107, 122, 143, 0.2);

    /* Borders */
    --border: #333338;
    --border-light: #2a2a2d;

    /* Status colors - adjusted for dark */
    --success: #34d399;
    --success-text: #34d399;
    --success-bg: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-text: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-text: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.15);
    --info: #38bdf8;
    --info-text: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.15);

    /* Shadows - subtle for dark */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);

    /* Sidebar - slightly lighter than bg */
    --sidebar-bg: #1a1a1c;
    --sidebar-text: #f0f0f2;
    --sidebar-text-secondary: #9ca3af;
    --sidebar-item-bg: transparent;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(255, 255, 255, 0.1);
    --sidebar-border: #2a2a2d;
}

/* System preference auto-detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f0f10;
        --bg-secondary: #1a1a1c;
        --bg-tertiary: #252528;
        --bg-hover: #2a2a2d;
        --bg-stripe: #1f1f22;
        --text-primary: #f0f0f2;
        --text-secondary: #9ca3af;
        --text-muted: #6b7280;
        --accent: #6b7a8f;
        --accent-hover: #7d8ca1;
        --accent-light: rgba(107, 122, 143, 0.2);
        --border: #333338;
        --border-light: #2a2a2d;
        --success: #34d399;
        --success-text: #34d399;
        --success-bg: rgba(52, 211, 153, 0.15);
        --warning: #fbbf24;
        --warning-text: #fbbf24;
        --warning-bg: rgba(251, 191, 36, 0.15);
        --danger: #f87171;
        --danger-text: #f87171;
        --danger-bg: rgba(248, 113, 113, 0.15);
        --info: #38bdf8;
        --info-text: #38bdf8;
        --info-bg: rgba(56, 189, 248, 0.15);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
        --sidebar-bg: #1a1a1c;
        --sidebar-text: #f0f0f2;
        --sidebar-text-secondary: #9ca3af;
        --sidebar-item-bg: transparent;
        --sidebar-hover: rgba(255, 255, 255, 0.06);
        --sidebar-active: rgba(255, 255, 255, 0.1);
        --sidebar-border: #2a2a2d;
    }
}

/* Smooth transitions */
body,
.card,
.sidebar,
.btn,
.form-control,
.table {
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
}
