/* ==========================================================================
   Easy Tech World — Design tokens
   Single source of truth for colours, type, spacing, radii and shadows.
   ========================================================================== */
:root {
  /* Brand */
  --etw-navy: #0B1230;
  --etw-navy-800: #111B45;
  --etw-navy-700: #18255A;
  --etw-blue: #2563EB;
  --etw-blue-dark: #1D4ED8;
  --etw-cyan: #12BDF2;

  /* Neutrals */
  --etw-white: #FFFFFF;
  --etw-bg: #F7F9FC;
  --etw-blue-50: #EFF6FF;
  --etw-text: #172033;
  --etw-text-muted: #5A6A82;   /* AA (>=4.5:1) on white and on the light-blue band */
  --etw-border: #E5EAF2;

  /* Theme tokens (semantic). Dark values are in the html[data-bs-theme="dark"] block at the end of this file. */
  --etw-surface: #FFFFFF;          /* cards, inputs, modals, dropdowns, dashboard top bar */
  --etw-surface-2: #F8FAFC;        /* table headers, subtle panels */
  --etw-section-alt: #FFFFFF;      /* alternating page sections */
  --etw-heading: #0B1230;
  --etw-link: #2563EB;             /* blue used as TEXT / icons (lighter in dark mode for contrast) */
  --etw-link-hover: #1D4ED8;
  --etw-placeholder: #94A3B8;
  --etw-footer-bg: #0B1230;
  --etw-chip-bg: #0B1230;          /* small solid buttons: back-to-top, social icons on light areas */
  --etw-mark-bg: #FFE58F; --etw-mark-fg: #0B1230;
  --etw-badge-success-bg: #DCFCE7; --etw-badge-success-fg: #166534;
  --etw-badge-danger-bg: #FEE2E2;  --etw-badge-danger-fg: #991B1B;
  --etw-badge-warning-bg: #FEF3C7; --etw-badge-warning-fg: #92400E; --etw-badge-warning-border: #FDE68A;
  --etw-badge-secondary-bg: #F1F5F9; --etw-badge-secondary-fg: #475569;
  --etw-badge-primary-fg: #1D4ED8;
  color-scheme: light;

  /* Status */
  --etw-success: #16A34A;
  --etw-danger: #DC2626;
  --etw-warning: #D97706;

  /* Gradients */
  --etw-gradient-brand: linear-gradient(135deg, var(--etw-blue) 0%, var(--etw-cyan) 100%);
  --etw-gradient-dark: linear-gradient(135deg, var(--etw-navy) 0%, var(--etw-navy-700) 100%);
  --etw-gradient-hero: linear-gradient(180deg, var(--etw-blue-50) 0%, var(--etw-surface) 100%);

  /* Typography */
  --etw-font-heading: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --etw-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Radii */
  --etw-radius-sm: 8px;
  --etw-radius: 14px;
  --etw-radius-lg: 20px;
  --etw-radius-pill: 999px;

  /* Shadows */
  --etw-shadow-sm: 0 1px 2px rgba(11, 18, 48, .06), 0 1px 3px rgba(11, 18, 48, .05);
  --etw-shadow: 0 6px 20px rgba(11, 18, 48, .08);
  --etw-shadow-lg: 0 18px 40px rgba(11, 18, 48, .14);

  /* Layout */
  --etw-header-height: 76px;
  --etw-section-y: clamp(3rem, 6vw, 5.5rem);
  --etw-transition: .2s ease;

  /* Dashboard */
  --etw-sidebar-width: 260px;

  /* Bootstrap overrides (tokens Bootstrap reads at runtime) */
  --bs-primary: var(--etw-blue);
  --bs-primary-rgb: 37, 99, 235;
  --bs-body-font-family: var(--etw-font-body);
  --bs-body-color: var(--etw-text);
  --bs-body-bg: var(--etw-bg);
  --bs-border-color: var(--etw-border);
  --bs-link-color: var(--etw-blue);
  --bs-link-hover-color: var(--etw-blue-dark);
  --bs-success: var(--etw-success);
  --bs-danger: var(--etw-danger);
}

/* ==========================================================================
   Dark theme — applied when <html data-bs-theme="dark"> (set by js/theme-init.js).
   Only tokens change here; components read the tokens, so no per-component dark CSS is needed
   except where noted in components.css / layout.css.
   Contrast (WCAG): text #E6EAF2 on #0B1220 = 15:1 · muted #A3AEC2 on #131C2E = 7.6:1 ·
   link #7DB2FF on #0B1220 = 9:1 · white on button blue #2563EB = 5.2:1.
   ========================================================================== */
html[data-bs-theme="dark"] {
  --etw-bg: #0B1220;
  --etw-surface: #131C2E;
  --etw-surface-2: #1A2640;
  --etw-section-alt: #0F1729;
  --etw-blue-50: #16264A;          /* soft blue tint (icon boxes, hovers, soft badges) */
  --etw-text: #E6EAF2;
  --etw-text-muted: #A3AEC2;
  --etw-border: #26334F;
  --etw-heading: #F1F5FB;
  --etw-link: #7DB2FF;
  --etw-link-hover: #A9CBFF;
  --etw-placeholder: #8A97B1;
  --etw-footer-bg: #070C18;
  --etw-chip-bg: #1E2B4D;
  --etw-mark-bg: #FDE68A; --etw-mark-fg: #1F2937;
  --etw-badge-success-bg: rgba(34, 197, 94, .16);  --etw-badge-success-fg: #86EFAC;
  --etw-badge-danger-bg: rgba(248, 113, 113, .16); --etw-badge-danger-fg: #FCA5A5;
  --etw-badge-warning-bg: rgba(251, 191, 36, .16); --etw-badge-warning-fg: #FCD34D; --etw-badge-warning-border: rgba(251, 191, 36, .35);
  --etw-badge-secondary-bg: #26334F; --etw-badge-secondary-fg: #CBD5E1;
  --etw-badge-primary-fg: #A9CBFF;
  --etw-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
  --etw-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  --etw-shadow-lg: 0 18px 40px rgba(0, 0, 0, .55);
  --etw-danger: #F87171;
  --etw-success: #4ADE80;
  --etw-warning: #FBBF24;

  /* Bootstrap runtime tokens (kept in sync so Bootstrap components follow the theme) */
  --bs-body-color: var(--etw-text);
  --bs-body-bg: var(--etw-bg);
  --bs-emphasis-color: var(--etw-heading);
  --bs-heading-color: var(--etw-heading);
  --bs-secondary-bg: var(--etw-surface-2);
  --bs-tertiary-bg: var(--etw-surface);
  --bs-border-color: var(--etw-border);
  --bs-link-color: var(--etw-link);
  --bs-link-hover-color: var(--etw-link-hover);
  color-scheme: dark;
}
