/* Asistente IA — widget flotante (RF-IA). Paleta de marca EntrePatas. */
:root {
  --ep-cafe: #4B1E0E;
  --ep-peru: #CE8744;
  --ep-arena: #E8D7C4;
  --ep-viridian: #496C65;
}

#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ep-cafe) 0%, var(--ep-peru) 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(75, 30, 14, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(75, 30, 14, 0.4);
}

.chatbot-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: ep-slideUp 0.3s ease;
}

.chatbot-window.active {
  display: flex;
}

@keyframes ep-slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
  background: linear-gradient(135deg, var(--ep-cafe) 0%, var(--ep-peru) 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h6 { margin: 0; font-weight: 600; }
.chatbot-header small { color: rgba(255, 255, 255, 0.9); font-size: 0.75rem; }

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.chatbot-close:hover { background: rgba(255, 255, 255, 0.2); }

.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #F8F9FA;
}

.chatbot-message {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  animation: ep-fadeIn 0.3s ease;
}

@keyframes ep-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ep-cafe) 0%, var(--ep-peru) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.user-message .message-avatar { background: var(--ep-viridian); order: 1; }

.message-content {
  flex: 1;
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.user-message .message-content { background: var(--ep-arena); text-align: right; }
.message-content p { margin: 0; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; }
.message-content p + p { margin-top: 8px; }

.chatbot-input-container {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #E0E0E0;
  display: flex;
  gap: 12px;
}

.chatbot-input {
  flex: 1;
  border: 2px solid var(--ep-arena);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.chatbot-input:focus { border-color: var(--ep-peru); }

.chatbot-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ep-cafe) 0%, var(--ep-peru) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.chatbot-send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(75, 30, 14, 0.3); }
.chatbot-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chatbot-footer { padding: 8px 20px; background: #F8F9FA; border-top: 1px solid #E0E0E0; text-align: center; }
.chatbot-footer small { font-size: 0.75rem; color: #6C757D; }

@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 120px);
    bottom: 90px;
    right: 20px;
  }
}
