/* ============================================
   ENZ Pager — Common Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Background */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-card-hover: #22222f;
  --bg-glass: rgba(26, 26, 37, 0.7);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #9898aa;
  --text-muted: #5a5a6e;

  /* Service colours */
  --fire-primary: #DC2626;
  --fire-glow: rgba(220, 38, 38, 0.4);
  --fire-bg: rgba(220, 38, 38, 0.08);

  --ambulance-primary: #16A34A;
  --ambulance-glow: rgba(22, 163, 74, 0.4);
  --ambulance-bg: rgba(22, 163, 74, 0.08);

  --aos-primary: #2563EB;
  --aos-glow: rgba(37, 99, 235, 0.4);
  --aos-bg: rgba(37, 99, 235, 0.08);

  --dispatch-primary: #F59E0B;
  --dispatch-glow: rgba(245, 158, 11, 0.4);

  /* Status */
  --status-accept: #22C55E;
  --status-decline: #EF4444;
  --status-pending: #F59E0B;

  /* Discord */
  --discord-primary: #5865F2;
  --discord-hover: #4752C4;

  /* LCD */
  --lcd-green: #33ff33;
  --lcd-bg: #0d1a0d;
  --lcd-dim: #1a331a;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* Spacing */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
  color: inherit;
}

/* ---- Utilities ---- */
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes alertFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes alertPulse {
  0% { box-shadow: 0 0 0 0 var(--alert-color, var(--fire-glow)); }
  70% { box-shadow: 0 0 0 15px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease forwards;
}

.animate-slideUp {
  animation: slideUp 0.5s ease forwards;
}

/* ---- Background Pattern ---- */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(220, 38, 38, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(22, 163, 74, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Status Dot ---- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: var(--status-accept);
  box-shadow: 0 0 6px var(--status-accept);
}

.status-dot.offline {
  background: var(--status-decline);
}

.status-dot.pending {
  background: var(--status-pending);
  animation: pulse 2s ease infinite;
}
