/* ════════════════════════════════════════════════
   MAYA VOICE + CHAT AGENT — smart-agent.css
   Chat-bubble design: text primary, mic secondary
   ════════════════════════════════════════════════ */

/* ── Floating trigger button ── */
#hdb-voice-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 99998;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f2460 0%, #29b6d6 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(15,36,96,0.40);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
  padding: 0;
}
#hdb-voice-btn:hover { transform: scale(1.06); box-shadow: 0 12px 40px rgba(15,36,96,0.50); }
#hdb-voice-btn.active { transform: scale(0.95); }
#hdb-voice-btn img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
}

/* ── Panel ── */
#hdb-voice-panel {
  position: fixed;
  bottom: 104px;
  right: 24px;
  z-index: 99999;
  width: 340px;
  height: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15,36,96,0.22), 0 4px 16px rgba(15,36,96,0.10);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#hdb-voice-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
.hdb-vp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #0f2460 0%, #1a3a8a 100%);
  color: #fff;
  flex-shrink: 0;
}
.hdb-vp-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
}
.hdb-vp-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}
.hdb-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #0f2460;
}
.hdb-vp-info { flex: 1; min-width: 0; }
.hdb-vp-name { margin: 0; font-size: 14px; font-weight: 700; color: #fff; }
.hdb-vp-role { margin: 1px 0 0; font-size: 10px; color: rgba(255,255,255,0.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Language toggle */
.hdb-lang-toggle {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.hdb-lang-en, .hdb-lang-es { display: flex; align-items: center; gap: 3px; opacity: 0.55; transition: opacity 0.15s; }
.hdb-lang-en.active, .hdb-lang-es.active { opacity: 1; }
.hdb-lang-divider { opacity: 0.4; font-size: 10px; }
.hdb-flag { width: 14px; height: 14px; border-radius: 2px; object-fit: cover; }
.hdb-lang-label { font-size: 10px; }

/* Close button */
.hdb-vp-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.hdb-vp-close:active { background: rgba(255,255,255,0.3); }

/* ── Chat messages area ── */
.hdb-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}
.hdb-chat-messages::-webkit-scrollbar { width: 4px; }
.hdb-chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Chat bubbles */
.hdb-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: hdb-bubble-in 0.2s ease;
}
@keyframes hdb-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hdb-bubble-maya {
  background: linear-gradient(135deg, #0f2460, #1a3a8a);
  color: #fff;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.hdb-bubble-user {
  background: #29b6d6;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Typing indicator */
.hdb-chat-typing {
  align-self: flex-start;
  background: linear-gradient(135deg, #0f2460, #1a3a8a);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.hdb-chat-typing span {
  width: 7px;
  height: 7px;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  animation: hdb-typing-dot 1.2s ease infinite;
}
.hdb-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.hdb-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes hdb-typing-dot {
  0%,60%,100% { transform: translateY(0); opacity: 0.5; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* ── Input row ── */
.hdb-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Mic button — small, secondary */
.hdb-chat-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hdb-chat-mic-btn:hover { background: #e2e8f0; }
.hdb-chat-mic-btn.listening {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  animation: hdb-mic-pulse 1s ease infinite;
}
.hdb-chat-mic-btn.ready {
  background: #29b6d6;
  border-color: #29b6d6;
  color: #fff;
}
@keyframes hdb-mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Text input */
.hdb-chat-input {
  flex: 1;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}
.hdb-chat-input::placeholder { color: #94a3b8; }
.hdb-chat-input:focus { border-color: #29b6d6; background: #fff; }

/* Send button */
.hdb-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f2460, #29b6d6);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hdb-chat-send-btn:active { opacity: 0.8; transform: scale(0.95); }

/* Booking card inside chat */
.hdb-booking-card {
  background: linear-gradient(135deg, #0f2460 0%, #1a3a8a 60%, #29b6d6 100%);
  border-radius: 16px;
  padding: 18px 16px;
  color: #fff;
  margin: 4px 0;
  animation: hdb-bubble-in 0.3s ease;
}
.hdb-bc-check { font-size: 22px; margin-bottom: 6px; }
.hdb-bc-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; opacity: 0.9; }
.hdb-bc-name { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.hdb-bc-row { font-size: 12px; margin-bottom: 6px; display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.hdb-bc-email-note { font-size: 11px; opacity: 0.7; margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 8px; }
.hdb-bc-shine { display: none; }

/* Wave (keep for compat) */
.hdb-vp-wave { display: none; }
.hdb-vp-status { display: none; }
.hdb-vp-transcript { display: none; }
.hdb-vp-mic-hint { display: none; }
.hdb-vp-footer { display: none; }
.hdb-vp-controls { display: none; }
.hdb-vp-text-row { display: none; }

/* ── Mobile full-screen ── */
@media (max-width: 480px) {
  #hdb-voice-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 75vh;
    border-radius: 20px 20px 0 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  #hdb-voice-btn {
    right: 16px;
    bottom: 20px;
  }
  .hdb-chat-input { font-size: 16px; } /* prevent iOS zoom */
}

/* ── Suggestion chips ── */
.hdb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px 0 8px;
  align-self: flex-start;
  width: 100%;
}
.hdb-chip {
  background: #fff;
  border: 1.5px solid #29b6d6;
  color: #0f2460;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.hdb-chip:hover, .hdb-chip:active { background: #29b6d6; color: #fff; }
