/**
 * theme.css — shared design system for the whole app.
 *
 * Loaded first, before each page's own stylesheet/inline <style> block, so
 * page-specific rules can still layer on top. Defines one token set under
 * every variable name already used across the codebase (there were two
 * conflicting conventions — --primary vs --primary-color, etc.) so existing
 * per-page CSS picks up the new palette without needing every rule rewritten.
 */

:root {
    /* Brand */
    --primary: #6366f1;
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-hover: #4f46e5;
    --primary-light: #a5b4fc;

    --secondary: #f59e0b;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --secondary-hover: #d97706;

    /* Status */
    --success: #10b981;
    --green: #10b981;
    --correct-color: #10b981;
    --danger: #ef4444;
    --red: #ef4444;
    --incorrect-color: #ef4444;
    --info: #0ea5e9;
    --warning: #f59e0b;

    /* Neutrals */
    --dark: #0f172a;
    --dark-text: #0f172a;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;

    /* Shape */
    --radius-sm: 8px;
    --radius-md: 12px;
    --border-radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.16), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 10px 24px -4px rgba(99, 102, 241, 0.35);

    /* Motion */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Type */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base polish — applies everywhere without needing per-page overrides */
body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--primary-light);
    color: var(--dark);
}

a {
    color: var(--primary);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* Scrollbar (WebKit) — subtle, matches the neutral palette */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Generic elevated-card hover lift, opt-in via .modern-card, used by refreshed pages */
.modern-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
}

.modern-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Generic gradient primary button, opt-in via .btn-gradient */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -6px rgba(99, 102, 241, 0.45);
}

/* Shared alert boxes — replaces one-off inline-styled success/error <div>s */
.alert {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    text-align: left;
    border-left: 4px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: #047857;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger);
    color: #b91c1c;
}
