/* Application Custom Styles & Glassmorphism System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: #07090e;
  color: #f1f5f9;
  min-height: 100vh;
  selection-background-color: #6366f1;
  selection-color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0b0f19;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Glassmorphism & Glow Tokens */
.glass-panel {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-panel-hover {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-panel-hover:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.1), 0 8px 10px -6px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.glow-indigo {
  box-shadow: 0 0 25px -5px rgba(99, 102, 241, 0.4);
}

.glow-cyan {
  box-shadow: 0 0 25px -5px rgba(6, 182, 212, 0.4);
}

.glow-emerald {
  box-shadow: 0 0 25px -5px rgba(16, 185, 129, 0.4);
}

.glow-rose {
  box-shadow: 0 0 25px -5px rgba(244, 63, 94, 0.4);
}

/* Range input customization */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: #1e293b;
  height: 6px;
  border-radius: 9999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Animations */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.pulse-live {
  animation: pulse-subtle 2s infinite ease-in-out;
}

code, pre {
  font-family: var(--font-mono);
}

/* ==========================================================================
   Theme Switcher Control (Component Styles)
   ========================================================================== */

/* Dark Mode (Default) */
.theme-switch-container {
  background-color: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(30, 41, 59, 0.8);
}

.theme-switch-btn {
  color: #94a3b8;
  background-color: transparent;
  border: 1px solid transparent;
}

.theme-switch-btn svg {
  color: #94a3b8;
  stroke: #94a3b8;
}

.theme-switch-btn span {
  color: #94a3b8;
}

.theme-switch-btn:hover {
  color: #f8fafc;
}

.theme-switch-btn:hover svg {
  color: #f8fafc;
  stroke: #f8fafc;
}

.theme-switch-btn:hover span {
  color: #f8fafc;
}

.theme-switch-btn.is-active {
  background-color: #1e293b !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(51, 65, 85, 0.6) !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important;
}

.theme-switch-btn.is-active svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.theme-switch-btn.is-active span {
  color: #ffffff !important;
}

/* ==========================================================================
   Light Theme System (Default: Dark, User Toggleable like in TGDash)
   ========================================================================== */

html.theme-light {
  color-scheme: light;

  /* Remap Tailwind v4 slate color tokens for light mode */
  --color-slate-950: #f8fafc; /* Page background / canvas */
  --color-slate-900: #ffffff; /* Surface / Cards / Sidebar / Panels */
  --color-slate-800: #f1f5f9; /* Sub-surfaces / Badges / Input bg */
  --color-slate-700: #e2e8f0; /* Default borders / dividers */
  --color-slate-600: #cbd5e1; /* Subtle outlines */
  --color-slate-500: #64748b; /* Muted text / icons */
  --color-slate-400: #475569; /* Secondary labels / descriptions */
  --color-slate-300: #334155; /* Body text / readable labels */
  --color-slate-200: #1e293b; /* Strong text / subheadings */
  --color-slate-100: #0f172a; /* Primary titles / headings */

  /* Deepen vibrant colors for clean high contrast on light backgrounds */
  --color-emerald-400: #059669;
  --color-emerald-300: #047857;
  --color-blue-400: #2563eb;
  --color-blue-300: #1d4ed8;
  --color-amber-400: #d97706;
  --color-amber-300: #92400e;
  --color-rose-400: #e11d48;
  --color-rose-300: #be123c;
  --color-indigo-400: #4f46e5;
  --color-indigo-300: #4338ca;
  --color-cyan-400: #0891b2;
  --color-cyan-300: #0e7490;
  --color-violet-400: #7c3aed;
  --color-violet-300: #6d28d9;
}

/* Base Body and Layout in Light Mode */
html.theme-light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.theme-light aside {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.theme-light header {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: #e2e8f0 !important;
}

html.theme-light nav.lg\:hidden {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.theme-light .glass-panel {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

html.theme-light .glass-panel-hover:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.15) !important;
}

/* Headings and General Text that have text-white on light surfaces */
html.theme-light .text-white:not(
  [class*="bg-indigo-"],
  [class*="bg-emerald-"],
  [class*="bg-rose-"],
  [class*="bg-red-"],
  [class*="bg-amber-"],
  [class*="bg-blue-"],
  [class*="bg-violet-"],
  [class*="from-indigo-"],
  [class*="from-blue-"],
  .theme-switch-btn.is-active
) {
  color: #0f172a;
}

/* Theme Switcher in Light Mode */
html.theme-light .theme-switch-container {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
}

html.theme-light .theme-switch-btn {
  color: #64748b;
}

html.theme-light .theme-switch-btn svg {
  color: #64748b;
  stroke: #64748b;
}

html.theme-light .theme-switch-btn span {
  color: #64748b;
}

html.theme-light .theme-switch-btn:hover {
  color: #0f172a;
}

html.theme-light .theme-switch-btn:hover svg {
  color: #0f172a;
  stroke: #0f172a;
}

html.theme-light .theme-switch-btn:hover span {
  color: #0f172a;
}

html.theme-light .theme-switch-btn.is-active {
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
}

html.theme-light .theme-switch-btn.is-active svg {
  color: #4f46e5 !important;
  stroke: #4f46e5 !important;
}

html.theme-light .theme-switch-btn.is-active span {
  color: #0f172a !important;
}

/* Light Scrollbar */
html.theme-light ::-webkit-scrollbar-track {
  background: #f8fafc;
}
html.theme-light ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
html.theme-light ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
