/* ============================================================
   CHATBOT WIDGET — Yellow theme, interactive, polished
   ============================================================ */

/* ── Container ──────────────────────────────────────────── */
#chat-widget-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Inter', sans-serif;
}

/* ── Toggle button ──────────────────────────────────────── */
#chat-toggle-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFCC00, #FFD700);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(255, 204, 0, 0.45);
  transition: transform 0.22s cubic-bezier(.2, .9, .2, 1), box-shadow 0.22s;
  position: relative;
}

#chat-toggle-btn svg {
  width: 26px;
  height: 26px;
  color: #000;
}

#chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 36px rgba(255, 204, 0, 0.6);
}

/* Notification badge */
.chat-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff3d3d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
}

/* ── Chat window ────────────────────────────────────────── */
#chat-window {
  display: none;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #0d0d0d;
  border-radius: 18px;
  border: 1px solid rgba(255, 204, 0, 0.18);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 204, 0, 0.06);
  overflow: hidden;
  margin-bottom: 14px;
  animation: chatSlideIn 0.28s cubic-bezier(.2, .9, .2, 1) both;
}

@keyframes chatSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Header ─────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(255, 204, 0, 0.12), rgba(255, 204, 0, 0.04));
  border-bottom: 1px solid rgba(255, 204, 0, 0.1);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFCC00, #FFB800);
  color: #000;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.chat-status {
  font-size: 11px;
  color: #4ade80;
  font-weight: 600;
}

#chat-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
}

#chat-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Messages area ──────────────────────────────────────── */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 204, 0, 0.25);
  border-radius: 4px;
}

/* ── Message bubbles ────────────────────────────────────── */
.message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  animation: msgFadeIn 0.22s ease both;
}

@keyframes msgFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  background: linear-gradient(135deg, #FFCC00, #FFD700);
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.message.bot {
  background: #1a1a1a;
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message.bot strong {
  color: #FFCC00;
  font-weight: 700;
}

/* ── Typing indicator ───────────────────────────────────── */
.typing-indicator {
  padding: 12px 18px !important;
  display: flex !important;
  gap: 5px;
  align-items: center;
  min-width: 52px;
  max-width: 70px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.7);
  display: inline-block;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ── Quick reply chips ──────────────────────────────────── */
#chat-quick-replies {
  padding: 6px 14px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: #0d0d0d;
  min-height: 0;
}

#chat-quick-replies:empty {
  padding: 0;
  border: none;
}

.quick-reply-btn {
  background: transparent;
  border: 1px solid rgba(255, 204, 0, 0.4);
  color: #FFCC00;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.14s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.quick-reply-btn:hover {
  background: rgba(255, 204, 0, 0.12);
  border-color: #FFCC00;
  transform: translateY(-1px);
}

.quick-reply-btn:active {
  transform: scale(0.97);
}

/* ── Input area ─────────────────────────────────────────── */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #111;
}

#chat-input {
  flex: 1;
  background: #1e1e1e;
  border: 1px solid rgba(255, 204, 0, 0.18);
  border-radius: 10px;
  padding: 9px 13px;
  color: #f0f0f0;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.18s;
}

#chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

#chat-input:focus {
  border-color: rgba(255, 204, 0, 0.55);
  background: #1a1a1a;
}

#chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FFCC00, #FFD700);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s, box-shadow 0.18s;
}

#chat-send-btn svg {
  color: #000;
}

#chat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.4);
}

/* ── Mobile adjustments ─────────────────────────────────── */
@media (max-width: 480px) {
  #chat-widget-container {
    bottom: 16px;
    right: 16px;
  }

  #chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
  }
}