/* ==========================================
   AI ASSISTANT WIDGET STYLES
   ========================================== */

#ai-assistant-container {
  --ai-primary: #10b981;
  --ai-primary-dark: #059669;
  --ai-bg: #ffffff;
  --ai-border: #e5e7eb;
  --ai-text: #1f2937;
  --ai-text-light: #6b7280;
  --ai-bot-bg: #f3f4f6;
}

body.light-mode #ai-assistant-container {
  --ai-bg: #ffffff;
  --ai-bot-bg: #f3f4f6;
  --ai-text: #1f2937;
}

body.dark-mode #ai-assistant-container {
  --ai-bg: #1f2937;
  --ai-bot-bg: #374151;
  --ai-border: #4b5563;
  --ai-text: #f9fafb;
  --ai-text-light: #d1d5db;
}

/* Bubble Button */
.ai-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-dark) 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  transition: all 0.3s ease, transform 0.2s ease;
  z-index: 999;
}

.ai-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.4);
}

.ai-bubble:active {
  transform: scale(0.95);
}

.ai-bubble.hidden {
  display: none;
}

.ai-bubble svg {
  width: 24px;
  height: 24px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Chat Window */
.ai-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  background: var(--ai-bg);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid var(--ai-border);
}

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

/* Header */
.ai-chat-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-dark) 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.ai-logo {
  font-size: 18px;
}

.ai-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.ai-messages::-webkit-scrollbar {
  width: 6px;
}

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

.ai-messages::-webkit-scrollbar-thumb {
  background: var(--ai-border);
  border-radius: 3px;
}

.ai-messages::-webkit-scrollbar-thumb:hover {
  background: var(--ai-text-light);
}

/* Message Styles */
.ai-message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 85%;
  word-wrap: break-word;
  animation: slideInUp 0.3s ease;
}

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

.bot-message {
  align-self: flex-start;
  background: var(--ai-bot-bg);
  color: var(--ai-text);
  border: 1px solid var(--ai-border);
}

.user-message {
  align-self: flex-end;
  background: var(--ai-primary);
  color: white;
}

/* Input Area */
.ai-input-area {
  padding: 12px;
  border-top: 1px solid var(--ai-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Quick Buttons */
.ai-quick-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.ai-quick-btn {
  background: var(--ai-bot-bg);
  border: 1px solid var(--ai-border);
  color: var(--ai-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.ai-quick-btn:hover {
  background: var(--ai-primary);
  color: white;
  border-color: var(--ai-primary);
}

.ai-quick-btn:active {
  transform: scale(0.98);
}

/* Input Row */
.ai-input-row {
  display: flex;
  gap: 8px;
}

.ai-input {
  flex: 1;
  border: 1px solid var(--ai-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--ai-bg);
  color: var(--ai-text);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-input:focus {
  outline: none;
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.ai-input::placeholder {
  color: var(--ai-text-light);
}

.ai-send-btn {
  width: 32px;
  height: 32px;
  background: var(--ai-primary);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-send-btn:hover {
  background: var(--ai-primary-dark);
}

.ai-send-btn:active {
  transform: scale(0.95);
}

.ai-send-btn svg {
  width: 16px;
  height: 16px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .ai-chat-window {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .ai-bubble {
    bottom: 16px;
    right: 16px;
  }

  .ai-message {
    max-width: 90%;
  }
}

/* Scrollbar Styling */
.ai-quick-buttons::-webkit-scrollbar {
  width: 4px;
}

.ai-quick-buttons::-webkit-scrollbar-thumb {
  background: var(--ai-border);
  border-radius: 2px;
}

/* Dark Mode Specific */
body.dark-mode .ai-message.bot-message {
  background: var(--ai-bot-bg);
  border-color: var(--ai-border);
}

body.dark-mode .ai-input {
  background: #111827;
  border-color: var(--ai-border);
}

body.dark-mode .ai-quick-btn {
  background: var(--ai-bot-bg);
  border-color: var(--ai-border);
}
