/* ==========================================================================
   EuskoLabs — Charly AI Agent Omnichannel Widget (voice-bot.css)
   Dark Obsidian Glassmorphism, Dual Glow (Emerald & Gold) & Omnichannel Hub
   ========================================================================== */

:root {
  --charly-emerald: #10b981;
  --charly-emerald-glow: rgba(16, 185, 129, 0.4);
  --charly-gold: #f59e0b;
  --charly-gold-glow: rgba(245, 158, 11, 0.4);
  --charly-cyan: #06b6d4;
  --charly-telegram: #229ed9;
  --charly-whatsapp: #25d366;
  --charly-bg-glass: rgba(10, 13, 18, 0.94);
  --charly-border: rgba(255, 255, 255, 0.12);
  --charly-text: #f8fafc;
  --charly-muted: #94a3b8;
}

/* 1. FLOATING LAUNCH BUTTON */
.voice-widget-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  background: var(--charly-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 40px;
  color: var(--charly-text);
  font-family: var(--font-sans, "Plus Jakarta Sans", sans-serif);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.25);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.voice-widget-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--charly-gold);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 158, 11, 0.4);
}

.voice-orb {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--charly-gold), var(--charly-emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--charly-emerald);
  animation: charlyOrbPulse 3s infinite ease-in-out;
}

@keyframes charlyOrbPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.5), 0 0 20px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.85), 0 0 35px rgba(245, 158, 11, 0.6); }
}

.voice-orb-icon {
  width: 16px;
  height: 16px;
  color: #0a0d12;
}

.voice-badge-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--charly-emerald);
  box-shadow: 0 0 8px var(--charly-emerald);
  animation: charlyLivePing 1.5s infinite;
}

@keyframes charlyLivePing {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* 2. OVERLAY MODAL CONSOLE */
.voice-modal {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 100000;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--charly-bg-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.2);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.voice-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.voice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--charly-emerald);
  letter-spacing: 0.5px;
}

.voice-modal-close {
  background: transparent;
  border: none;
  color: var(--charly-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.voice-modal-close:hover {
  color: var(--charly-text);
  background: rgba(255, 255, 255, 0.1);
}

.voice-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
}

/* OMNICHANNEL QUICK ACTIONS (WhatsApp + Telegram) */
.charly-omnichannel-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.charly-omni-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.charly-btn-wa {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.35);
}
.charly-btn-wa:hover {
  background: rgba(37, 211, 102, 0.25);
  transform: translateY(-1px);
}

.charly-btn-tg {
  background: rgba(34, 158, 217, 0.15);
  color: #229ed9;
  border-color: rgba(34, 158, 217, 0.35);
}
.charly-btn-tg:hover {
  background: rgba(34, 158, 217, 0.25);
  transform: translateY(-1px);
}

/* WAVEFORM CANVAS */
.voice-wave-container {
  position: relative;
  width: 100%;
  height: 64px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-status-tag {
  position: absolute;
  top: 6px;
  left: 10px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.68rem;
  color: var(--charly-emerald);
  letter-spacing: 1px;
}

#voice-waveform-canvas {
  width: 100%;
  height: 100%;
}

/* CONTROLS */
.voice-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-mic-main-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--charly-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.voice-mic-main-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: scale(1.05);
}

.voice-mic-main-btn.listening {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--charly-gold);
  color: var(--charly-gold);
  animation: charlyMicPulse 1s infinite alternate;
}

@keyframes charlyMicPulse {
  from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
  to { box-shadow: 0 0 20px rgba(245, 158, 11, 0.8); }
}

.voice-phone-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}

.voice-phone-input:focus {
  border-color: var(--charly-emerald);
}

.voice-phone-submit {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: var(--charly-emerald);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-phone-submit:hover {
  background: var(--charly-emerald);
  color: #0a0d12;
}

/* QUICK CHIPS */
.voice-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-chip:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--charly-emerald);
  color: #fff;
}

/* TRANSCRIPT BOX */
.voice-transcript-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--charly-text);
  max-height: 140px;
  overflow-y: auto;
}

.voice-speaker-label {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.voice-speaker-user {
  color: var(--charly-gold);
}

.voice-speaker-ai {
  color: var(--charly-emerald);
}

/* CALL TEST FOOTER */
.voice-phone-tab {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.voice-phone-form {
  display: flex;
  gap: 6px;
}

/* COMPLIANCE EU AI ACT ART. 50 BANNER */
.charly-compliance-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.68rem;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  color: #38bdf8;
  line-height: 1.3;
}

.charly-compliance-badge svg {
  flex-shrink: 0;
}

.charly-legal-footer {
  font-size: 0.65rem;
  color: var(--charly-muted);
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
