/* ================================================================
   TARA Voice Bot — voice-bot.css
   ================================================================ */

/* ── FLOAT BUTTON ─────────────────────────────────────────────── */
.vb-float {
  position: fixed;
  bottom: calc(2rem + 56px + 12px);
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--brown-dark);
  border: 2px solid rgba(197,163,85,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(44,24,16,0.45);
  z-index: 50;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  animation: vb-appear 0.5s ease 1s both;
}
.vb-float svg { width: 22px; height: 22px; color: var(--gold); }
.vb-float:hover {
  transform: scale(1.08);
  background: #3A1C0C;
  border-color: var(--gold);
  box-shadow: 0 6px 26px rgba(197,163,85,0.4);
}

/* Pulse attention animation on load (3 pulses) */
@keyframes vb-appear {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vb-float::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(197,163,85,0.4);
  animation: vb-pulse 2s ease 1.6s 3;
}
@keyframes vb-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── OVERLAY ──────────────────────────────────────────────────── */
.vb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.vb-overlay.vb-open {
  opacity: 1;
  pointer-events: none; /* allow page scroll */
}

/* ── MODAL (bottom sheet on mobile, card on desktop) ──────────── */
.vb-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--brown-dark);
  border-radius: 16px 16px 0 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 32px;
  max-height: 88dvh;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  pointer-events: none;
}
.vb-modal.vb-open {
  transform: translateY(0);
  pointer-events: auto;
}

/* Drag handle */
.vb-handle {
  width: 40px;
  height: 4px;
  background: rgba(197,163,85,0.3);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

/* Header */
.vb-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 8px;
  flex-shrink: 0;
}
.vb-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--gold-pale);
  letter-spacing: 0.02em;
}
.vb-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(197,163,85,0.25);
  color: rgba(197,163,85,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}
.vb-close:hover { background: rgba(255,255,255,0.12); color: var(--gold-pale); }

/* ── ORB ──────────────────────────────────────────────────────── */
.vb-orb-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 8px auto 0;
  flex-shrink: 0;
}
#vbOrbCanvas {
  width: 160px;
  height: 160px;
  position: absolute;
  top: 0; left: 0;
}

/* ── SESSION ENDED — collapse orb area when voice session stops ── */
.vb-modal.vb-session-done .vb-orb-wrap,
.vb-modal.vb-session-done .vb-status,
.vb-modal.vb-session-done .vb-controls { display: none; }

/* ── STATUS LABEL ─────────────────────────────────────────────── */
.vb-status {
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(237,216,154,0.6);
  text-align: center;
  min-height: 18px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  transition: color 0.3s;
}

/* ── CONTROLS ─────────────────────────────────────────────────── */
.vb-controls {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  flex-shrink: 0;
}
.vb-ctrl {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(197,163,85,0.2);
  color: rgba(197,163,85,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.vb-ctrl svg { width: 18px; height: 18px; }
.vb-ctrl:hover { background: rgba(255,255,255,0.1); color: var(--gold-pale); border-color: rgba(197,163,85,0.5); }
.vb-ctrl.vb-ctrl--active {
  background: rgba(192,57,43,0.2);
  border-color: rgba(192,57,43,0.4);
  color: #E07060;
}

/* ── TRANSCRIPT ───────────────────────────────────────────────── */
.vb-tx-panel {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 0;
  flex-shrink: 0;
}
.vb-tx-panel.vb-tx-open {
  max-height: 160px;
  margin-top: 12px;
}
.vb-transcript {
  height: 100%;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(197,163,85,0.2) transparent;
}
.vb-msg { display: flex; flex-direction: column; gap: 2px; }
.vb-msg--user { align-items: flex-end; }
.vb-msg--ai   { align-items: flex-start; }
.vb-msg__lbl {
  font-size: 0.65rem;
  color: rgba(197,163,85,0.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 4px;
}
.vb-msg__bub {
  max-width: 88%;
  padding: 7px 11px;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 10px;
  font-family: var(--font-body);
}
.vb-msg--user .vb-msg__bub {
  background: rgba(197,163,85,0.15);
  border: 1px solid rgba(197,163,85,0.25);
  color: var(--gold-pale);
  border-radius: 10px 10px 3px 10px;
}
.vb-msg--ai .vb-msg__bub {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(237,216,154,0.85);
  border-radius: 10px 10px 10px 3px;
}

/* ── BOOKING CARD ─────────────────────────────────────────────── */
.vb-booking-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(197,163,85,0.3);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
  flex-shrink: 0;
  animation: vb-card-in 0.4s ease;
}
@keyframes vb-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vb-booking-card__eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
}
.vb-booking-card__row {
  font-size: 0.82rem;
  color: rgba(237,216,154,0.8);
  line-height: 1.6;
  font-family: var(--font-body);
}
.vb-booking-card__row strong { color: var(--gold-pale); }
.vb-booking-card__sent {
  font-size: 0.75rem;
  color: rgba(197,163,85,0.6);
  margin-top: 8px;
  font-family: var(--font-body);
}
.vb-booking-card__wa {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.2s;
}
.vb-booking-card__wa:hover { opacity: 0.88; }
.vb-booking-card__wa svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── FALLBACK / ERROR ─────────────────────────────────────────── */
.vb-fallback {
  text-align: center;
  margin-top: 16px;
  font-size: 0.78rem;
  color: rgba(197,163,85,0.5);
  flex-shrink: 0;
}
.vb-fallback a { color: rgba(197,163,85,0.75); text-decoration: underline; }

/* ── DESKTOP OVERRIDE ─────────────────────────────────────────── */
@media (min-width: 640px) {
  .vb-modal {
    left: auto;
    right: 2rem;
    bottom: calc(2rem + 56px + 12px + 50px + 12px);
    width: 340px;
    border-radius: 16px;
    max-height: 540px;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }
  .vb-modal.vb-open {
    transform: translateY(0);
    opacity: 1;
  }
  .vb-overlay {
    background: transparent;
  }
  .vb-handle { display: none; }
}

/* ── RESPONSIVE FLOAT ─────────────────────────────────────────── */
@media (max-width: 639px) {
  .vb-float {
    bottom: calc(1.25rem + 50px + 10px);
    right: 1.25rem;
    width: 44px;
    height: 44px;
  }
  .vb-float svg { width: 19px; height: 19px; }
  .vb-orb-wrap, #vbOrbCanvas { width: 140px; height: 140px; }
}
