/* ===== CHATBOT TOGGLE BUTTON ===== */
.chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 90px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(255, 159, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 159, 0, 0.6);
}

.chatbot-toggle .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #28a745;
  border-radius: 50%;
  border: 2px solid #121212;
}

body.light-mode .chatbot-toggle .badge {
  border-color: #f9f9f9;
}

/* ===== CHAT WINDOW ===== */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 400px;
  height: 560px;
  background: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 159, 0, 0.2);
  animation: chatSlideUp 0.3s ease-out;
}

.chatbot-window.open {
  display: flex;
}

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

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

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

.chatbot-header-info h4 {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chatbot-header-info > span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
}

.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chatbot-close:hover {
  opacity: 1;
}

.chatbot-sound-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.3s;
}

.chatbot-sound-toggle:hover {
  color: #fff;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 159, 0, 0.3);
  border-radius: 4px;
}

/* Message Bubbles */
.chat-message {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-message.bot {
  background: rgba(255, 255, 255, 0.08);
  color: #e6e6e6;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  white-space: normal;
}

.chat-message.user {
  background: linear-gradient(135deg, #ff9f00, #e88e00);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

/* ===== RICH TEXT IN BOT MESSAGES ===== */
.chat-message.bot strong {
  color: #ff9f00;
  font-weight: 700;
}

.chat-message.bot em {
  color: #bbb;
  font-style: italic;
}

.chat-message.bot a {
  color: #ff9f00;
  text-decoration: underline;
  text-decoration-color: rgba(255, 159, 0, 0.3);
}

.chat-message.bot a:hover {
  text-decoration-color: #ff9f00;
}

.chat-message.bot hr {
  border: none;
  border-top: 1px solid rgba(255, 159, 0, 0.2);
  margin: 8px 0;
}

.chat-message.bot ul {
  margin: 4px 0 4px 16px;
  padding: 0;
}

.chat-message.bot li {
  margin-bottom: 2px;
}

/* ===== THINKING INDICATOR ===== */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dots span {
  width: 7px;
  height: 7px;
  background: rgba(255, 159, 0, 0.6);
  border-radius: 50%;
  animation: thinkingBounce 1.4s infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

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

.thinking-text {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

/* ===== SUGGESTION CHIPS ===== */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}

.suggestion-chip {
  padding: 6px 14px;
  background: rgba(255, 159, 0, 0.08);
  border: 1px solid rgba(255, 159, 0, 0.25);
  color: #ff9f00;
  border-radius: 20px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.suggestion-chip:hover {
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

/* Input Area */
.chatbot-input {
  display: flex;
  padding: 12px 16px;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.chatbot-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 10px 16px;
  color: #e6e6e6;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.chatbot-input input:focus {
  border-color: #ff9f00;
}

.chatbot-input input::placeholder {
  color: #777;
}

.chatbot-input button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ff9f00;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chatbot-input button:hover {
  background: #e88e00;
}

/* ===== LIGHT MODE ===== */
body.light-mode .chatbot-window {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

body.light-mode .chat-message.bot {
  background: #f4f4f4;
  color: #333;
}

body.light-mode .chat-message.bot strong {
  color: #e08800;
}

body.light-mode .chat-message.bot em {
  color: #666;
}

body.light-mode .chat-message.bot a {
  color: #e08800;
}

body.light-mode .chat-message.bot hr {
  border-top-color: #e0e0e0;
}

body.light-mode .chatbot-input input {
  background: #f4f4f4;
  border-color: #ddd;
  color: #333;
}

body.light-mode .chatbot-input input::placeholder {
  color: #999;
}

body.light-mode .chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 159, 0, 0.4);
}

body.light-mode .chatbot-input {
  border-top-color: #eee;
}

body.light-mode .suggestion-chip {
  background: rgba(255, 159, 0, 0.05);
  border-color: rgba(255, 159, 0, 0.2);
}

body.light-mode .thinking-indicator {
  background: #f4f4f4;
}

body.light-mode .thinking-text {
  color: #999;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 120px);
    right: 10px;
    bottom: 80px;
    border-radius: 12px;
  }

  .chatbot-toggle {
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
  }

  .suggestion-chip {
    font-size: 0.76rem;
    padding: 8px 14px;
    min-height: 36px;
  }

  .chatbot-toggle {
    right: 16px;
    bottom: 20px;
    width: 50px;
    height: 50px;
  }
}
