/* ==========================================================================
   SysPulse - Global Styles, Themes & Component Styles
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- 1. Theme Variables Definitions --- */

/* Theme 1: Dark Nebula (Padrão) */
:root, [data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-solid: #0f172a;
  --bg-card-hover: #131d35;
  --bg-input: #090d16;
  --bg-drawer: rgba(15, 23, 42, 0.95);
  --border-color: #1e293b;
  --border-highlight: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --accent-brand: #06b6d4;
  --accent-brand-rgb: 6, 182, 212;
  --accent-emerald: #10b981;
  --accent-violet: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --chart-grid: rgba(255, 255, 255, 0.05);
}

/* Theme 2: Midnight OLED */
[data-theme="oled"] {
  --bg-main: #000000;
  --bg-card: rgba(10, 10, 10, 0.9);
  --bg-card-solid: #0a0a0a;
  --bg-card-hover: #141414;
  --bg-input: #050505;
  --bg-drawer: rgba(10, 10, 10, 0.98);
  --border-color: #1c1c1c;
  --border-highlight: #2e2e2e;
  --text-main: #fcfcfc;
  --text-muted: #8e8e8e;
  --text-faint: #555555;
  --accent-brand: #10b981;
  --accent-brand-rgb: 16, 185, 129;
  --accent-emerald: #059669;
  --accent-violet: #06b6d4;
  --accent-amber: #eab308;
  --accent-rose: #ef4444;
  --chart-grid: rgba(255, 255, 255, 0.04);
}

/* Theme 3: Cyberpunk Neon */
[data-theme="cyber"] {
  --bg-main: #0b011d;
  --bg-card: rgba(22, 6, 56, 0.82);
  --bg-card-solid: #17073b;
  --bg-card-hover: #260c5c;
  --bg-input: #0b011d;
  --bg-drawer: rgba(18, 5, 46, 0.96);
  --border-color: #3b1778;
  --border-highlight: #6021c7;
  --text-main: #ffffff;
  --text-muted: #c084fc;
  --text-faint: #8146c2;
  --accent-brand: #00f2fe;
  --accent-brand-rgb: 0, 242, 254;
  --accent-emerald: #10e796;
  --accent-violet: #ec4899;
  --accent-amber: #facc15;
  --accent-rose: #ff0055;
  --chart-grid: rgba(192, 132, 252, 0.08);
}

/* Theme 4: Nordic Frost */
[data-theme="nord"] {
  --bg-main: #181d28;
  --bg-card: rgba(36, 43, 56, 0.85);
  --bg-card-solid: #242b38;
  --bg-card-hover: #2d3646;
  --bg-input: #1a202c;
  --bg-drawer: rgba(30, 36, 48, 0.97);
  --border-color: #333d4f;
  --border-highlight: #46536b;
  --text-main: #eceff4;
  --text-muted: #9aa8bf;
  --text-faint: #67758d;
  --accent-brand: #38bdf8;
  --accent-brand-rgb: 56, 189, 248;
  --accent-emerald: #4ade80;
  --accent-violet: #818cf8;
  --accent-amber: #fbbf24;
  --accent-rose: #f87171;
  --chart-grid: rgba(255, 255, 255, 0.05);
}

/* Theme 5: Clean Light */
[data-theme="light"] {
  --bg-main: #f3f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-solid: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;
  --bg-drawer: rgba(255, 255, 255, 0.98);
  --border-color: #e2e8f0;
  --border-highlight: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --accent-brand: #0284c7;
  --accent-brand-rgb: 2, 132, 199;
  --accent-emerald: #059669;
  --accent-violet: #6366f1;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --chart-grid: rgba(0, 0, 0, 0.05);
}

/* --- 2. Base Typography & Background --- */
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* --- 3. Glassmorphism Card System --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: var(--border-highlight);
}

/* --- 4. Pulse Indicators & Animations --- */
.pulse-dot {
  position: relative;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 9999px;
  background: inherit;
  opacity: 0.7;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

/* --- 5. Custom Scrollbars --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-highlight);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* --- 6. Progress Bars & Badges --- */
.progress-bar-fill {
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}

/* --- 7. Modals & Slide-over Drawer --- */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Terminal Drawer */
.terminal-window {
  background: #070a10;
  border: 1px solid var(--border-color);
}

[data-theme="light"] .terminal-window {
  background: #0f172a;
  color: #f8fafc;
}

/* --- 8. Toast Notifications --- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-highlight);
  color: var(--text-main);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

@keyframes slideInToast {
  from { transform: translateY(1rem) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Light Theme Overrides for specific classes */
[data-theme="light"] .text-white {
  color: #0f172a !important;
}

[data-theme="light"] .text-slate-200 {
  color: #1e293b !important;
}

[data-theme="light"] .text-slate-300 {
  color: #334155 !important;
}

[data-theme="light"] .text-slate-400 {
  color: #64748b !important;
}

[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-900\/60,
[data-theme="light"] .bg-slate-800 {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .border-slate-800,
[data-theme="light"] .border-slate-700 {
  border-color: #e2e8f0 !important;
}
