/* ─── CHATBOT WIDGET — Inspiração Evidente ─── */

#ie-chatbot *,
#ie-chatbot *::before,
#ie-chatbot *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#ie-chatbot {
  --gold: #b8860b;
  --gold-light: #d4a017;
  --gold-pale: #f5edd8;
  --dark: #0a0a0a;
  --text-light: #f3f4f6;
  --text-dark: #1f2937;
  --bg-light: #f8f6f3;
  --bg-card: #ffffff;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Outfit', sans-serif;
  --fab-size: 56px;
  --panel-width: 380px;
  --panel-max-height: 540px;
  --radius: 12px;
  --z-fab: 9999;
  --z-panel: 9998;
  --transition: 0.3s cubic-bezier(.25, .46, .45, .94);
  font-family: var(--font-sans);
}

/* ─── FAB ─── */
#ie-chatbot .ie-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: var(--z-fab);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(184, 134, 11, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

#ie-chatbot .ie-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(184, 134, 11, 0.45);
  background: var(--gold-light);
}

#ie-chatbot .ie-fab:active {
  transform: scale(0.95);
}

/* ─── PANEL ─── */
#ie-chatbot .ie-panel {
  position: fixed;
  bottom: calc(var(--fab-size) + 28px + 16px);
  right: 28px;
  z-index: var(--z-panel);
  width: var(--panel-width);
  max-height: var(--panel-max-height);
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  visibility: hidden;
}

#ie-chatbot .ie-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  visibility: visible;
}

/* ─── HEADER ─── */
#ie-chatbot .ie-header {
  background: var(--dark);
  color: var(--gold);
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ie-chatbot .ie-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#ie-chatbot .ie-header-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

#ie-chatbot .ie-header-status {
  font-size: 0.68rem;
  color: #22c55e;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
}

#ie-chatbot .ie-header-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 18px;
  padding: 2px;
  line-height: 1;
  transition: color var(--transition);
}

#ie-chatbot .ie-header-close:hover {
  color: #fff;
}

/* ─── LANGUAGE SELECTOR ─── */
#ie-chatbot .ie-lang-bar {
  display: flex;
  gap: 4px;
}

#ie-chatbot .ie-lang-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 3px 10px;
  border-radius: 10px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  letter-spacing: 0.03em;
}

#ie-chatbot .ie-lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

#ie-chatbot .ie-lang-btn.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

/* ─── MESSAGES ─── */
#ie-chatbot .ie-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#ie-chatbot .ie-messages::-webkit-scrollbar {
  width: 4px;
}

#ie-chatbot .ie-messages::-webkit-scrollbar-track {
  background: transparent;
}

#ie-chatbot .ie-messages::-webkit-scrollbar-thumb {
  background: var(--gold-light);
  border-radius: 2px;
}

/* ─── BUBBLES ─── */
#ie-chatbot .ie-bubble {
  max-width: 85%;
  padding: 10px 15px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  font-weight: 300;
  word-wrap: break-word;
  animation: ieFadeIn 0.25s ease;
}

#ie-chatbot .ie-bubble.user {
  align-self: flex-end;
  background: var(--gold);
  color: #fff;
  border-bottom-right-radius: 4px;
}

#ie-chatbot .ie-bubble.bot {
  align-self: flex-start;
  background: var(--text-light);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
}

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

/* ─── TYPING ─── */
#ie-chatbot .ie-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
  background: var(--text-light);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

#ie-chatbot .ie-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-400, #9a9890);
  animation: ieTyping 1.2s infinite ease-in-out;
}

#ie-chatbot .ie-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

#ie-chatbot .ie-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ieTyping {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── OPTIONS ─── */
#ie-chatbot .ie-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 16px 8px;
}

#ie-chatbot .ie-opt-btn {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

#ie-chatbot .ie-opt-btn:hover {
  background: var(--gold);
  color: #fff;
  transform: translateY(-1px);
}

#ie-chatbot .ie-opt-btn:active {
  transform: translateY(0);
}

/* ─── INPUT BAR ─── */
#ie-chatbot .ie-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: var(--bg-card);
}

#ie-chatbot .ie-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-dark);
  padding: 8px 0;
  background: transparent;
}

#ie-chatbot .ie-input::placeholder {
  color: #9ca3af;
}

#ie-chatbot .ie-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background var(--transition), transform 0.2s;
}

#ie-chatbot .ie-send-btn:hover {
  background: var(--gold-light);
  transform: scale(1.06);
}

#ie-chatbot .ie-send-btn:active {
  transform: scale(0.95);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  #ie-chatbot .ie-panel {
    width: 100%;
    max-height: 80vh;
    right: 0;
    bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  #ie-chatbot .ie-fab {
    bottom: 20px;
    right: 20px;
  }
}
