/* assets/agente/widget.css
   Widget de chat del agente — hereda --brand / --brand-dark de core/brand.php,
   así que si cambias el color de marca en site_settings, el widget lo sigue
   automáticamente sin tocar este archivo. */

#agente-bubble {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 6px 24px rgba(var(--brand-rgb), .35);
  border: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
#agente-bubble:hover { transform: scale(1.06); box-shadow: 0 8px 30px rgba(var(--brand-rgb), .5); }
#agente-bubble svg { width: 26px; height: 26px; }
#agente-bubble .agente-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #ff4757;
  border: 2px solid #0a0a0a;
  display: none;
}
#agente-bubble .agente-dot.show { display: block; }

#agente-panel {
  position: fixed;
  bottom: 96px;
  right: 22px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #0f0f0f;
  border: 1px solid #2a2520;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: 'Jost', system-ui, sans-serif;
}
#agente-panel.open { display: flex; animation: agenteSlideUp .22s ease; }
@keyframes agenteSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

#agente-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#agente-header .agente-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #0a0a0a;
}
#agente-header .agente-subtitle {
  font-size: 11.5px;
  color: rgba(10,10,10,.72);
  margin-top: 1px;
}
#agente-close {
  background: none; border: none; cursor: pointer;
  color: #0a0a0a; opacity: .75; font-size: 20px; line-height: 1;
  padding: 4px;
}
#agente-close:hover { opacity: 1; }

#agente-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0a0a0a;
}
.agente-msg {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.agente-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #0a0a0a;
  border-bottom-right-radius: 3px;
}
.agente-msg.assistant {
  align-self: flex-start;
  background: #1a1712;
  color: #eee;
  border: 1px solid #2a2520;
  border-bottom-left-radius: 3px;
}
.agente-msg.assistant.thinking { color: #888; font-style: italic; }

.agente-img-wrap {
  align-self: flex-start;
  max-width: 84%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a2520;
  background: #1a1712;
}
.agente-img-wrap img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
}
.agente-img-caption {
  padding: 7px 10px;
  font-size: 11.5px;
  color: #bbb;
  font-family: 'Space Grotesk', sans-serif;
}

.agente-btn-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #0a0a0a !important;
  font-weight: 700;
  font-size: 13px;
  font-family: 'Jost', sans-serif;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none !important;
  max-width: 84%;
  transition: opacity .15s, transform .15s;
}
.agente-btn-link:hover { opacity: .9; transform: translateY(-1px); }

#agente-inputbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #2a2520;
  background: #0f0f0f;
  flex-shrink: 0;
}
#agente-input {
  flex: 1;
  background: #0f0f0f;
  border: 1px solid #2a2520;
  border-radius: 9px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13.5px;
  font-family: 'Jost', sans-serif;
  outline: none;
  resize: none;
  max-height: 90px;
}
#agente-input:focus { border-color: var(--brand); }
#agente-send {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  border-radius: 9px;
  width: 40px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
#agente-send:hover { opacity: .9; }
#agente-send:disabled { opacity: .5; cursor: not-allowed; }
#agente-send svg { width: 17px; height: 17px; }

@media (max-width: 480px) {
  #agente-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
  #agente-bubble { right: 16px; bottom: 16px; }
}
