/* CSS AMELIA */

/* --- Widget de Amel-ia (Contenedor Global) --- */
.amelia-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1000; /* Asegura que esté sobre todo */
  font-family: 'Poppins', sans-serif;
}

/* --- Botón Flotante (Toggle) --- */
.amelia-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  background: radial-gradient(circle at top left, rgba(0, 210, 198, 0.9), rgba(228, 0, 183, 0.8));
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(228, 0, 183, 0.4);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.amelia-toggle:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 45px rgba(228, 0, 183, 0.6);
}

.amelia-toggle-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

/* Efecto de Pulso Neón */
.pulse-ring {
  position: absolute;
  inset: -5px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-secondary);
  animation: amelia-pulse 2s infinite;
  opacity: 0;
  pointer-events: none;
}

@keyframes amelia-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* --- Ventana de Chat --- */
.amelia-window {
  width: 330px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 20px; /* Separación del botón toggle */
  transform-origin: bottom right;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  
  /* Gradiente Cyberpunk sutil en el borde superior */
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--color-primary), var(--color-secondary)) 1;
}

/* Para la animación de apertura */
.amelia-window[hidden] {
  display: none;
  transform: scale(0) translateY(100px);
  opacity: 0;
}

.amelia-window:not([hidden]) {
  display: block;
  animation: amelia-open 0.4s ease-out forwards;
}

@keyframes amelia-open {
  0% { transform: scale(0) translateY(100px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header de la ventana */
.amelia-header {
  padding: 15px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.amelia-avatar-img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary);
}

.amelia-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.status-online {
  font-size: 0.75rem;
  color: #4ade80; /* Verde brillante neón */
}

.close-amelia {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}

.close-amelia:hover {
  color: #fff;
}

/* Cuerpo del chat */
.amelia-body {
  padding: 20px;
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.amelia-msg {
  background: rgba(15, 23, 42, 0.8);
  padding: 10px 15px;
  border-radius: var(--radius-md);
  border-bottom-left-radius: 4px; /* Estilo burbuja de chat */
  font-size: 0.85rem;
  color: var(--color-text);
  margin: 0;
  max-width: 90%;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Footer con el botón */
.amelia-footer {
  padding: 15px 20px 20px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--color-border);
}

.btn--full {
  width: 100%;
}

/* --- Ajustes para Móvil --- */
@media (max-width: 480px) {
  .amelia-widget {
    bottom: 15px; /* Más cerca del borde para ganar espacio */
    right: 15px;
    left: 15px; /* En móvil, le damos un ancho relativo */
  }

  .amelia-window {
    width: 100%; /* Que ocupe casi todo el ancho disponible */
    bottom: 70px; /* Que flote justo encima del botón toggle */
    position: absolute;
    right: 0;
  }

  .amelia-toggle {
    width: 100%; /* El botón se vuelve una barra ancha fácil de tocar */
    justify-content: center;
    padding: 12px;
  }

  .amelia-toggle-avatar {
    width: 35px;
    height: 35px;
  }

  .amelia-body {
    max-height: 200px; /* Acortamos un poco el chat para que no tape todo */
  }
}