/* ==========================================================
   EKO Chatbot Widget — BioAudita
   ========================================================== */

/* Botón flotante */
.eko-fab {
  position: fixed;
  bottom: 7rem; /* Arriba del WhatsApp en público */
  right: 2.35rem;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  border: 1px solid #2d5a27;
  cursor: pointer;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}
/* En dashboard (privado) no hay WhatsApp, posición normal */
.eko-fab[data-modo="privado"] {
  bottom: 1.5rem;
  right: 1.5rem;
}
.eko-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(45,90,39,0.25);
  background: #f6fbf5;
}
.eko-fab svg {
  width: 3.25rem;
  height: 3.25rem;
}
.eko-fab--hidden {
  display: none;
}

/* Panel de chat */
.eko-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 6rem);
  border-radius: 1rem;
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface-primary, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.eko-panel--open {
  display: flex;
}

/* Header */
.eko-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #2d5a27;
  color: white;
  flex-shrink: 0;
}
.eko-header-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.eko-header-avatar svg {
  width: 1.25rem;
  height: 1.25rem;
}
.eko-header-info {
  flex: 1;
  min-width: 0;
}
.eko-header-name {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.2;
}
.eko-header-status {
  font-size: 0.7rem;
  opacity: 0.8;
}
.eko-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.eko-close:hover {
  opacity: 1;
}

/* Mensajes */
.eko-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.eko-msg {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.eko-msg--user {
  align-self: flex-end;
  background: #2d5a27;
  color: white;
  border-bottom-right-radius: 0.25rem;
}
.eko-msg--assistant {
  align-self: flex-start;
  background: var(--color-surface-secondary, #f3f4f6);
  color: var(--color-text-primary, #111827);
  border-bottom-left-radius: 0.25rem;
}
.eko-msg--assistant .eko-msg-source {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.625rem;
  opacity: 0.6;
  font-style: italic;
}
.eko-typing {
  align-self: flex-start;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
  display: none;
}
.eko-typing--visible {
  display: block;
}
.eko-typing-dots {
  display: inline-flex;
  gap: 0.2rem;
}
.eko-typing-dots span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--color-text-muted, #9ca3af);
  animation: ekoBounce 1.2s infinite ease-in-out;
}
.eko-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.eko-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ekoBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Bienvenida */
.eko-welcome {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.eko-welcome strong {
  color: var(--color-text-primary, #111827);
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

/* Input */
.eko-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}
.eko-input {
  flex: 1;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 1.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  outline: none;
  background: var(--color-surface-primary, #fff);
  color: var(--color-text-primary, #111827);
  resize: none;
  max-height: 5rem;
  line-height: 1.4;
}
.eko-input:focus {
  border-color: #2d5a27;
  box-shadow: 0 0 0 2px rgba(45,90,39,0.15);
}
.eko-send {
  background: #2d5a27;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.eko-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.eko-send svg {
  width: 1rem;
  height: 1rem;
  color: white;
}
