/* =============================================
   CHATBOT WIDGET STYLES — Light Theme
   Extracted modular CSS for chatbot widget
   Dependencies: base.css (CSS variables)
   ============================================= */

.chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  font-family: var(--font-main);
}

.chatbot-toggle {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  border: none;
  color: white;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 16px 48px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-toggle:hover {
  transform: translateY(-3px) scale(1.07);
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.35), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.chatbot-toggle:active {
  transform: translateY(-1px) scale(0.98);
}

.chatbot-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 440px;
  height: 640px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 28px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
  display: none;
  flex-direction: column;
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

@media (max-width: 600px) {
  .chatbot-panel {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chatbot-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  gap: 12px;
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.chatbot-title::before {
  content: '✦';
  color: #3b82f6;
  font-size: 13px;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #10b981;
  font-weight: 500;
  margin-left: auto;
}

.chatbot-status::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.chatbot-close {
  background: rgba(107, 114, 128, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-close:hover {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-primary);
  transform: scale(1.08);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: var(--border-dark);
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: messageSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user .chat-message-avatar {
  order: 2;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  color: white;
}

.chat-message.assistant .chat-message-avatar {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  color: white;
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  gap: 4px;
}

.chat-message.user .message-wrapper {
  align-items: flex-end;
}

.chat-message.assistant .message-wrapper {
  align-items: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  color: white;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.chat-message.assistant .message-content {
  background: #f3f4f6;
  color: var(--text-primary);
  border-radius: 6px 18px 18px 18px;
  border: 1px solid rgba(229, 231, 235, 0.6);
}

.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: #f3f4f6;
  border-radius: 18px;
  width: fit-content;
  border: 1px solid rgba(229, 231, 235, 0.6);
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.chatbot-input-form {
  padding: 16px;
  border-top: 1px solid rgba(229, 231, 235, 0.5);
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.chatbot-input-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid rgba(229, 231, 235, 0.8);
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-input-form input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), inset 0 0 0 1px rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 0.99);
}

.chatbot-input-form input::placeholder {
  color: #9ca3af;
}

.chat-send-btn {
  padding: 11px 18px;
  background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
}

.chat-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.chat-send-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
