/* ===========================
   PsiGuard Dashboard Styles
   =========================== */

:root {
  --bg: #070812;
  --bg-soft: rgba(255, 255, 255, 0.04);

  --card: rgba(20, 22, 40, 0.55);
  --card-soft: rgba(20, 22, 40, 0.35);

  --border: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.08);

  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --muted-soft: rgba(255, 255, 255, 0.48);

  /* PsiGuard metric colors */
  --primary: #8b5cf6;  /* Purple (Kappa) */
  --secondary: #ec4899; /* Pink (Phi) */
  --lambda: #f59e0b;    /* Orange (Lambda) */
  --entropy: #fb923c;   /* Red-Orange (Entropy) */
  --gamma: #06b6d4;     /* Cyan (Gamma) */
  
  --success: #22c55e;
  --danger: #ef4444;

  /* Main gradient cycling through all PsiGuard colors */
  --grad: linear-gradient(90deg, #8b5cf6, #f59e0b, #fb923c, #06b6d4, #ec4899);
  --grad-simple: linear-gradient(90deg, #8b5cf6, #ec4899);
}

/* Optional theme hook */
html[data-theme="berry"] {
  /* you can override per-theme here later */
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1100px 700px at 20% 10%, rgba(139, 92, 246, 0.18), transparent 55%),
              radial-gradient(900px 600px at 80% 30%, rgba(236, 72, 153, 0.12), transparent 55%),
              var(--bg);
  color: var(--text);
}

/* The glass look used everywhere */
.glass-panel {
  background: rgba(18, 18, 32, 0.55);
  border: 1px solid var(--border-soft);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

/* Nice thin scrollbars */
.scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.45) rgba(255, 255, 255, 0.05);
}
.scroll-thin::-webkit-scrollbar {
  width: 8px;
  height: 10px; /* horizontal scrollbar height */
}
.scroll-thin::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}
.scroll-thin::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.45);
  border-radius: 999px;
}
.scroll-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(236, 72, 153, 0.55);
}

/* Badge styles */
.psi-badge {
  font-size: 0.65rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.psi-risk-none {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.10);
  color: rgba(34, 197, 94, 0.95);
}

/* Presence bar */
.presence-bar-track {
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.presence-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad-simple);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.25);
  transition: width 240ms ease;
}

/* Button hover effects with PsiGuard glow */
button:hover {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 35px rgba(236, 72, 153, 0.25);
}

/* Chart overlay styling */
#chartOverlay {
  background: linear-gradient(135deg, 
    rgba(18, 18, 32, 0.98) 0%, 
    rgba(20, 15, 35, 0.98) 50%, 
    rgba(25, 18, 40, 0.98) 100%);
}

/* Make canvases behave nicely */
canvas {
  display: block;
}

/* ============================================
   Expanded chart: glowing floating metric pills
   ============================================ */
.metric-tag {
  position: absolute;
  transform: translate(-50%, -120%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;

  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--primary);
  backdrop-filter: blur(12px);

  box-shadow:
    0 0 20px rgba(139, 92, 246, 0.35),
    0 0 40px rgba(236, 72, 153, 0.25),
    inset 0 0 10px rgba(139, 92, 246, 0.15);

  opacity: 0.9;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: metricPulse 2.5s ease-in-out infinite;
}

.metric-tag.active {
  opacity: 1;
  transform: translate(-50%, -135%) scale(1.08);
  border-color: var(--success);
  box-shadow:
    0 0 25px rgba(34, 197, 94, 0.35),
    0 0 45px rgba(139, 92, 246, 0.3),
    0 0 60px rgba(236, 72, 153, 0.25),
    inset 0 0 15px rgba(34, 197, 94, 0.2);
}

@keyframes metricPulse {
  0%, 100% { 
    filter: brightness(1);
    transform: translate(-50%, -120%) scale(1);
  }
  50% { 
    filter: brightness(1.2);
    transform: translate(-50%, -120%) scale(1.02);
  }
}
