/* ------------------------------------------------------------------
   Silence Sentinel — vanilla Tailwind augmentation
   Tailwind via CDN; this file only adds what Tailwind utilities alone
   cannot express cleanly (custom glass, animated rings, scrollbar…).
------------------------------------------------------------------ */

:root {
  color-scheme: dark;
}

html, body {
  min-height: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Glass surfaces ------------------------------------------------ */
.glass {
  background: linear-gradient(140deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.06) inset,
    0 30px 80px -40px rgba(0,0,0,0.8);
}

.glass-strong {
  background: linear-gradient(140deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

/* Hover lift for interactive cards */
.lift {
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 260ms ease,
              border-color 260ms ease;
}
.lift:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 30px 80px -30px rgba(139, 92, 246, 0.35);
}

/* --- Gradient text ------------------------------------------------- */
.text-gradient {
  background: linear-gradient(120deg, #ffffff 0%, #c4b5fd 42%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-soft {
  background: linear-gradient(120deg, #e2e8f0 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Live pulse ring for playing stations ------------------------- */
.live-dot {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.7);
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 2px solid rgba(34,197,94,0.7);
  animation: pulseRing 2.4s cubic-bezier(0.455,0.03,0.515,0.955) infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.9; }
  80%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* --- Form elements ------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field > label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.7);
}
.input, .select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.input::placeholder {
  color: rgba(148, 163, 184, 0.55);
  font-weight: 400;
}
.input:focus, .select:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='%239ca3af' d='M4 6l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* --- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.3rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 180ms ease,
              background 180ms ease,
              border-color 180ms ease,
              opacity 180ms ease;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(130deg, #a78bfa 0%, #8b5cf6 45%, #6d28d9 100%);
  color: #ffffff;
  border: 1px solid rgba(167, 139, 250, 0.5);
  box-shadow: 0 18px 44px -18px rgba(139, 92, 246, 0.65),
              0 1px 0 0 rgba(255,255,255,0.25) inset;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 24px 60px -18px rgba(139, 92, 246, 0.85),
              0 1px 0 0 rgba(255,255,255,0.3) inset;
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.09);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(167, 139, 250, 0.35);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
}

/* --- Tabs --------------------------------------------------------- */
.pill-tab {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(203, 213, 225, 0.7);
  transition: all 180ms ease;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}
.pill-tab:hover { color: #e2e8f0; }
.pill-tab.active {
  background: linear-gradient(130deg, rgba(167, 139, 250, 0.22), rgba(139, 92, 246, 0.12));
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.55);
}

/* --- Status badges ------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-playing { background: rgba(34, 197, 94, 0.12);  color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
.badge-silent  { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
.badge-error   { background: rgba(239, 68, 68, 0.12);  color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.badge-unknown { background: rgba(100, 116, 139, 0.14);color: #cbd5e1; border-color: rgba(100, 116, 139, 0.35); }

/* --- Modal -------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 3, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeUp 0.2s ease-out;
}
.modal-card {
  width: min(520px, 100%);
  border-radius: 24px;
  padding: 2rem;
  animation: fadeUp 0.35s ease-out;
}
@keyframes fadeUp {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Toasts ------------------------------------------------------- */
.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 360px;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(17, 17, 30, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #e2e8f0;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.ok    { border-color: rgba(34, 197, 94, 0.4);  color: #bbf7d0; }
.toast.error { border-color: rgba(239, 68, 68, 0.4);  color: #fecaca; }
@keyframes toastIn {
  0% { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* --- Scrollbar ---------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.25);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.45); background-clip: padding-box; }

/* --- Waveform accent on hero ------------------------------------- */
.waveform-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.waveform-bars span {
  display: inline-block;
  width: 3px;
  background: linear-gradient(to top, rgba(139, 92, 246, 0.2), #a78bfa);
  border-radius: 2px;
  animation: wave 1.1s ease-in-out infinite;
}
.waveform-bars span:nth-child(1) { height: 40%; animation-delay: -1.1s; }
.waveform-bars span:nth-child(2) { height: 80%; animation-delay: -0.9s; }
.waveform-bars span:nth-child(3) { height: 55%; animation-delay: -0.7s; }
.waveform-bars span:nth-child(4) { height: 95%; animation-delay: -0.5s; }
.waveform-bars span:nth-child(5) { height: 65%; animation-delay: -0.3s; }
.waveform-bars span:nth-child(6) { height: 45%; animation-delay: -0.1s; }
@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50%      { transform: scaleY(1); }
}

/* --- Utility helpers --------------------------------------------- */
.hide { display: none !important; }
.fade-in { animation: fadeUp 0.5s ease-out both; }

/* Subtle card entrance stagger */
.stagger > * { opacity: 0; animation: fadeUp 0.55s ease-out forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.16s; }
.stagger > *:nth-child(4) { animation-delay: 0.22s; }
.stagger > *:nth-child(5) { animation-delay: 0.28s; }
.stagger > *:nth-child(6) { animation-delay: 0.34s; }
