/*
 * Sophisticated & Readable Theme
 * Version: 2.1.0 (Updated with Professional Enhancements)
 */

:root {
    /* Light Theme Palette */
    --primary-color: #4a69bd;       /* A calmer, more professional blue */
    --secondary-color: #6a89cc;     /* A lighter shade for accents */
    --accent-color: #f6b93b;        /* A warm, inviting accent */
    --bg-color: #f8f9fa;            /* A very light grey for the main background */
    --card-bg: #ffffff;             /* Pure white for cards and panels */
    --text-color: #343a40;          /* A dark grey for high readability */
    --muted-text-color: #6c757d;    /* A softer grey for secondary text */
    --border-color: #dee2e6;        /* A light border color */
    --success-color: #28a745;       /* Standard success green */
    --danger-color: #dc3545;        /* Standard danger red */
    --info-color: #17a2b8;          /* Standard info cyan */
    --warning-color: #ffc107;       /* Standard warning yellow */

    /* Derived RGB values for RGBA usage */
    --primary-color-rgb: 74, 105, 189;

    /* Font & Typography */
    --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;         /* 16px */
    --line-height-base: 1.6;
    --h1-font-size: 2.25rem;        /* 36px */
    --h2-font-size: 1.75rem;        /* 28px */
    --h3-font-size: 1.5rem;         /* 24px */
    --h4-font-size: 1.25rem;        /* 20px */
    --h5-font-size: 1.1rem;         /* 17.6px */

    /* Shadows & Borders (Updated) */
    --box-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08); /* Stronger low-level shadow */
    --box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);   /* Deeper interactive shadow */
    --border-radius: 8px;
}

[data-theme="dark"] {
    /* Dark Theme Palette */
    --primary-color: #5d78c7;
    --secondary-color: #7c95d9;
    --accent-color: #ffc107;
    --bg-color: #121212;             /* A very dark grey, not pure black */
    --card-bg: #1e1e1e;              /* A slightly lighter grey for cards */
    --text-color: #e8eaed;           /* An off-white for text */
    --muted-text-color: #9aa0a6;     /* A muted grey for secondary text */
    --border-color: #3a3f44;         /* A subtle border color for dark mode */

    --primary-color-rgb: 93, 120, 199;
}

/* --- General Body & Typography --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family-sans-serif);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

h1 { font-size: var(--h1-font-size); }
h2 { font-size: var(--h2-font-size); }
h3 { font-size: var(--h3-font-size); }
h4 { font-size: var(--h4-font-size); }
h5 { font-size: var(--h5-font-size); }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* --- Components --- */

.card, .panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    transition: all 0.2s ease; /* Faster transition for snappier feel */
}

.card:hover, .panel:hover {
    box-shadow: var(--box-shadow);
    transform: translateY(-2px);
}

.card-header, .card-footer {
    background-color: transparent;
    border-color: var(--border-color);
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--box-shadow-sm); /* Added base shadow */
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 8px rgba(var(--primary-color-rgb), 0.3); /* Custom button shadow on hover */
    transform: translateY(-2px); /* Increased lift */
    color: #fff;
}

.btn-secondary {
    background-color: var(--muted-text-color);
    border-color: var(--muted-text-color);
    color: #fff;
}
.btn-secondary:hover {
    opacity: 0.85;
    color: #fff;
}

.form-control, .form-select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
}
.form-control:focus, .form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
    color: var(--text-color);
}

/* --- New Component: Theme Toggle Button --- */
.theme-toggle {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--box-shadow); /* Pronounced shadow to make it float */
    transition: all 0.2s ease;
    
    /* Fixed positioning */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.25);
    transform: translateY(-2px);
}

[data-theme="dark"] .theme-toggle {
    color: var(--accent-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-toggle:hover {
    color: var(--secondary-color);
}

/* --- Layout & Specifics --- */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-color) !important;
}

.alert {
    border-radius: var(--border-radius);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}