/* =====================================================================
   Panel CSS -- rewritten for a cleaner, more consistent look.
   Every class name from the previous version is preserved, so no
   existing render function in app.js breaks. New utility classes
   at the bottom let render functions drop the worst inline styles.
   ===================================================================== */

:root {
  --bg: #0f1117;
  --bg-elev: #14171f;
  --sidebar: #161922;
  --surface: #1c2029;
  --surface-2: #232732;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e6e8ee;
  --text-secondary: #9aa1b2;
  --primary: #5b8def;
  --primary-hover: #4a7de0;
  --primary-dim: rgba(91, 141, 239, 0.12);
  --primary-glow: rgba(91, 141, 239, 0.22);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --success: #22c55e;
  --success-dim: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --muted: #6b7080;
  --glass: rgba(28, 32, 41, 0.72);
  --glass-border: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(11, 13, 19, 0.55);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 3px rgba(91, 141, 239, 0.22);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* --- Theme overrides ------------------------------------------------- */
[data-theme="midnight"] {
  --bg: #0f1117; --bg-elev: #14171f; --sidebar: #161922; --surface: #1c2029;
  --surface-2: #232732; --text: #e6e8ee; --text-secondary: #9aa1b2;
  --primary: #5b8def; --primary-hover: #4a7de0; --primary-dim: rgba(91, 141, 239, 0.12);
  --primary-glow: rgba(91, 141, 239, 0.22); --glass: rgba(28, 32, 41, 0.72);
}
[data-theme="ocean"] {
  --bg: #0a192f; --bg-elev: #0e2340; --sidebar: #0f2440; --surface: #142d50;
  --surface-2: #1a3760; --text: #d4ddf2; --text-secondary: #8892b0;
  --primary: #64ffda; --primary-hover: #52e6c4; --primary-dim: rgba(100, 255, 218, 0.1);
  --primary-glow: rgba(100, 255, 218, 0.2); --glass: rgba(17, 34, 64, 0.75);
}
[data-theme="sunset"] {
  --bg: #1a1025; --bg-elev: #211432; --sidebar: #241638; --surface: #2e1a44;
  --surface-2: #38214f; --text: #f0e6ff; --text-secondary: #b8a0d0;
  --primary: #ff7eb3; --primary-hover: #ff6aa6; --primary-dim: rgba(255, 126, 179, 0.12);
  --primary-glow: rgba(255, 126, 179, 0.22); --glass: rgba(42, 21, 53, 0.75);
}
[data-theme="emerald"] {
  --bg: #0d1512; --bg-elev: #12211b; --sidebar: #12231e; --surface: #182f28;
  --surface-2: #1f3a32; --text: #d3f5e8; --text-secondary: #7fb8a0;
  --primary: #34d399; --primary-hover: #2bc48a; --primary-dim: rgba(52, 211, 153, 0.12);
  --primary-glow: rgba(52, 211, 153, 0.22); --glass: rgba(20, 36, 32, 0.75);
}
[data-theme="cyberpunk"] {
  --bg: #0b0b12; --bg-elev: #131320; --sidebar: #131320; --surface: #1a1a2a;
  --surface-2: #22223a; --text: #f4f4fa; --text-secondary: #9797ac;
  --primary: #bd93f9; --primary-hover: #a67ef0; --primary-dim: rgba(189, 147, 249, 0.12);
  --primary-glow: rgba(189, 147, 249, 0.24); --glass: rgba(22, 22, 30, 0.75);
}

/* --- Reset & base ---------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
*:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}
html, body {
  height: 100%; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  display: flex;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(91, 141, 239, 0.06), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(91, 141, 239, 0.04), transparent 60%),
    var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--primary-glow); color: var(--text); }

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.18); }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
