/* ==========================================================================
   Widget de Chat IA Flotante (Sophia Spa - Consulta de Taller)
   Organizado en views/recursos/index/chat-widget.css
   ========================================================================== */

/* 1. Botón Flotante de Apertura (FAB) */
.chat-fab-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #ffffff;
  border: 3px solid #c5a059;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.chat-fab-toggle:hover {
  transform: scale(1.08);
  background: #2a2a2a;
  box-shadow: 0 14px 32px rgba(197, 160, 89, 0.45);
}

.chat-fab-toggle:active {
  transform: scale(0.95);
}

.chat-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  border: 2px solid #ffffff;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* 2. Panel Flotante Ventana de Chat */
.chat-floating-panel {
  position: fixed;
  bottom: 120px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 150px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chat-floating-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* 3. Encabezado del Chat */
.chat-panel-header {
  background: #1a1a1a;
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #c5a059;
}

.chat-panel-userinfo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  background: #2a2a2a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #c5a059;
}

.chat-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border: 2px solid #1a1a1a;
  border-radius: 50%;
}

.chat-panel-title h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.chat-panel-title p {
  margin: 1px 0 0 0;
  font-size: 0.72rem;
  color: #9ca3af;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.chat-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* 4. Cuerpo de Chat con Scroll */
.chat-panel-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: #f8fafc;
  scroll-behavior: smooth;
}

.chat-panel-footer {
  padding: 8px 14px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #64748b;
  font-size: 0.72rem;
}

/* ==========================================================================
   Estilos Overrides "Chat IA" sobre #consulta-taller-widget
   ========================================================================== */
#consulta-taller-widget {
  width: 100% !important;
  max-width: 100% !important;
}

/* Formulario Inicial (Patente + Correo) */
#consulta-taller-widget .ct-form {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#consulta-taller-widget .ct-form label {
  display: block;
  font-weight: 600;
  color: #334155;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

#consulta-taller-widget .ct-form input {
  display: block;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  margin-top: 4px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#consulta-taller-widget .ct-form input:focus {
  outline: none;
  border-color: #c5a059;
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

#consulta-taller-widget .ct-form button {
  width: 100%;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s ease;
}

#consulta-taller-widget .ct-form button:hover {
  background: #c5a059;
}

/* Opciones de Menú (Botones / Sugerencias de Chat) */
#consulta-taller-widget .ct-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

#consulta-taller-widget .ct-menu button {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#consulta-taller-widget .ct-menu button:hover {
  border-color: #c5a059;
  background: #fffdf5;
  color: #1a1a1a;
  transform: translateX(3px);
}

/* Respuestas Globos de Texto */
#consulta-taller-widget .ct-estado-actual,
#consulta-taller-widget .ct-repuestos,
#consulta-taller-widget .ct-contacto,
#consulta-taller-widget p {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  border-left: 4px solid #c5a059;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  color: #1e293b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 8px 0;
}

#consulta-taller-widget .ct-error {
  border-left-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}

#consulta-taller-widget .ct-cargando {
  border-left-color: #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
}

/* Botón Volver */
#consulta-taller-widget .ct-volver {
  background: transparent;
  color: #64748b;
  border: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 0;
  margin-top: 10px;
  cursor: pointer;
  transition: color 0.2s;
}

#consulta-taller-widget .ct-volver:hover {
  color: #1a1a1a;
  text-decoration: underline;
}
