/* ============================================================
   SETVO — style.css
   Motyw: ciemny, fioletowy akcent (#6366F1), glassmorphism.
   ============================================================ */

:root {
  --indigo: #6366f1;
  --indigo-bright: #818cf8;
  --bg: #0a0a0f;
}

* { box-sizing: border-box; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Tło: aurora (animowane plamy) ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(45rem 45rem at 15% 10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(40rem 40rem at 85% 20%, rgba(129, 140, 248, 0.14), transparent 55%),
    radial-gradient(50rem 50rem at 60% 100%, rgba(76, 81, 191, 0.16), transparent 60%);
  filter: blur(20px);
  animation: aurora-drift 18s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.08); }
}

/* ---------- Tło: subtelna siatka ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ---------- Tekst gradientowy ---------- */
.grad-text {
  background: linear-gradient(120deg, #a5b4fc 0%, #6366f1 60%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Animacje wejścia ---------- */
.fade-up {
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- Pulsująca kropka ---------- */
.pulse-dot { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ---------- Pierścienie połączenia (panel rozmowy) ---------- */
.call-ring {
  position: absolute;
  inset: -10px;
  border-radius: 9999px;
  border: 2px solid rgba(99, 102, 241, 0.5);
  animation: call-ring 1.8s ease-out infinite;
}
.call-ring::before,
.call-ring::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 9999px;
  border: 2px solid rgba(99, 102, 241, 0.35);
  animation: call-ring 1.8s ease-out infinite;
}
.call-ring::after { animation-delay: 0.6s; }
.call-ring::before { animation-delay: 1.2s; }
@keyframes call-ring {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Wskaźnik SPIN ---------- */
.spin-pill {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0;
  border-radius: 0.75rem;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  transition: all 0.4s ease;
}
.spin-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}
.spin-pill.done {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* ---------- Bąbelki transkrypcji ---------- */
.bubble {
  max-width: 82%;
  padding: 0.85rem 1.1rem;
  border-radius: 1.1rem;
  line-height: 1.55;
  font-size: 0.95rem;
  animation: bubble-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bubble-agent {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(79, 70, 229, 0.85));
  color: #fff;
  border-bottom-left-radius: 0.35rem;
}
.bubble-client {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border-bottom-right-radius: 0.35rem;
}

/* etykiety przy bąbelkach */
.bubble-meta {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  margin-bottom: 0.3rem;
}

/* znacznik SPIN przy bąbelku agenta */
.spin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  padding: 0.15rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  margin-left: 0.5rem;
}

/* adnotacja techniczna (obiekcja itp.) */
.note-chip {
  align-self: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  animation: bubble-in 0.4s ease both;
}

/* ---------- Wskaźnik pisania (typing) ---------- */
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.9rem 1.1rem;
}
.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: typing 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Pole ekstrakcji (landing) ---------- */
.extract-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  animation: extract-in 0.5s ease both;
}
@keyframes extract-in {
  from { opacity: 0; transform: translateX(-8px); border-color: rgba(99,102,241,0.5); }
  to   { opacity: 1; transform: translateX(0); border-color: transparent; }
}
.extract-row .label { color: rgba(255, 255, 255, 0.4); }
.extract-row .value { font-weight: 600; }

/* ---------- Success pop (dashboard) ---------- */
.success-pop { animation: success-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes success-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Pasek przewijania transkrypcji ---------- */
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.scroll-area::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* Redukcja ruchu dla dostępności */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Logo Setvo (inline SVG, dziedziczy kolor tekstu) ---------- */
.setvo-logo {
  height: 100%;
  width: auto;
  display: block;
  overflow: visible;
}
[data-setvo-logo] { line-height: 0; }
