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

:root {
  --bg-dark: #07090E;
  --bg-surface: #0E131F;
  --bg-card: rgba(18, 24, 38, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.4);
  --accent-purple: #8B5CF6;
  --accent-violet: #7C3AED;
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
}

* {
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}
/* The glow behind everything: one fixed layer (a fixed body background repaints the whole page on every scroll) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(124, 58, 237, 0.12), transparent 35%),
    radial-gradient(circle at 85% 25%, rgba(6, 182, 212, 0.08), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.08), transparent 40%);
}

/* Glassmorphism Cards — no backdrop blur: behind them there are only soft gradients (blurring them changes nothing you
   can see), and a blur layer under live content (Live Chat, voice notes, toasts, modals) made the page flicker */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 12px 40px 0 rgba(124, 58, 237, 0.12);
}

.glass-header {
  /* solid on purpose: a blurred sticky bar above live content flickered (no backdrop-filter anywhere) */
  background: rgb(12, 16, 27);
  border-bottom: 1px solid var(--border-subtle);
}

/* 📌 Live Chat: ONLY the «a person answers» + «Resume AI» bar of the open chat (never the fan's head — owner, 2026-10-17) stays right under the top bar while
   the page scrolls (owner, 2026-10-16) — solid, like the top bar; --topbar-h is measured by app.js */
.lc-sticky-head {
  position: sticky;
  top: var(--topbar-h, 64px);
  z-index: 20;
  background: rgb(10, 14, 24);
}

/* Glow Badges */
.badge-connected {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.badge-disconnected {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-coming-soon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.2));
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #7C3AED 0%, #6366F1 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8B5CF6 0%, #4F46E5 100%);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.6);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
  border: 1px solid var(--border-subtle);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
  background: linear-gradient(135deg, #7C3AED, #06B6D4);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.4);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Audio Waveform Player Simulation */
.waveform-box {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
  border-radius: 12px;
}

.waveform-bar {
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #06B6D4 0%, #3B82F6 100%);
  transform-origin: center;
}
/* only the voice note that is playing moves (transform only: no layout or repaint of the chat on every frame) */
.waveform-box.is-playing .waveform-bar {
  animation: wavePulse 0.9s ease-in-out infinite alternate;
}
.waveform-box.is-playing .waveform-bar:nth-child(odd) { animation-delay: -0.45s; }

@keyframes wavePulse {
  0% { transform: scaleY(0.35); }
  100% { transform: scaleY(1); }
}

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

::-webkit-scrollbar-track {
  background: rgba(7, 9, 14, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.4);
}

/* Modals (no backdrop blur: two stacked blurred layers flashed the page behind when something changed on top) */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.88);
}

/* Rock-solid, flicker-free modal dialog (Prevents layout shifts, transparent flashes & seesaw bouncing) */
.modal-dialog-solid {
  background: #0d121f !important;
  background-color: #0d121f !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: none !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(139, 92, 246, 0.35) !important;
  contain: paint;
}

.modal-dialog-solid * {
  backface-visibility: hidden;
}


/* 🎉 a purchase: fireworks over the card (app.js celebrateEl) — transform / opacity only, gone after 1.8″ */
.vel-confetti { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 15; }
.vel-confetti i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 2px; opacity: 0; animation: vel-burst 1.4s ease-out forwards; }
@keyframes vel-burst {
  0% { transform: translate(-50%, -50%) scale(0.4) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 40px)) scale(1) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .vel-confetti { display: none; } }

/* 📌 the mini-chat / Telegram room's bar (owner, 2026-10-17): its banner has a top margin — room under it too */
.lc-sticky-bar:not(:empty) { padding-bottom: 0.75rem; }

/* 📂 the mini-chat tab's big sections open / close as a whole (openers · phases · finishers) */
.lc-sec > summary::-webkit-details-marker { display: none; }
.lc-sec .lc-sec-arrow { transition: transform 0.15s ease; display: inline-block; }
.lc-sec[open] .lc-sec-arrow { transform: rotate(180deg); }
