/* ============================================
   Theme System - CSS Custom Properties
   Dark mode default, light mode via data-theme
   ============================================ */

:root {
  /* Background colors */
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-input: #252838;
  --bg-hover: #2a2d3e;
  --bg-modal-overlay: rgba(0, 0, 0, 0.6);

  /* Text colors */
  --text-primary: #e4e6ef;
  --text-secondary: #9ca3b4;
  --text-muted: #6b7280;
  --text-inverse: #0f1117;

  /* Accent colors */
  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-primary-subtle: rgba(99, 102, 241, 0.15);
  --accent-success: #22c55e;
  --accent-success-subtle: rgba(34, 197, 94, 0.15);
  --accent-warning: #f59e0b;
  --accent-warning-subtle: rgba(245, 158, 11, 0.15);
  --accent-danger: #ef4444;
  --accent-danger-subtle: rgba(239, 68, 68, 0.15);
  --accent-info: #3b82f6;

  /* Border colors */
  --border-primary: #2e3247;
  --border-subtle: #252838;
  --border-focus: #6366f1;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Misc */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;

  /* Navbar */
  --bg-navbar: #161822;

  /* Scrollbar */
  --scrollbar-track: #1a1d27;
  --scrollbar-thumb: #2e3247;
  --scrollbar-thumb-hover: #3d4158;

  /* Table */
  --bg-table-header: #1a1d27;
  --bg-table-row-alt: rgba(255, 255, 255, 0.02);
  --bg-table-row-hover: rgba(99, 102, 241, 0.06);

  /* Null badge */
  --null-bg: rgba(107, 114, 128, 0.2);
  --null-text: #6b7280;
}

[data-theme="light"] {
  /* Background colors */
  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f0f1f5;
  --bg-hover: #e8e9f0;
  --bg-modal-overlay: rgba(0, 0, 0, 0.3);

  /* Text colors */
  --text-primary: #1a1d2e;
  --text-secondary: #5a6178;
  --text-muted: #9ca3b4;
  --text-inverse: #ffffff;

  /* Accent colors */
  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-primary-subtle: rgba(79, 70, 229, 0.1);
  --accent-success: #16a34a;
  --accent-success-subtle: rgba(22, 163, 74, 0.1);
  --accent-warning: #d97706;
  --accent-warning-subtle: rgba(217, 119, 6, 0.1);
  --accent-danger: #dc2626;
  --accent-danger-subtle: rgba(220, 38, 38, 0.1);
  --accent-info: #2563eb;

  /* Border colors */
  --border-primary: #e2e4ec;
  --border-subtle: #eef0f5;
  --border-focus: #4f46e5;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Navbar */
  --bg-navbar: #ffffff;

  /* Scrollbar */
  --scrollbar-track: #f0f1f5;
  --scrollbar-thumb: #d1d5e0;
  --scrollbar-thumb-hover: #b4b9c8;

  /* Table */
  --bg-table-header: #f5f6fa;
  --bg-table-row-alt: rgba(0, 0, 0, 0.02);
  --bg-table-row-hover: rgba(79, 70, 229, 0.04);

  /* Null badge */
  --null-bg: rgba(156, 163, 180, 0.2);
  --null-text: #9ca3b4;
}

/* Smooth theme transition */
*,
*::before,
*::after {
  transition: background-color var(--transition-normal),
              border-color var(--transition-normal),
              color var(--transition-normal),
              box-shadow var(--transition-normal);
}

/* Disable transitions for elements that shouldn't animate */
input, textarea, select, button, .no-transition {
  transition: none;
}
