/* DBGuard Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme variables - Default Dark Mode (Premium Cyberpunk) */
  --bg-app: #090d16;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151d30 0%, #090d16 100%);
  --bg-glass: rgba(17, 25, 40, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-focus: rgba(255, 255, 255, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: rgba(15, 23, 42, 0.6);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-color: rgba(99, 102, 241, 0.15);

  /* Status Colors */
  --color-healthy: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #f97316;
  --color-critical: #ef4444;
  --color-info: #3b82f6;

  /* HSL bases for dynamic manipulation */
  --hsl-healthy: 142, 70%, 45%;
  --hsl-warning: 38, 92%, 50%;
  --hsl-danger: 25, 95%, 53%;
  --hsl-critical: 0, 84%, 60%;
  
  /* Dynamic Active state */
  --color-active: var(--color-healthy);
  --hsl-active: var(--hsl-healthy);
}

/* Light Mode Variables */
[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f1f5f9 100%);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border-glass: rgba(15, 23, 42, 0.08);
  --border-glass-focus: rgba(15, 23, 42, 0.2);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.5);
  --card-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.15);
  --glow-color: rgba(99, 102, 241, 0.05);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

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

/* Glassmorphism Panel base */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--card-shadow);
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: var(--border-glass-focus);
  box-shadow: var(--card-shadow), 0 0 20px var(--glow-color);
}

/* Glass Input Element styling */
.glass-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 0.5rem;
  color: var(--text-main);
  padding: 0.75rem 1rem;
  outline: none;
  transition: all 0.2s ease;
}
[data-theme="light"] .glass-input {
  background: rgba(0, 0, 0, 0.02);
}
.glass-input:focus {
  border-color: var(--color-active);
  box-shadow: 0 0 10px rgba(var(--hsl-active), 0.3);
  background: rgba(255, 255, 255, 0.05);
}

/* Custom Scrollbar for premium feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Custom severity colors dynamic border */
.severity-border {
  border-left-width: 4px;
}
.border-healthy { border-left-color: var(--color-healthy); }
.border-warning { border-left-color: var(--color-warning); }
.border-danger { border-left-color: var(--color-danger); }
.border-critical { border-left-color: var(--color-critical); }
.border-info { border-left-color: var(--color-info); }

/* Live Status Pulse indicator */
.pulse-indicator {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.pulse-indicator::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.33); opacity: 1; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

.pulse-healthy { background: var(--color-healthy); }
.pulse-healthy::after { border: 2px solid var(--color-healthy); }

.pulse-warning { background: var(--color-warning); }
.pulse-warning::after { border: 2px solid var(--color-warning); }

.pulse-danger { background: var(--color-danger); }
.pulse-danger::after { border: 2px solid var(--color-danger); }

.pulse-critical { background: var(--color-critical); }
.pulse-critical::after { border: 2px solid var(--color-critical); }
.pulse-critical {
  animation: heartbeat 1.2s infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  20% { transform: scale(1.15); }
  40% { transform: scale(1.05); }
  60% { transform: scale(1.15); }
  80%, 100% { transform: scale(1); }
}

/* Health Gauge SVG styling */
.gauge-svg {
  transform: rotate(-180deg);
  transform-origin: center;
}
.gauge-bg {
  stroke: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .gauge-bg {
  stroke: rgba(15, 23, 42, 0.05);
}
.gauge-value {
  stroke-dasharray: 251.2; /* 2 * PI * r (r=40) */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.8s ease;
}

/* Floating Scanning sweep effect */
.scanning-overlay {
  position: relative;
  overflow: hidden;
}
.scanning-overlay::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to bottom, transparent, rgba(var(--hsl-active), 0.15), transparent);
  animation: scanning-sweep 3s linear infinite;
  pointer-events: none;
}

@keyframes scanning-sweep {
  0% { top: -100%; }
  100% { top: 150%; }
}

/* Fade In animation */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Micro interaction transitions */
.btn-action {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--hsl-active), 0.25);
}
.btn-action:active {
  transform: translateY(0);
}

/* Grid layout custom alignments */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Custom drawer styling */
.drawer-panel {
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer-panel.open {
  transform: translateY(0);
}
