/* AI Chatbot Styles */
:root {
  --chat-bg: rgba(10, 12, 20, 0.95);
  --chat-border: rgba(255, 255, 255, 0.1);
  --chat-user-bg: #10b981;
  --chat-ai-bg: rgba(255, 255, 255, 0.06);
}

/* Floating Chat Trigger Button */
.ai-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 80px; /* Offset to not overlap with the background change button */
  width: 50px;
  height: 50px;
  border-radius: 50px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  background: var(--glass-hover-bg);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Chat Window Panel */
.ai-chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 520px;
  border-radius: 20px;
  background: var(--chat-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--chat-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.ai-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981; /* Green status dot */
}

.ai-chat-header-info h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.ai-chat-header-actions {
  display: flex;
  gap: 12px;
}

.ai-chat-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  transition: color 0.2s;
}

.ai-chat-action-btn:hover {
  color: #fff;
}

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

/* Fallback Warning Box */
.ai-chat-fallback-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px dashed rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  color: #ff9494;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
}

/* Message Bubbles */
.ai-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.ai-message.user {
  align-self: flex-end;
  background: var(--chat-user-bg);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.ai-message.ai {
  align-self: flex-start;
  background: var(--chat-ai-bg);
  border: 1px solid var(--chat-border);
  color: #eaeaf0;
  border-bottom-left-radius: 4px;
}

/* Typing / Loading Dots */
.ai-typing-indicator {
  align-self: flex-start;
  background: var(--chat-ai-bg);
  border: 1px solid var(--chat-border);
  padding: 12px 20px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: none;
  align-items: center;
  gap: 4px;
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Input Area */
.ai-chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.01);
}

.ai-chat-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--chat-border);
  border-radius: 99px;
  color: #fff;
  padding: 10px 18px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input-area input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.ai-chat-input-area button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--chat-user-bg);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
}

.ai-chat-input-area button:hover {
  background: #059669;
  transform: scale(1.05);
}

.ai-chat-input-area button:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .ai-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
  }
  .ai-chat-trigger {
    bottom: 16px;
    right: 70px;
  }
}
