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

.chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: all 0.4s ease;
  box-shadow: 0 5px 30px rgba(230, 57, 70, 0.4);
}
.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 40px rgba(230, 57, 70, 0.6);
}
.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  color: white;
}
.chatbot-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--red-primary);
  opacity: 0;
  animation: chatPulse 2s infinite;
}
@keyframes chatPulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.8); opacity: 0; }
}

.chatbot-panel {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 400px;
  max-height: 550px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(230, 57, 70, 0.1);
  overflow: hidden;
}
.chatbot-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.1), transparent);
  border-bottom: 1px solid var(--glass-border);
}
.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chatbot-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.chatbot-avatar svg {
  width: 20px;
  height: 20px;
}
.chatbot-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.chatbot-subtitle {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--red-primary);
  letter-spacing: 1px;
}
.chatbot-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}
.chatbot-close:hover {
  color: var(--red-primary);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 380px;
  scrollbar-width: thin;
  scrollbar-color: var(--red-primary) transparent;
}

.chat-message {
  max-width: 85%;
  animation: messageIn 0.3s ease;
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.bot-message {
  align-self: flex-start;
}
.user-message {
  align-self: flex-end;
}
.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.bot-message .message-content {
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.15);
  color: var(--text-secondary);
  border-top-left-radius: 0;
}
.user-message .message-content {
  background: var(--red-primary);
  color: white;
  border-bottom-right-radius: 0;
}
.message-content p {
  margin: 0;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--red-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chatbot-input-container {
  display: flex;
  padding: 15px 20px;
  border-top: 1px solid var(--glass-border);
  gap: 10px;
}
.chatbot-input {
  flex: 1;
  padding: 12px 15px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.chatbot-input:focus {
  border-color: var(--red-primary);
}
.chatbot-input::placeholder {
  color: var(--text-muted);
}
.chatbot-send {
  width: 42px;
  height: 42px;
  background: var(--red-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.chatbot-send:hover {
  background: var(--red-glow);
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.4);
}
.chatbot-send svg {
  width: 18px;
  height: 18px;
  color: white;
}

@media (max-width: 480px) {
  .chatbot-panel {
    width: calc(100% - 20px);
    right: 10px;
    bottom: 90px;
    max-height: 70vh;
  }
}


.chatbot-language {
  margin-top: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.chatbot-input:focus-visible, .chatbot-send:focus-visible, .chatbot-close:focus-visible, .chatbot-toggle:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 3px;
}
.chatbot-send:disabled { opacity: 0.55; cursor: wait; }
@media (prefers-reduced-motion: reduce) {
  .chatbot-panel, .chat-message, .chatbot-toggle, .chatbot-pulse { animation: none !important; transition: none !important; }
  .chatbot-pulse { display: none; }
}
