/* ─────────────────────────────────────────────────────────────────────
   Voronka · Oa Voice Widget — Sphere only, no panel.
   Версия 2026-05-28 v2. Один клик = старт сессии, повторный = завершить.
   ───────────────────────────────────────────────────────────────────── */

/* ── HARD KILL для всех легаси-виджетов на странице ──────────────────── */
#vfab, #vpanel,
.vfab, .vpanel,
#support-btn, .support-btn,
.mic-dot,
elevenlabs-convai,
[id*="convai-widget"],
[class*="voice-assistant-legacy"]{
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

:root{
  --oa-grad-strong: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
  --oa-grad-conic: conic-gradient(from 0deg, #7C3AED 0deg, #A855F7 90deg, #06B6D4 180deg, #22D3EE 270deg, #7C3AED 360deg);
}

/* ─── FAB сфера — премиальное неоновое свечение ──────────────────────── */
.oa-fab{
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 55%),
    var(--oa-grad-strong);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  isolation: isolate;
  box-shadow:
    0 0  0  1px rgba(255,255,255,.10) inset,
    0 0 14px 2px rgba(124,58,237,.55) inset,
    0 0 28px 4px rgba(124,58,237,.45),
    0 0 64px 14px rgba(124,58,237,.30),
    0 0 110px 30px rgba(6,182,212,.22),
    0 12px 40px rgba(0,0,0,.55);
  transition:
    transform .28s cubic-bezier(.34, 1.4, .64, 1),
    box-shadow .35s ease,
    filter .35s ease;
}

/* Внешний пульсирующий halo (конический градиент с вращением) */
.oa-fab::before{
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--oa-grad-conic);
  opacity: .55;
  filter: blur(16px);
  z-index: -2;
  animation: oa-spin 6s linear infinite, oa-pulse-halo 3.2s ease-in-out infinite;
}

/* Внутренний глянец */
.oa-fab::after{
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,.15) 100%);
  z-index: -1;
  pointer-events: none;
}

.oa-fab:hover{
  transform: translateY(-3px) scale(1.06);
  box-shadow:
    0 0  0  1px rgba(255,255,255,.14) inset,
    0 0 22px 3px rgba(124,58,237,.7) inset,
    0 0 40px 6px rgba(124,58,237,.6),
    0 0 88px 20px rgba(124,58,237,.42),
    0 0 140px 40px rgba(6,182,212,.32),
    0 16px 48px rgba(0,0,0,.6);
  filter: brightness(1.1);
}
.oa-fab:hover::before{ opacity: .9; filter: blur(20px); }
.oa-fab:active{ transform: translateY(-1px) scale(.99); }

/* Активное состояние во время сессии — пульсация сильнее, halo быстрее */
.oa-fab.oa-active{
  animation: oa-active-pulse 1.6s ease-in-out infinite;
}
.oa-fab.oa-active::before{
  opacity: .95;
  animation: oa-spin 2.2s linear infinite, oa-pulse-halo 1.4s ease-in-out infinite;
}

/* ─── Имя «Оа» на сфере ───────────────────────────────────────────── */
.oa-name{
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -.6px;
  color: #fff;
  text-shadow:
    0 0 14px rgba(255,255,255,.55),
    0 0 28px rgba(255,255,255,.30),
    0 2px 6px rgba(0,0,0,.40);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
.oa-fab.oa-active .oa-name{
  animation: oa-name-pulse 1.4s ease-in-out infinite;
}

/* ─── Tooltip слева от сферы ───────────────────────────────────────── */
.oa-fab-label{
  position: absolute;
  right: 88px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  white-space: nowrap;
  padding: 9px 16px;
  background: rgba(14, 14, 24, .96);
  color: #F5F5F5;
  border-radius: 9999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.oa-fab-label::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--oa-grad-strong);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .85;
  pointer-events: none;
}
.oa-fab:hover .oa-fab-label{ opacity: 1; transform: translateY(-50%) translateX(0); }

/* Когда идёт сессия — тултип превращается в status-indicator */
.oa-fab.oa-active .oa-fab-label{
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.oa-fab-label[data-state="speaking"]::after{
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22D3EE;
  margin-left: 8px;
  vertical-align: middle;
  animation: oa-dot 1s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(34, 211, 238, .8);
}
.oa-fab-label[data-state="listening"]::after{
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  margin-left: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(16, 185, 129, .8);
  animation: oa-dot 1.6s ease-in-out infinite;
}
.oa-fab-label[data-state="error"]{ color: #ef4444; }

[data-theme="light"] .oa-fab-label{
  background: #fff;
  color: #0A0A0A;
}

/* Mobile */
@media (max-width: 540px){
  .oa-fab{ right: 14px; bottom: 14px; width: 64px; height: 64px; }
  .oa-name{ font-size: 22px; }
  .oa-fab-label{ display: none; }
}

/* ─── Анимации ────────────────────────────────────────────────────── */
@keyframes oa-spin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
@keyframes oa-pulse-halo{
  0%, 100%{ transform: scale(1); opacity: .55; }
  50%{ transform: scale(1.20); opacity: .95; }
}
@keyframes oa-active-pulse{
  0%, 100%{ box-shadow:
    0 0  0  1px rgba(255,255,255,.14) inset,
    0 0 22px 3px rgba(124,58,237,.65) inset,
    0 0 36px 6px rgba(124,58,237,.6),
    0 0 80px 18px rgba(124,58,237,.42),
    0 0 130px 36px rgba(6,182,212,.30),
    0 14px 44px rgba(0,0,0,.6); }
  50%{ box-shadow:
    0 0  0  1px rgba(255,255,255,.20) inset,
    0 0 30px 5px rgba(124,58,237,.9) inset,
    0 0 56px 12px rgba(124,58,237,.78),
    0 0 110px 28px rgba(124,58,237,.55),
    0 0 180px 56px rgba(6,182,212,.42),
    0 18px 56px rgba(0,0,0,.65); }
}
@keyframes oa-name-pulse{
  0%, 100%{ text-shadow:
    0 0 14px rgba(255,255,255,.55),
    0 0 28px rgba(255,255,255,.30),
    0 2px 6px rgba(0,0,0,.40); }
  50%{ text-shadow:
    0 0 22px rgba(255,255,255,.95),
    0 0 44px rgba(255,255,255,.65),
    0 2px 6px rgba(0,0,0,.45); }
}
@keyframes oa-dot{
  0%, 100%{ transform: scale(1); opacity: 1; }
  50%{ transform: scale(.5); opacity: .4; }
}
