/* ===================== CHAT STYLES ===================== */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--green-500) 0%, var(--green-100) 100%);
  height: 100vh;
  overflow: hidden;
}

/* ===================== CONTENEDOR PRINCIPAL ===================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(22, 56, 50, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* ===================== HEADER ===================== */
.chat-header {
  background: linear-gradient(135deg, var(--teal-100), var(--green-100));
  padding: 20px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(13, 124, 102, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bot-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--green-50), var(--green-300));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(13, 124, 102, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.bot-info h2 {
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--alert-green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.chat-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* ===================== ÁREA DE MENSAJES ===================== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  background: 
    radial-gradient(circle at 20% 50%, rgba(13, 124, 102, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(47, 111, 79, 0.08) 0%, transparent 50%);
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(13, 124, 102, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--teal-100);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--teal-200);
}

/* ===================== MENSAJE ===================== */
.message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.message.bot .message-avatar {
  background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
  color: var(--white);
}

.message.user .message-avatar {
  background: linear-gradient(135deg, var(--green-50), var(--green-300));
  color: var(--gray-900);
}

.message-content {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.message-bubble {
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.95rem;
  word-wrap: break-word;
}

.message.bot .message-bubble {
  background: rgba(13, 124, 102, 0.2);
  color: var(--white);
  border: 1px solid rgba(13, 124, 102, 0.3);
  border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 5px;
}

.message.user .message-time {
  text-align: right;
}

/* ===================== TYPING INDICATOR ===================== */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.typing-indicator.show {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: rgba(13, 124, 102, 0.2);
  border: 1px solid rgba(13, 124, 102, 0.3);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--teal-200);
  border-radius: 50%;
  animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ===================== BOTONES DE SUGERENCIA ===================== */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.suggestion-btn {
  background: rgba(13, 124, 102, 0.15);
  border: 1px solid rgba(13, 124, 102, 0.4);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.suggestion-btn:hover {
  background: rgba(13, 124, 102, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(13, 124, 102, 0.3);
}

/* ===================== ENTRADA DE MENSAJE ===================== */
.chat-input-container {
  padding: 20px 25px;
  background: rgba(22, 56, 50, 0.9);
  border-top: 2px solid rgba(13, 124, 102, 0.3);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-group {
  flex: 1;
  position: relative;
}

#messageInput {
  width: 100%;
  padding: 14px 50px 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(13, 124, 102, 0.3);
  border-radius: 25px;
  color: var(--white);
  font-size: 0.95rem;
  resize: none;
  max-height: 120px;
  font-family: inherit;
  transition: all 0.3s;
}

#messageInput:focus {
  outline: none;
  border-color: var(--teal-200);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 15px rgba(13, 124, 102, 0.2);
}

#messageInput::placeholder {
  color: rgba(168, 213, 186, 0.5);
}

.emoji-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--green-50);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s;
}

.emoji-btn:hover {
  transform: translateY(-50%) scale(1.2);
}

.send-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(13, 124, 102, 0.3);
}

.send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(13, 124, 102, 0.5);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================== MENSAJE DE BIENVENIDA ===================== */
.welcome-message {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.9);
}

.welcome-message h3 {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.welcome-message p {
  font-size: 0.95rem;
  margin-bottom: 25px;
  line-height: 1.6;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.quick-action-card {
  background: rgba(13, 124, 102, 0.15);
  border: 1px solid rgba(13, 124, 102, 0.3);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.quick-action-card:hover {
  background: rgba(13, 124, 102, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(13, 124, 102, 0.3);
}

.quick-action-card i {
  font-size: 1.8rem;
  color: var(--teal-200);
  margin-bottom: 10px;
  display: block;
}

.quick-action-card h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 6px;
}

.quick-action-card p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .chat-header {
    padding: 15px 18px;
  }

  .bot-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .bot-info h2 {
    font-size: 1.1rem;
  }

  .chat-messages {
    padding: 18px;
  }

  .message-content {
    max-width: 80%;
  }

  .message-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .chat-input-container {
    padding: 15px 18px;
  }

  #messageInput {
    padding: 12px 45px 12px 15px;
    font-size: 0.9rem;
  }

  .send-btn {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }
}