/* ==========================================================================
   FlorIA Chatbot Widget Styles
   WebsPTY - Asistente Virtual FlorIA
   ========================================================================== */

/* Botón flotante */
#ia-assistant-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #6366f1 0%, #a21caf 100%);
  border-radius: 50%;
  box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s, width 0.3s, height 0.3s, border-radius 0.3s;
}

#ia-assistant-btn .ia-circle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

#ia-assistant-btn .ia-circle-icon img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

/* Estado expandido */
#ia-assistant-btn.expanded {
  width: 340px;
  max-width: 95vw;
  height: 340px;
  border-radius: 1.2rem;
  right: 2.5vw;
  bottom: 2.5vw;
  box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.25);
  background: #ffffff;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

.dark #ia-assistant-btn.expanded {
  background: #18181b;
}

@media (max-width: 768px) {
  #ia-assistant-btn {
    display: flex;
  }
  #ia-assistant-btn.expanded {
    width: 95vw;
  }
}

#ia-assistant-btn.expanded .ia-circle-icon {
  display: none;
}

/* Contenido del chat */
#ia-assistant-btn .ia-chat-content {
  display: none;
}

#ia-assistant-btn.expanded .ia-chat-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 1rem;
}

/* Cabecera del chat */
#ia-assistant-btn.expanded .ia-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  color: #6366f1;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.dark #ia-assistant-btn.expanded .ia-chat-header {
  color: #a5b4fc;
}

#ia-assistant-btn .ia-chat-close {
  background: transparent;
  border: none;
  color: #6366f1;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.dark #ia-assistant-btn .ia-chat-close {
  color: #a5b4fc;
}

/* Área de mensajes */
#ia-assistant-btn.expanded .ia-chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  border-radius: 0.8rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.97rem;
}

.dark #ia-assistant-btn.expanded .ia-chat-messages {
  background: #27272a;
  color: #e5e7eb;
}

/* Formulario e input */
#ia-assistant-btn.expanded .ia-chat-input {
  display: flex;
  border-top: 1px solid #444;
  background: #ffffff;
}

.dark #ia-assistant-btn.expanded .ia-chat-input {
  background: #18181b;
  border-top: 1px solid #27272a;
}

#ia-assistant-btn.expanded .ia-chat-input input {
  flex: 1;
  border: none;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: #222222;
}

.dark #ia-assistant-btn.expanded .ia-chat-input input {
  color: #e5e7eb;
}

#ia-assistant-btn.expanded .ia-chat-input button {
  background: #6366f1;
  color: #ffffff;
  border: none;
  padding: 0 1.2rem;
  font-size: 1.2rem;
  border-radius: 0 0 1.2rem 0;
  cursor: pointer;
  transition: background 0.2s;
}

#ia-assistant-btn.expanded .ia-chat-input button:hover {
  background: #a21caf;
}

.dark #ia-assistant-btn.expanded .ia-chat-input button {
  background: #6366f1;
  color: #ffffff;
}

.dark #ia-assistant-btn.expanded .ia-chat-input button:hover {
  background: #a21caf;
}

#ia-assistant-btn svg {
  width: 2rem;
  height: 2rem;
  color: #ffffff;
}

/* Animación de puntos suspensivos en carga */
.loading-dots::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: loading-dots 1.2s steps(4, end) infinite;
}

@keyframes loading-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}
