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

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --bg:            #0a0a0a;
  --surface:       #111111;
  --surface-2:     #161616;
  --surface-3:     #1c1c1c;
  --border:        #222222;
  --border-strong: #333333;
  --text-1:        #ffffff;
  --text-2:        #a1a1a1;
  --text-3:        #555555;
  --accent:        #22c55e;
  --accent-dim:    rgba(34, 197, 94, 0.10);
  --accent-border: rgba(34, 197, 94, 0.25);
  --red:           #ef4444;
  --amber:         #f59e0b;
  --radius:        6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-hover:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* Monospace for IDs, code, endpoints */
.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* Score colors */
.score-red    { color: #ef4444; }
.score-amber  { color: #f59e0b; }
.score-green  { color: #22c55e; }
.score-emerald{ color: #4ade80; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* Row animation — subtle fade in */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.row-animate { animation: fadeUp 0.2s ease forwards; }

/* Focus ring */
:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

/* Input base */
input, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--border-strong);
}
input::placeholder { color: var(--text-3); }

/* Button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text-1);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #000;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Tag / badge */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
}

/* Status dot */
.dot-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Divider */
hr { border: none; border-top: 1px solid var(--border); }

/* Score ring transition */
.score-ring-fill {
  transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
.toggle.on::after { left: 18px; background: #000; }
