/* ═══════════════════════════════════════════════
   AMBASÁDA CHUTI – CHATBOT WIDGET
   Aesthetic: Luxury dark whisky / amber elegance
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Imbue:opsz,wght@10..100,400;10..100,600&family=Inter:wght@300;400;500&display=swap');

:root {
  --chat-amber:      #C6A572;
  --chat-amber-light:#D4B78E;
  --chat-dark:       #000000;
  --chat-panel-bg:   #FAF6EF;
  --chat-border:     #E2D5BE;
  --chat-bot-bubble: #FFFFFF;
  --chat-user-bubble:#000000;
  --chat-text:       #000000;
  --chat-muted:      #8C7355;
  --chat-shadow:     0 20px 60px rgba(28,14,2,0.22), 0 4px 16px rgba(28,14,2,0.12);
  --chat-radius:     18px;
  --chat-width:      360px;
  --chat-height:     520px;
  --font-display:    'Imbue', Georgia, serif;
  --font-body:       'Inter', system-ui, sans-serif;
}

/* ── WIDGET WRAPPER ─────────────────────────────── */
#ambasada-chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  font-family: var(--font-body);
}

/* ── TOGGLE BUTTON ──────────────────────────────── */
#ambasada-chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--chat-amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(198,165,114,0.45), 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
}

#ambasada-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(198,165,114,0.55), 0 2px 12px rgba(0,0,0,0.2);
}

#ambasada-chat-toggle:active {
  transform: scale(0.96);
}

/* ── CHAT PANEL ─────────────────────────────────── */
#ambasada-chat-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: var(--chat-width);
  height: var(--chat-height);
  background: var(--chat-panel-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  border: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chatSlideIn 0.28s cubic-bezier(.16,1,.3,1) both;
}

#ambasada-chat-panel[hidden] {
  display: none !important;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── HEADER ─────────────────────────────────────── */
.chat-header {
  background: var(--chat-dark);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(198,165,114,0.2);
  border: 1.5px solid rgba(198,165,114,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.chat-header-info strong {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: #F5ECD6;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.chat-header-info span {
  font-size: 11px;
  color: var(--chat-amber-light);
  font-weight: 300;
  letter-spacing: 0.5px;
  font-family: var(--font-body);
}

/* ── MESSAGES AREA ──────────────────────────────── */
#ambasada-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#ambasada-chat-messages::-webkit-scrollbar { width: 4px; }
#ambasada-chat-messages::-webkit-scrollbar-track { background: transparent; }
#ambasada-chat-messages::-webkit-scrollbar-thumb { background: var(--chat-border); border-radius: 4px; }

/* ── MESSAGE BUBBLES ────────────────────────────── */
.chat-msg {
  display: flex;
  animation: msgFadeIn 0.22s ease both;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot  { justify-content: flex-start; }
.chat-msg.user { justify-content: flex-end; }

.msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--chat-text);
  font-family: var(--font-body);
}

.chat-msg.bot .msg-bubble {
  background: var(--chat-bot-bubble);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chat-msg.user .msg-bubble {
  background: var(--chat-user-bubble);
  color: #F5ECD6;
  border-bottom-right-radius: 4px;
}

/* Markdown-like formatting in bubbles */
.msg-bubble strong { font-weight: 600; }
.msg-bubble ul { margin: 6px 0 4px 0; padding-left: 16px; }
.msg-bubble li { margin-bottom: 3px; }
.msg-bubble a { color: var(--chat-amber); text-decoration: underline; }

/* ── TYPING INDICATOR ───────────────────────────── */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  background: var(--chat-bot-bubble);
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chat-typing span {
  width: 7px;
  height: 7px;
  background: var(--chat-amber);
  border-radius: 50%;
  animation: typingDot 1.2s ease infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── INPUT AREA ─────────────────────────────────── */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--chat-border);
  background: #FFFDF8;
  flex-shrink: 0;
}

#ambasada-chat-input {
  flex: 1;
  border: 1.5px solid var(--chat-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--chat-text);
  background: #fff;
  resize: none;
  outline: none;
  transition: border-color 0.18s;
  max-height: 100px;
  overflow-y: auto;
  line-height: 1.5;
}

#ambasada-chat-input:focus {
  border-color: var(--chat-amber);
  box-shadow: 0 0 0 3px rgba(198,165,114,0.18);
}

#ambasada-chat-input::placeholder { color: var(--chat-muted); }

#ambasada-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--chat-amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s;
  flex-shrink: 0;
}

#ambasada-chat-send:hover  { transform: scale(1.08); }
#ambasada-chat-send:active { transform: scale(0.94); }
#ambasada-chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── FOOTER NOTE ────────────────────────────────── */
.chat-footer-note {
  text-align: center;
  font-size: 10.5px;
  color: var(--chat-muted);
  padding: 5px 14px 8px;
  background: #FFFDF8;
  flex-shrink: 0;
  font-family: var(--font-body);
}

.chat-footer-note a {
  color: var(--chat-amber);
  text-decoration: none;
}

/* ── MOBILE ─────────────────────────────────────── */
@media (max-width: 480px) {
  #ambasada-chat-widget { bottom: 16px; right: 16px; }
  #ambasada-chat-panel  {
    width: calc(100vw - 32px);
    right: -16px;
    height: 75vh;
    bottom: 68px;
  }
}
