/* alquiler_yates/widget/widget.css — estilos mínimos del widget */
#ys-chat-button{
  position:fixed; right:18px; bottom:18px; z-index:9999;
  width:54px; height:54px; border-radius:50%;
  border:none; background:#22d3ee; color:#001219; font-size:22px;
  box-shadow:0 6px 24px rgba(0,0,0,.35); cursor:pointer;
}
#ys-chat-button:hover{ filter:brightness(1.05); }

#ys-chat-widget{
  position:fixed; right:18px; bottom:84px; z-index:9998;
  width:320px; max-width:90vw; height:420px; max-height:70vh;
  background:#0b1220; color:#e2e8f0; border:1px solid #334155; border-radius:12px;
  display:none; flex-direction:column; overflow:hidden;
  box-shadow:0 8px 32px rgba(0,0,0,.45);
}
#ys-chat-widget.open{ display:flex; }

#ys-chat-widget .ys-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px; border-bottom:1px solid #334155; background:#0f172a;
}
#ys-chat-widget .ys-title{ font-weight:600; font-size:14px; }
#ys-chat-widget .ys-close{ background:transparent; color:#e2e8f0; border:none; font-size:20px; cursor:pointer; }

#ys-chat-widget .ys-body{ display:flex; flex:1; flex-direction:column; }
#ys-chat-widget .ys-messages{ flex:1; overflow:auto; padding:12px; display:flex; flex-direction:column; gap:8px; }

.ys-msg{ max-width:80%; padding:8px 10px; border-radius:10px; font-size:14px; line-height:1.35; white-space:pre-wrap; }
.ys-user{ align-self:flex-end; background:#22d3ee; color:#001219; border-top-right-radius:4px; }
.ys-bot{ align-self:flex-start; background:#111827; color:#e2e8f0; border-top-left-radius:4px; }
.ys-thinking{ opacity:.7; font-style:italic; }

.ys-form{ display:flex; gap:8px; padding:10px; border-top:1px solid #334155; }
.ys-input{ flex:1; padding:10px; border:1px solid #334155; border-radius:8px; background:#0f172a; color:#e2e8f0; }
.ys-send{ padding:10px 14px; background:#22d3ee; color:#001219; border:none; border-radius:8px; cursor:pointer; }

/* Sugerencias iniciales */
.ys-suggestions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.ys-sugg{
  padding:6px 10px; border:1px solid #334155; border-radius:999px; background:#0f172a; color:#e2e8f0;
  font-size:12px; cursor:pointer;
}
.ys-sugg:hover{ filter:brightness(1.1); border-color:#475569; }

/* --- A PARTIR DE AQUÍ: estilos oficiales fusionados (antes en widget-official.css) --- */
/* alquiler_yates/widget/widget-official.css — override para estética oficial Sintesia */

/* Contenedor principal del botón y ventana (posiciones ya están en widget.css) */
#ys-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  box-shadow: 0 4px 20px rgba(0, 86, 112, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  border: none;
  position: fixed;
  overflow: hidden;
  color: #fff;
  font-size: 24px;
}
#ys-chat-button::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
}
#ys-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 86, 112, 0.6);
}

/* Ventana del chatbot con efecto glass y animación scale */
#ys-chat-widget {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 9998;
  width: 520px;
  height: 600px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 120px);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex; /* forzar display flex por animación */
  flex-direction: column;
  /* Evitar que el contenido interior recorte el footer del chat */
  overflow: visible;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s ease;
  pointer-events: none; /* desactivar interacciones cuando está cerrado */
  color: #333;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
#ys-chat-widget.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Cabecera */
#ys-chat-widget .ys-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  background-color: rgba(0, 86, 112, 0.85);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px 20px 0 0;
}
#ys-chat-widget .ys-title { margin: 0; font-size: 16px; font-weight: 600; }
#ys-chat-widget .ys-close { background: transparent; border: none; color: #fff; font-size: 18px; cursor: pointer; transition: transform .2s ease; }
#ys-chat-widget .ys-close:hover { transform: scale(1.2); }

/* Área de mensajes con fondo sutil */
#ys-chat-widget .ys-body { display:flex; flex:1 1 auto; flex-direction:column; min-height: 0; }
#ys-chat-widget .ys-messages {
  flex:1 1 auto; padding: 20px 20px 12px 20px; overflow-y:auto; min-height: 0;
  background-color: rgba(245, 245, 250, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Burbujas de mensajes */
.ys-msg {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 75%;
  line-height: 1.4;
  word-wrap: break-word;
  animation: ys-fadeIn .3s;
}
.ys-user {
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  color: #fff;
  margin-left: auto;
  border-top-right-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 86, 112, 0.3);
}
.ys-bot {
  background-color: rgba(240, 240, 245, 0.8);
  color: #333;
  margin-right: auto;
  border-top-left-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Indicador de escritura (3 puntos) */
.ys-typing {
  background-color: rgba(240, 240, 245, 0.8);
  color: #333;
  margin-right: auto;
  border-top-left-radius: 5px;
  padding: 15px 20px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  max-width: 75px;
}
.ys-typing span {
  height: 8px; width: 8px; background-color: #005670; border-radius: 50%; display: inline-block; margin: 0 2px;
  animation: ys-typing 1.5s infinite ease-in-out; box-shadow: 0 0 5px rgba(0, 86, 112, 0.3);
}
.ys-typing span:nth-child(2) { animation-delay: .2s; }
.ys-typing span:nth-child(3) { animation-delay: .4s; }

/* Sugerencias */
.ys-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 15px; background-color: rgba(245, 245, 250, 0.3); border-top: 1px solid rgba(0, 0, 0, 0.05); }
.ys-sugg {
  background: rgba(0, 86, 112, 0.1);
  border: 1px solid rgba(0, 86, 112, 0.2);
  color: #005670;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.ys-sugg:hover { background: rgba(0, 86, 112, 0.2); transform: translateY(-2px); }

/* Footer input */
#ys-chat-widget .ys-form { display: flex; align-items: center; gap: 10px; padding: 15px; background-color: rgba(255, 255, 255, 0.75); border-top: 1px solid rgba(0, 0, 0, 0.05); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03); flex: 0 0 auto; }
#ys-chat-widget .ys-input { flex: 1; padding: 12px 15px; border: 1px solid #e0e0e0; border-radius: 20px; outline: none; font-size: 14px; transition: all .2s ease; background: #fff; color: #333; }
#ys-chat-widget .ys-input:focus { border-color: #005670; box-shadow: 0 0 0 2px rgba(0, 86, 112, 0.1); }
#ys-chat-widget .ys-send { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #005670 0%, #003a4c 100%); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: none; transition: transform .2s ease; position: relative; overflow: hidden; color: #fff; font-weight: 600; }
#ys-chat-widget .ys-send::before { content:''; position:absolute; top:-10px; left:-10px; width:60px; height:60px; background:linear-gradient(45deg, rgba(255,255,255,.1), rgba(255,255,255,0)); transform: rotate(45deg); }
#ys-chat-widget .ys-send:hover { transform: scale(1.1); }

/* Animaciones */
@keyframes ys-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ys-typing { 0% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(-5px); opacity: 1; } 100% { transform: translateY(0); opacity: .7; } }

/* Responsive */
@media (max-width: 480px) {
  #ys-chat-widget { width: calc(100vw - 24px); right: 12px; bottom: 80px; height: calc(100vh - 120px); }
  #ys-chat-button { width: 50px; height: 50px; }
}
