/* =========================================
   VARIABLES DE COLOR (Sika Center)
   ========================================= */
:root {
  --sika-primario: #fec31b;   /* Amarillo */
  --sika-secundario: #ed2124; /* Rojo */
  --sika-terciario: #040404;  /* Negro */
  --sika-cuaternario: #ffffff;/* Blanco */
  --sika-fondo-chat: #f8f9fa; /* Gris muy claro para el fondo de mensajes */
}

/* =========================================
   BOTÓN FLOTANTE Y TOOLTIP INTERACTIVO
   ========================================= */
#chatbot-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--sika-primario);
  color: var(--sika-terciario);
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(254, 195, 27, 0.4);
}

/* Tooltip que aparece al pasar el ratón */
#chatbot-toggle::before {
  content: "¡Asesoría en línea!";
  position: absolute;
  right: -140px; /* Aparece a la derecha del botón al estar a la izquierda de la pantalla */
  background: var(--sika-terciario);
  color: var(--sika-cuaternario);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#chatbot-toggle:hover {
  transform: scale(1.05);
  background: var(--sika-terciario);
  color: var(--sika-primario);
  box-shadow: 0 6px 20px rgba(4, 4, 4, 0.3);
}

#chatbot-toggle:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================
   CONTENEDOR PRINCIPAL
   ========================================= */
#chatbot-container {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 350px;
  height: 500px;
  border-radius: 12px; /* Bordes un poco más sutiles, típicos de e-commerce */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--sika-cuaternario);
  box-shadow: 0 10px 30px rgba(4, 4, 4, 0.15); /* Sombra más suave y profesional */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 9999;
  border: 1px solid rgba(0,0,0,0.05);
}

#chatbot-container.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* =========================================
   HEADER
   ========================================= */
#chatbot-header {
  background: var(--sika-terciario);
  color: var(--sika-cuaternario);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  border-bottom: 3px solid var(--sika-secundario); /* Línea de acento rojo corporativo */
}

#close-chat {
  background: transparent;
  border: none;
  color: var(--sika-cuaternario);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  padding: 5px;
  width: 30px;
  height: 30px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-chat:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--sika-primario);
}

/* =========================================
   ÁREA DE MENSAJES
   ========================================= */
#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: var(--sika-fondo-chat);
  scroll-behavior: smooth;
}

#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

/* PANTALLA DE BIENVENIDA */
.welcome-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.6s ease;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-icon {
  font-size: 45px;
  color: var(--sika-primario); /* Icono en amarillo */
  text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.welcome-content h2 {
  margin: 0;
  color: var(--sika-terciario);
  font-size: 1.4rem;
}

.welcome-content p {
  font-weight: bold;
  color: var(--sika-secundario); /* Nombre de la empresa en rojo */
  margin: 0;
}

.welcome-content span {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* BOTONES DE PREGUNTAS RÁPIDAS (Si decides usarlos) */
.quick-btn {
  background: var(--sika-cuaternario);
  border: 1px solid #ddd;
  color: var(--sika-terciario);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.quick-btn:hover {
  background: var(--sika-primario);
  border-color: var(--sika-primario);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(254, 195, 27, 0.2);
}

/* =========================================
   BURBUJAS DE CHAT
   ========================================= */
.user-message {
  background: var(--sika-terciario); /* Negro para el usuario da un toque premium */
  color: var(--sika-cuaternario);
  padding: 12px 15px;
  border-radius: 15px 15px 0 15px;
  margin: 8px 0;
  max-width: 85%;
  margin-left: auto;
  animation: slideInRight 0.3s ease;
  font-size: 0.9rem;
  line-height: 1.4;
}

.bot-message {
  background: var(--sika-cuaternario);
  color: var(--sika-terciario);
  padding: 12px 15px;
  border-radius: 15px 15px 15px 0;
  margin: 8px 0;
  max-width: 85%;
  animation: slideInLeft 0.3s ease;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.03);
}

/* HORA */
.time {
  display: block;
  font-size: 10px;
  opacity: 0.6;
  margin-top: 5px;
  text-align: right;
}

/* FORMATO DEL TEXTO DEL BOT */
.message-content p {
  margin: 0;
}

.message-content strong {
  color: var(--sika-secundario); /* Resalta los nombres de productos o ideas en rojo */
}

.message-content ul {
  padding-left: 18px;
  margin: 8px 0;
}

.message-content li {
  margin-bottom: 4px;
}

/* =========================================
   INPUT Y BOTÓN DE ENVÍO
   ========================================= */
#chatbot-input {
  display: flex;
  padding: 15px;
  background: var(--sika-cuaternario);
  border-top: 1px solid #eee;
}

#chatbot-input input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid #ddd;
  outline: none;
  font-family: inherit;
  transition: 0.2s;
}

#chatbot-input input:focus {
  border-color: var(--sika-primario);
  box-shadow: 0 0 0 3px rgba(254, 195, 27, 0.2);
}

#chatbot-input button {
  margin-left: 8px;
  background: var(--sika-primario);
  color: var(--sika-terciario);
  font-weight: bold;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#chatbot-input button:hover {
  background: var(--sika-terciario);
  color: var(--sika-cuaternario);
}

/* =========================================
   ANIMACIONES
   ========================================= */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

@keyframes slideInLeft {
  from {transform: translateX(-10px); opacity:0;}
  to {transform: translateX(0); opacity:1;}
}

@keyframes slideInRight {
  from {transform: translateX(10px); opacity:0;}
  to {transform: translateX(0); opacity:1;}
}