/* ===== CHATBOT STYLES ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--beige);
  height: 100vh;
  overflow: hidden;
}

.chatbot-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(135deg, #FDF6EC 0%, #FFFFFF 100%);
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--charcoal) 0%, #2D3748 100%);
  color: var(--white);
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chatbot-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chatbot-header .lurnr-logo {
  width: 40px;
  height: 40px;
  background-color: var(--orange);
}

.chatbot-header-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.online-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #10B981;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.chatbot-header-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.api-key-button {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  transition: var(--transition);
}

.api-key-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.close-button {
  background: transparent;
  color: var(--white);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-button:hover {
  opacity: 0.8;
}

/* Chat Message Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease-out;
}

.message.user {
  justify-content: flex-end;
}

.message.bot {
  justify-content: flex-start;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 70%;
}

.message.user .message-content {
  align-items: flex-end;
}

.message.bot .message-content {
  align-items: flex-start;
}

.message-bubble {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-lg);
  word-wrap: break-word;
  line-height: 1.5;
}

.user .message-bubble {
  background-color: var(--orange);
  color: var(--white);
  border-bottom-right-radius: 0;
}

.bot .message-bubble {
  background-color: var(--white);
  color: var(--charcoal);
  box-shadow: var(--shadow-md);
  border-bottom-left-radius: 0;
}

.message-time {
  font-size: 0.75rem;
  color: var(--gray-medium);
  padding: 0 0.5rem;
}

.user .message-time {
  text-align: right;
}

.bot .message-time {
  text-align: left;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.875rem 1.125rem;
}

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

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Quick Reply Chips */
.quick-replies {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.quick-reply-chip {
  background-color: var(--beige);
  color: var(--charcoal);
  border: 1px solid var(--orange);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}

.quick-reply-chip:hover {
  background-color: var(--orange);
  color: var(--white);
}

/* Chat Input Area */
.chat-input-area {
  background-color: var(--white);
  border-top: 1px solid #E5E7EB;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.input-wrapper {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  resize: none;
  max-height: 100px;
  transition: var(--transition);
}

.chat-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.mic-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--beige);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-button:hover {
  background-color: #E8D5B7;
  transform: scale(1.05);
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--orange);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.send-button:hover {
  background-color: #f08700;
  transform: scale(1.05);
}

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

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: scale(1);
}

/* API Key Modal */
.api-key-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.api-key-modal.show {
  display: flex;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-medium);
}

.modal-close:hover {
  color: var(--charcoal);
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-body p {
  color: var(--gray-dark);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.modal-body input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  margin-bottom: 1rem;
}

.modal-body input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions button {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.modal-actions .btn-primary {
  background-color: var(--orange);
  color: var(--white);
}

.modal-actions .btn-primary:hover {
  background-color: #f08700;
}

.modal-actions .btn-secondary {
  background-color: var(--gray-light);
  color: var(--charcoal);
}

.modal-actions .btn-secondary:hover {
  background-color: #E5E7EB;
}

/* Error Message */
.error-message {
  background-color: #FEE2E2;
  color: #DC2626;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-lg);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #f08700;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--gray-dark);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-text {
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .message-content {
    max-width: 85%;
  }

  .chatbot-header {
    padding: 1rem;
  }

  .chatbot-header-brand h1 {
    font-size: 1.1rem;
  }

  .api-key-button {
    display: none;
  }

  .chat-messages {
    padding: 1rem;
    gap: 0.75rem;
  }

  .chat-input-area {
    padding: 0.75rem;
  }

  .modal-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .message-content {
    max-width: 95%;
  }

  .message-bubble {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .chatbot-header-right {
    gap: 0.5rem;
  }

  .chat-input {
    font-size: 0.9rem;
  }

  .send-button,
  .mic-button {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .modal-content {
    max-width: 90%;
    padding: 1.25rem;
  }

  .quick-reply-chip {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}
