/* ==========================================
   AI ASSISTANT & WEATHER CHATBOT STYLES
   ========================================== */

.ai-chat {
  margin-top: 36px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.chat-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.chat-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

body.dark-mode .chat-status-pill {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.chat-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
}

.chat-messages {
  height: 280px;
  overflow-y: auto;
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
  animation: messageFadeIn 0.25s ease-out;
}

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

.chat-user {
  align-self: flex-end;
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.chat-assistant {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

#userInput {
  flex: 1;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#userInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

#userInput::placeholder {
  color: var(--text-muted);
}

#sendButton {
  padding: 12px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

#sendButton:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--accent-shadow);
}

#sendButton:active:not(:disabled) {
  transform: translateY(0);
}

#sendButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-status {
  min-height: 20px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.chat-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .ai-chat {
    padding: 18px;
  }
  .chat-messages {
    height: 240px;
  }
  .chat-controls {
    flex-direction: column;
    align-items: stretch;
  }
  #sendButton {
    width: 100%;
  }
}