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

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

#ie-chatbot {
  --primary: #871017;
  --primary-container: #a82b2b;
  --secondary: #356571;
  --secondary-dark: #1A4D59;
  --gold: #B8860B;
  --gold-light: #D4AF37;
  --dark: #0A0A0A;
  --surface: #fff8f7;
  --surface-subtle: #F8F7F4;
  --surface-high: #fbe3e0;
  --border-color: #e0bfbc;
  --text-dark: #251817;
  --text-muted: #59413f;
  --success: #22c55e;
  --radius-btn: 0.25rem;
  --radius-card: 0.75rem;
  --radius-bubble: 12px;
  --font-heading: 'Hanken Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --fab-size: 56px;
  --panel-width: 380px;
  --panel-height: 520px;
  --z-fab: 9999;
  --z-panel: 9998;
  --transition: 0.3s ease-out;
  font-family: var(--font-body);
}

/* ─── 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: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  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.30);
  transition: transform var(--transition), box-shadow 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);
  animation: iePulse 1.5s ease-in-out infinite;
}

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

@keyframes iePulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(184, 134, 11, 0.30); }
  50% { box-shadow: 0 4px 32px rgba(184, 134, 11, 0.55); }
}

/* ─── 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);
  height: var(--panel-height);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  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;
  animation: ieSlideInUp 0.3s ease-out;
}

@keyframes ieSlideInUp {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ─── HEADER ─── */
#ie-chatbot .ie-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

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

#ie-chatbot .ie-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#ie-chatbot .ie-header-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
}

#ie-chatbot .ie-header-subtitle {
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

#ie-chatbot .ie-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: iePulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes iePulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

#ie-chatbot .ie-header-close:hover {
  color: #ef4444;
  background: rgba(255, 255, 255, 0.08);
}

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

#ie-chatbot .ie-lang-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.50);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: var(--font-body);
  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;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  background: var(--surface);
}

#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(--border-color);
  border-radius: 2px;
}

/* ─── BUBBLES ─── */
#ie-chatbot .ie-bubble {
  max-width: 85%;
  padding: 10px 16px;
  border-radius: var(--radius-bubble);
  font-size: 0.86rem;
  line-height: 1.55;
  font-weight: 400;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: ieFadeIn 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#ie-chatbot .ie-bubble.user {
  align-self: flex-end;
  background: #ffffff;
  color: var(--text-dark);
  border: 1px solid var(--primary-container);
  border-bottom-right-radius: 4px;
}

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

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

#ie-chatbot .ie-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-color);
  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 10px;
}

#ie-chatbot .ie-opt-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--secondary);
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.15s;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
}

#ie-chatbot .ie-opt-btn:hover {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
  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 var(--border-color);
  background: var(--surface);
}

#ie-chatbot .ie-input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  outline: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--text-dark);
  padding: 8px 12px;
  background: var(--surface);
  transition: border-color var(--transition);
}

#ie-chatbot .ie-input:focus {
  border-color: var(--gold);
}

#ie-chatbot .ie-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

#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%;
    height: 80vh;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

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