/* ═══════════════════════════════════════════════════════════════════════════
   StudyBuddy — Global Application Styles
   ═══════════════════════════════════════════════════════════════════════════
   Defines the base CSS custom properties (variables) consumed by every
   component stylesheet.  Theme-specific overrides live in css/themes.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Default / fallback values (Middle Learner is the base) ─────────────── */
:root {
    /* Primary */
    --primary-color: #3b82f6;
    --primary-color-rgb: 59, 130, 246;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #2563eb);

    /* Text */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-muted-rgb: 107, 114, 128;

    /* Backgrounds */
    --card-bg: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-secondary-rgb: 243, 244, 246;
    --input-bg: #ffffff;

    /* Borders */
    --border-color: #e5e7eb;
    --border-radius: 0.5rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 0.75rem;
    --border-radius-pill: 50rem;

    /* Shadows */
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);

    /* Semantic colours */
    --success-color: #10b981;
    --success-color-rgb: 16, 185, 129;
    --warning-color: #f59e0b;
    --warning-color-rgb: 245, 158, 11;
    --danger-color: #ef4444;
    --danger-color-rgb: 239, 68, 68;

    /* Layout (overridden per theme) */
    --sidebar-gradient: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
    --top-row-bg: #f7f7f7;
    --top-row-border: #d6d5d5;
}

/* ── Global resets & helpers ────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth theme transitions */
html.theme-early-learner,
html.theme-middle-learner,
html.theme-older-student {
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}
