/* =========================
   Global Base Styles
   Vibrant Dark Theme
   ========================= */

:root {
  /* Surfaces (dark elevated) */
  --bg: #0f1117;
  --bg2: #161b26;
  --card: #1a1f2e;
  --card2: #1e2435;
  --frost: rgba(30, 36, 53, 0.85);

  /* Primary gradient anchors */
  --primary: #7c5cfc;
  --primaryHover: #9171ff;
  --accent-blue: #3b82f6;
  --accent-teal: #06d6a0;
  --accent-coral: #ff6b8a;
  --accent-amber: #f59e0b;

  /* Text */
  --text: #e8ecf4;
  --text2: #8b95a8;
  --muted: #5a6478;

  /* Borders & shadows */
  --border: rgba(255, 255, 255, 0.06);
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow2: rgba(0, 0, 0, 0.2);

  /* Status (vivid + glow) */
  --online: #06d6a0;
  --offline: #ff6b6b;
  --warning: #f59e0b;
  --info: #3b82f6;

  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    "Noto Sans",
    "Helvetica Neue",
    sans-serif;

  background:
    radial-gradient(
      800px 600px at 15% 0%,
      rgba(124, 92, 252, 0.15),
      transparent 60%
    ),
    radial-gradient(
      600px 400px at 85% 20%,
      rgba(6, 214, 160, 0.1),
      transparent 60%
    ),
    radial-gradient(
      500px 500px at 50% 80%,
      rgba(59, 130, 246, 0.08),
      transparent 60%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--text);
}

a {
  color: inherit;
}

.hidden { display: none !important; }

/* =========================
   Keyframe Animations
   ========================= */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 3px currentColor; }
  50%      { box-shadow: 0 0 10px currentColor; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bounceHover {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-4px); }
  60%  { transform: translateY(-2px); }
  100% { transform: translateY(-3px); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse {
  from { opacity: 1; }
  to   { opacity: 0.7; }
}

/* =========================
   Generic Table Popovers (Dark Theme)
   These are created dynamically by shared table JS (inline styles default to white).
   ========================= */

body.with-sidebar [data-role="filterPopover"] {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 24px var(--shadow) !important;
}

body.with-sidebar [data-role="filterPopover"] input {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
}

body.with-sidebar [data-role="filterPopover"] input::placeholder {
  color: var(--muted) !important;
}

body.with-sidebar #columnChooserDropdownActive {
  background: var(--card2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px var(--shadow) !important;
}

body.with-sidebar #columnChooserDropdownActive h4 {
  color: var(--text) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.with-sidebar #columnChooserDropdownActive label {
  color: var(--text) !important;
}

body.with-sidebar #columnChooserDropdownActive label:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

@keyframes flashYellow {
  0%, 100% { background: var(--card); border-color: rgba(124, 92, 252, 0.5); }
  50%      { background: rgba(245, 158, 11, 0.25); border-color: rgba(245, 158, 11, 0.7); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Custom Scrollbars ─────────────────────────────── */

/* Global styled scrollbar (Chrome/Safari/Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg2);
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 252, 0.35);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 92, 252, 0.65);
}

/* Global styled scrollbar (Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 252, 0.35) var(--bg2);
}

/* Table wrapper — styled horizontal scrollbar, only shown when needed */
.table-wrapper {
  overflow-x: auto !important;
}
.table-wrapper::-webkit-scrollbar {
  height: 8px;
}
