/* ============ AI CHATBOT ============ */
.chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 90;
  width: 60px;
  height: 60px;
  border-radius: 99px;
  background: var(--grad);
  color: #1a0800;
  display: grid;
  place-items: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 107, 44, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  border: none;
}

.chatbot-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(255, 107, 44, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chatbot-toggle .pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 99px;
  border: 2px solid rgba(255, 107, 44, 0.6);
  animation: pulseRing 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.4; }
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  z-index: 90;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  border-radius: 24px;
  background: rgba(15, 15, 19, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}

.chatbot-window.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 480px) {
  .chatbot-window {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 90px;
  }
  .chatbot-toggle {
    right: 15px;
    bottom: 20px;
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
}

/* Chat Header */
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 107, 44, 0.12), transparent);
}

.chatbot-header .bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 99px;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #1a0800;
  box-shadow: var(--glow);
  flex-shrink: 0;
}

.chatbot-header .bot-info {
  flex: 1;
}

.chatbot-header .bot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-header .bot-name .online-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #22c55e;
  animation: pulse 1.6s ease-in-out infinite;
}

.chatbot-header .bot-status {
  font-size: 12px;
  color: var(--muted);
}

.chatbot-header .close-btn {
  width: 32px;
  height: 32px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chatbot-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 44, 0.3);
  border-radius: 99px;
}

/* Message bubbles */
.msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  animation: msgIn 0.3s ease-out;
  word-wrap: break-word;
}

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

.msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
  color: var(--text);
}

.msg.user {
  align-self: flex-end;
  background: var(--grad);
  color: #1a0800;
  border-bottom-right-radius: 6px;
  font-weight: 500;
}

.msg.bot .msg-time {
  display: block;
  font-size: 10px;
  color: var(--dim);
  margin-top: 4px;
}

/* Typing indicator */
.typing-indicator {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  padding: 14px 16px;
  display: flex;
  gap: 6px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Quick suggestion chips */
.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.chatbot-chips .chip-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 107, 44, 0.08);
  border: 1px solid rgba(255, 107, 44, 0.25);
  color: var(--accent-3);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.chatbot-chips .chip-btn:hover {
  background: rgba(255, 107, 44, 0.15);
  border-color: rgba(255, 107, 44, 0.5);
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: rgba(255, 107, 44, 0.5);
}

.chatbot-input::placeholder {
  color: var(--dim);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 99px;
  background: var(--grad);
  color: #1a0800;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 107, 44, 0.4);
}