/* Chatbot EMYS - estilos del widget */

.sintesia-chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
}

/* Botón flotante */
.chatbot-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1d72b8, #0a4d7a);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(13, 71, 161, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.chatbot-button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(13,71,161,.45) }
.chatbot-button i { font-size: 18px }

/* Ventana */
.chatbot-window {
  position: fixed;
  right: 20px;
  bottom: 100px;
  width: 760px; /* ancho ~el doble */
  max-width: calc(100vw - 40px);
  height: 700px; /* más alto */
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.chatbot-window.active { display: flex }

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #1d72b8, #0a4d7a);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chatbot-header-title { display: flex; align-items: center; gap: 10px }
.chatbot-header-title h3 { margin: 0; font-size: 16px; font-weight: 800 }
.chatbot-close { background: transparent; border: 0; color: #fff; font-size: 20px; cursor: pointer }

/* Mensajes */
.chatbot-messages { flex: 1; overflow-y: auto; padding: 18px; background: #f5f7fa }
.message { margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; max-width: 75% }
.message.assistant { background: #fff; color: #333; border-bottom-left-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-right: auto }
.message.user { background: #1d72b8; color: #fff; border-bottom-right-radius: 6px; margin-left: auto }

/* Sugerencias */
#suggestions-container { padding: 0 18px 8px; display: flex; flex-wrap: wrap; gap: 8px }
.suggestion-button { background: #fff; border: 1px solid #e5e8ee; border-radius: 20px; padding: 6px 12px; font-size: 12px; cursor: pointer }
.suggestion-button:hover { background: #1d72b8; color: #fff; border-color: #1d72b8 }

/* Input */
.chatbot-input { display: flex; gap: 10px; padding: 14px; background: #fff; border-top: 1px solid #eaecef }
.chatbot-input input { flex: 1; border: 1px solid #e0e4ea; border-radius: 24px; padding: 10px 14px; font-size: 14px; outline: none }
.chatbot-input input:focus { border-color: #1d72b8 }
.chatbot-send { background: #1d72b8; color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer }
.chatbot-send:hover { background: #0a4d7a }

/* Typing */
.message.typing-indicator { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); display: inline-flex; gap: 5px }
.message.typing-indicator span { width: 8px; height: 8px; background: #9aa4b2; border-radius: 50%; animation: typing 1.4s infinite }
.message.typing-indicator span:nth-child(2){ animation-delay:.2s } .message.typing-indicator span:nth-child(3){ animation-delay:.4s }
@keyframes typing { 0%,60%,100%{ transform: translateY(0) } 30%{ transform: translateY(-6px) } }

@media (max-width: 768px) {
  /* Botón circular en móvil */
  .chatbot-button {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .chatbot-button span {
    display: none; /* Ocultar texto, solo icono */
  }
  .chatbot-button i {
    font-size: 22px;
    margin: 0;
  }
  
  /* Contenedor ajustado */
  .sintesia-chatbot-container {
    bottom: 16px;
    right: 16px;
  }
  
  /* Ventana del chatbot ajustada */
  .chatbot-window {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 60px;    /* Deja espacio arriba para la barra del navegador */
    bottom: 80px; /* Deja espacio para el botón */
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 16px;
  }
  
  /* Ajustes internos */
  .chatbot-header {
    padding: 12px 14px;
  }
  .chatbot-header-title h3 {
    font-size: 14px;
  }
  .chatbot-messages {
    padding: 12px;
  }
  .message {
    max-width: 85%;
    font-size: 13px;
    padding: 10px 12px;
  }
  #suggestions-container {
    padding: 0 12px 8px;
  }
  .suggestion-button {
    font-size: 11px;
    padding: 5px 10px;
  }
  .chatbot-input {
    padding: 10px;
    gap: 8px;
  }
  .chatbot-input input {
    font-size: 13px;
    padding: 8px 12px;
  }
  .chatbot-send {
    width: 36px;
    height: 36px;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 400px) {
  .chatbot-window {
    left: 4px;
    right: 4px;
    top: 50px;
    bottom: 75px;
    border-radius: 12px;
  }
  .chatbot-button {
    width: 50px;
    height: 50px;
  }
  .chatbot-button i {
    font-size: 20px;
  }
  .sintesia-chatbot-container {
    bottom: 12px;
    right: 12px;
  }
}
