/* ── CSS variables ────────────────────────────────────── */
:root {
  --rw-bg:         #09090b;
  --rw-surface:    #18181b;
  --rw-border:     #27272a;
  --rw-cyan:       #06b6d4;
  --rw-amber:      #f59e0b;
  --rw-red:        #ef4444;
  --rw-green:      #22c55e;
  --rw-text:       #fafafa;
  --rw-text-muted: #71717a;
}

/* ── Base ─────────────────────────────────────────────── */
html,
body,
#app {
  background: var(--rw-bg);
  color: #fafafa;
  min-height: 100vh;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
}

/* ── Typography helpers ───────────────────────────────── */
.font-display {
  font-family: "Chivo", sans-serif;
}

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

/* ── Live status dot ──────────────────────────────────── */
@keyframes pulse-green {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.7); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.live-dot {
  display: inline-block;
  width:  8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rw-green);
  animation: pulse-green 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

@keyframes pulse-amber {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0   rgba(245, 158, 11, 0.7); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

.live-dot.amber {
  background: var(--rw-amber);
  animation: pulse-amber 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

@keyframes pulse-red {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0   rgba(239, 68, 68, 0.7); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

.live-dot.red {
  background: var(--rw-red);
  animation: pulse-red 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* ── Beam border (AI panel) ───────────────────────────── */
@keyframes beam-rotate {
  from { --angle: 0deg; }
  to   { --angle: 360deg; }
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.beam-border {
  position: relative;
  border-radius: 0.5rem;
}

.beam-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    var(--rw-cyan) 60deg,
    transparent 120deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: beam-rotate 3s linear infinite;
  pointer-events: none;
}

/* ── Grid / dot background ────────────────────────────── */
.grid-bg {
  background-image:
    radial-gradient(circle, rgba(113, 113, 122, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ── Fade-up animation ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.35s ease both;
}

/* ── Severity pills ───────────────────────────────────── */
.sev-low {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.sev-medium {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.sev-high {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.sev-critical {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

::-webkit-scrollbar-track {
  background: var(--rw-bg);
}

::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

/* ── Selection tint ───────────────────────────────────── */
::selection {
  background: rgba(6, 182, 212, 0.25);
  color: #e0f7fa;
}
