/* ============================================
   THEME SYSTEM — CSS Custom Properties
   TrainingCompare India — Premium Design System
   ============================================ */

/* ---------- Google Font Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   LIGHT MODE (Default)
   ============================================ */
:root {
    /* Brand Colors */
    --primary: #0A64D5;
    --primary-hover: #0854b8;
    --primary-light: #e0f2fe;
    --primary-glow: rgba(10, 100, 213, 0.4);
    --accent: #3EAEF0;
    --accent-glow: rgba(62, 174, 240, 0.3);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Surfaces */
    --bg-body: #f8faff;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-muted: #f1f5f9;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-bg-heavy: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --glass-blur: 20px;

    /* Text */
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-hover: #cbd5e1;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(10, 100, 213, 0.12);
    --shadow-card-hover: 0 20px 50px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(10, 100, 213, 0.06);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0A64D5, #3EAEF0);
    --gradient-hero: linear-gradient(135deg, rgba(10, 100, 213, 0.06) 0%, rgba(62, 174, 240, 0.04) 50%, rgba(255, 255, 255, 0) 100%);
    --gradient-subtle: linear-gradient(180deg, rgba(241, 245, 249, 0.5) 0%, rgba(248, 250, 255, 0) 100%);
    --gradient-card-border: linear-gradient(135deg, rgba(10, 100, 213, 0.2), rgba(62, 174, 240, 0.1), rgba(10, 100, 213, 0.05));

    /* Aurora BG (Light) */
    --aurora-1: rgba(10, 100, 213, 0.07);
    --aurora-2: rgba(62, 174, 240, 0.05);
    --aurora-3: rgba(16, 185, 129, 0.04);

    /* Layout */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Timing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;

    /* Typography */
    --font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Grid BG */
    --grid-color: rgba(10, 100, 213, 0.04);
    --dot-color: rgba(10, 100, 213, 0.08);
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    /* Surfaces */
    --bg-body: #030712;
    --bg-surface: #020E35;
    --bg-surface-hover: #051945;
    --bg-elevated: #072F7D;
    --bg-muted: #030a1e;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-heavy: rgba(2, 14, 53, 0.85);
    --glass-border: rgba(62, 174, 240, 0.25);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Text */
    --text-heading: #F8FAFC;
    --text-body: #B8C5D6;
    --text-muted: #8fa2b8;

    /* Borders */
    --border: #0d204d;
    --border-light: #071536;
    --border-hover: #1e3875;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(62, 174, 240, 0.08);
    --shadow-card-hover: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(62, 174, 240, 0.15);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #030712 0%, #020E35 25%, #072F7D 60%, #0A64D5 100%);
    --gradient-subtle: linear-gradient(180deg, rgba(2, 14, 53, 0.5) 0%, rgba(3, 7, 18, 0) 100%);
    --gradient-card-border: linear-gradient(135deg, rgba(62, 174, 240, 0.18), rgba(10, 100, 213, 0.1), rgba(62, 174, 240, 0.03));

    /* Aurora BG (Dark) */
    --aurora-1: rgba(10, 100, 213, 0.12);
    --aurora-2: rgba(62, 174, 240, 0.06);
    --aurora-3: rgba(16, 185, 129, 0.04);

    /* Primary adjustments */
    --primary-light: #3EAEF0;
    --primary-glow: rgba(62, 174, 240, 0.25);
    --accent-glow: rgba(62, 174, 240, 0.15);

    /* Grid BG */
    --grid-color: rgba(62, 174, 240, 0.03);
    --dot-color: rgba(62, 174, 240, 0.06);
}

/* ============================================
   BASE RESET & BODY
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--duration-slow) var(--ease-out),
        color var(--duration-slow) var(--ease-out);
    overflow-x: clip;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

p {
    color: var(--text-body);
}

.text-primary-custom {
    color: var(--primary) !important;
}

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

.text-muted-custom {
    color: var(--text-muted) !important;
}

.text-secondary-custom {
    color: var(--text-body) !important;
}

.bg-primary-custom {
    background-color: var(--primary) !important;
}

.bg-accent {
    background-color: var(--accent) !important;
}

/* ============================================
   LINKS
   ============================================ */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

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

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: var(--primary);
    color: var(--text-inverse);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* ============================================
   BOOTSTRAP DARK MODE OVERRIDES
   ============================================ */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .dark-bg-dark {
    background-color: var(--bg-surface) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-muted) !important;
}

[data-theme="dark"] .text-body {
    color: var(--text-body) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-heading) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

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

[data-theme="dark"] .border-primary {
    border-color: rgba(56, 189, 248, 0.15) !important;
}

[data-theme="dark"] .shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

[data-theme="dark"] .bg-primary-custom.bg-opacity-10,
html[data-theme="dark"] .bg-primary-custom.bg-opacity-10 {
    background-color: rgba(10, 100, 213, 0.15) !important;
}

[data-theme="dark"] .badge-premium,
html[data-theme="dark"] .badge-premium {
    background: rgba(62, 174, 240, 0.12) !important;
    color: #3EAEF0 !important;
    border-color: rgba(62, 174, 240, 0.25) !important;
}

[data-theme="dark"] .text-primary-custom,
html[data-theme="dark"] .text-primary-custom {
    color: #3EAEF0 !important;
}

/* Bootstrap forms in dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-muted);
    border-color: var(--border);
    color: var(--text-heading);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--bg-elevated);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-heading);
}

/* Dropdown in dark mode */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-elevated);
    border-color: var(--border);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-body);
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--bg-surface-hover);
    color: var(--text-heading);
}

/* Alert in dark mode */
[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}

/* Accordion in dark mode */
[data-theme="dark"] .accordion-button {
    background-color: var(--bg-surface);
    color: var(--text-heading);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--primary-light);
    color: var(--primary);
}

[data-theme="dark"] .accordion-body {
    background-color: var(--bg-surface);
    color: var(--text-body);
}

[data-theme="dark"] .accordion-item {
    border-color: var(--border);
    background-color: var(--bg-surface);
}

/* Badge */
[data-theme="dark"] .badge.bg-secondary {
    background-color: var(--bg-elevated) !important;
    color: var(--text-muted);
}

/* Table */
[data-theme="dark"] .table {
    color: var(--text-body);
}

[data-theme="dark"] .table> :not(caption)>*>* {
    background-color: var(--bg-surface);
    color: var(--text-body);
    border-color: var(--border);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}