/* ===== ASISTENTE IA — chat-assistant.css ===== */

/* Wrapper reloj + botón robot (columna) */
.chat-clock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Botón robot debajo del reloj */
.chat-btn-robot {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.30);
  color: white;
  border-radius: 10px;
  width: 36px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
  line-height: 1;
}
.chat-btn-robot:hover  { background: rgba(255,255,255,0.28); }
.chat-btn-robot:active { transform: scale(0.93); }

/* Overlay fondo */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 16, 60, 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 8000;
  animation: chatOverlayIn 0.18s ease both;
}
.chat-overlay.oculto { display: none; }
@keyframes chatOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Panel principal */
.chat-panel {
  background: var(--color-fondo, #F5F3FF);
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 680px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(59,31,168,0.28), 0 0 0 1px rgba(91,63,228,0.12);
  overflow: hidden;
  animation: chatPanelIn 0.26s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes chatPanelIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Cabecera */
.chat-cabecera {
  background: linear-gradient(135deg, #3B1FA8 0%, #5B3FE4 55%, #7B5BFF 100%);
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.chat-titulo span:first-child { font-size: 18px; }
.chat-sinc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 2px;
  transition: background 0.4s;
}
.chat-sinc-ok     { background: #4ade80; }
.chat-sinc-espera { background: rgba(255,255,255,0.5); animation: chatDot 1.2s ease-in-out infinite; }

.chat-btn-cerrar {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.chat-btn-cerrar:hover { opacity: 0.78; }

/* Mensajes */
.chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-mensajes::-webkit-scrollbar { width: 3px; }
.chat-mensajes::-webkit-scrollbar-thumb {
  background: rgba(91,63,228,0.18);
  border-radius: 2px;
}

/* Bienvenida */
.chat-bienvenida {
  background: white;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--color-texto, #1A1033);
  border: 1px solid var(--color-borde, #E8E4F8);
}
.chat-bienvenida p  { margin: 0 0 6px; font-weight: 700; }
.chat-bienvenida ul { margin: 0; padding-left: 16px; line-height: 1.75; color: var(--color-texto-suave, #6B5E8A); }

/* Burbujas */
.chat-burbuja {
  max-width: 90%;
  padding: 9px 13px;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-burbuja-user {
  background: var(--color-primario, #5B3FE4);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-burbuja-asistente {
  background: white;
  color: var(--color-texto, #1A1033);
  align-self: flex-start;
  border: 1px solid var(--color-borde, #E8E4F8);
  border-bottom-left-radius: 4px;
}

/* Puntos de carga */
.chat-cargando {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  min-width: 54px;
}
.chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-texto-suave, #6B5E8A);
  display: inline-block;
  animation: chatDot 1.2s ease-in-out infinite;
}
.chat-dot:nth-child(2) { animation-delay: 0.20s; }
.chat-dot:nth-child(3) { animation-delay: 0.40s; }
@keyframes chatDot {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.35; }
  40%           { transform: scale(1.00); opacity: 1; }
}

/* Error */
.chat-error-msg {
  font-size: 12.5px;
  color: var(--color-peligro, #ef4444);
  background: #fff0f0;
  padding: 7px 12px;
  border-radius: 10px;
  text-align: center;
  align-self: center;
}

/* Input */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  background: white;
  border-top: 1px solid var(--color-borde, #E8E4F8);
  flex-shrink: 0;
}
.chat-textarea {
  flex: 1;
  border: 1.5px solid var(--color-borde, #E8E4F8);
  border-radius: 13px;
  padding: 9px 13px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--color-texto, #1A1033);
  background: var(--color-fondo, #F5F3FF);
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 90px;
  overflow-y: auto;
  line-height: 1.4;
  transition: border-color 0.15s;
}
.chat-textarea:focus    { border-color: var(--color-primario, #5B3FE4); }
.chat-textarea::placeholder { color: var(--color-texto-suave, #6B5E8A); opacity: 0.7; }
.chat-textarea:disabled { opacity: 0.5; }

.chat-btn-enviar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--color-primario, #5B3FE4);
  color: white;
  border: none;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 3px 10px rgba(91,63,228,0.35);
}
.chat-btn-enviar:hover:not(:disabled)  { opacity: 0.88; transform: translateY(-1px); }
.chat-btn-enviar:active:not(:disabled) { transform: translateY(0); }
.chat-btn-enviar:disabled { opacity: 0.35; cursor: not-allowed; }
