/* Light Theme (Default) */
:root {
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-sidebar: #ffffff;

    /* Text Colors — brand body ink #141414 on white. Tertiary / muted keep
       a softer shade so secondary captions stay distinguishable from primary
       copy without breaking contrast on white. */
    --text-primary: #141414;
    --text-secondary: #141414;
    --text-tertiary: #4b5563;
    --text-muted: #6b7280;
    --text-sidebar: #141414;
    --text-sidebar-hover: #141414;

    /* Strong heading / brand-blue text (light mode) */
    --heading: #001F57;
    
    /* Border Colors */
    --border-primary: #e2e8f0;
    --border-secondary: #d1d5db;
    --border-focus: #3b82f6;
    
    /* Accent Colors */
    --accent-primary: #1e40af;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-dark: #001f57;
    
    /* Card Colors */
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --card-border: #e2e8f0;
    
    /* Button Colors */
    --btn-primary-bg: #1e40af;
    --btn-primary-hover: #1d4ed8;
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #ffffff;
    --btn-secondary-hover: #f8fafc;
    --btn-secondary-text: #374151;
    --btn-secondary-border: #d1d5db;
    
    /* Input Colors */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus: #1e40af;
    --input-placeholder: #9ca3af;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #f0fdf4;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
.dark-theme {
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-sidebar: #1e293b;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-hover: #ffffff;

    /* Strong heading — light brand-blue tint so it stays readable on dark */
    --heading: #c7d2fe;
    
    /* Border Colors */
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-focus: #60a5fa;
    
    /* Accent Colors */
    --accent-primary: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-light: #1e40af;
    --accent-dark: #1e3a8a;
    
    /* Card Colors */
    --card-bg: #1e293b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --card-border: #334155;
    
    /* Button Colors */
    --btn-primary-bg: #3b82f6;
    --btn-primary-hover: #2563eb;
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #334155;
    --btn-secondary-hover: #475569;
    --btn-secondary-text: #e2e8f0;
    --btn-secondary-border: #475569;
    
    /* Input Colors */
    --input-bg: #334155;
    --input-border: #475569;
    --input-focus: #60a5fa;
    --input-placeholder: #94a3b8;
    
    /* Status Colors */
    --success: #34d399;
    --success-bg: #064e3b;
    --error: #f87171;
    --error-bg: #7f1d1d;
    --warning: #fbbf24;
    --warning-bg: #78350f;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Global Theme Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Base Body Styles */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Light-theme defensive ink. Some Bootstrap / inline-styled controls hard-code
   a darker text colour that worked against the old #1e293b but reads dull on
   the new brand ink. Force #141414 on every text-bearing element when we are
   NOT in dark mode; dark theme keeps its own palette. */
html:not(.dark-theme),
html:not(.dark-theme) body,
html:not(.dark-theme) main,
html:not(.dark-theme) article,
html:not(.dark-theme) section,
html:not(.dark-theme) p,
html:not(.dark-theme) span,
html:not(.dark-theme) td,
html:not(.dark-theme) th,
html:not(.dark-theme) li,
html:not(.dark-theme) label,
html:not(.dark-theme) h1,
html:not(.dark-theme) h2,
html:not(.dark-theme) h3,
html:not(.dark-theme) h4,
html:not(.dark-theme) h5,
html:not(.dark-theme) h6 {
    color: #141414;
}
html:not(.dark-theme) input:not([type="checkbox"]):not([type="radio"]),
html:not(.dark-theme) select,
html:not(.dark-theme) textarea {
    color: #141414;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Dark mode scrollbar */
.dark-theme ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.dark-theme ::-webkit-scrollbar-thumb {
    background: var(--border-primary);
}

.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
