/* 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;
  padding: 0;
  overflow: hidden;
  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-pulse-ring {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand);
  z-index: 9997;
  pointer-events: none;
  animation: agentePulse 2.6s ease-out infinite;
}
#agente-pulse-ring.agente-pulse-stop { animation: none; display: none; }
@keyframes agentePulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
#agente-bubble-avatar {
  width: 100% !important; height: 100% !important;
  max-width: 100%; max-height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
#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: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  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: 14px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.agente-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
#agente-header-avatar {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px; max-height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(10,10,10,.15);
  flex-shrink: 0;
}
#agente-header .agente-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #0a0a0a;
}
#agente-header .agente-subtitle {
  font-size: 11px;
  color: rgba(10,10,10,.72);
  margin-top: 1px;
  line-height: 1.2;
}
.agente-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(10,10,10,.75);
  margin-top: 3px;
}
.agente-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17c964;
  box-shadow: 0 0 0 2px rgba(23,201,100,.25);
  flex-shrink: 0;
}
#agente-close {
  background: none; border: none; cursor: pointer;
  color: #0a0a0a; opacity: .75; font-size: 20px; line-height: 1;
  padding: 4px;
  flex-shrink: 0;
}
#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: 50%;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .15s;
}
#agente-send:hover { opacity: .9; transform: scale(1.05); }
#agente-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
#agente-send svg { width: 17px; height: 17px; }

#agente-disclaimer {
  text-align: center;
  font-size: 10px;
  color: #666;
  padding: 0 12px 10px;
  flex-shrink: 0;
}

/* ── Bienvenida: avatar grande + tarjetas de acceso rápido ─────────────── */
.agente-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px 18px;
  border-bottom: 1px solid #1c1a16;
  margin-bottom: 14px;
}
.agente-welcome-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
}
.agente-welcome-avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-rgb),.25), transparent 70%);
}
.agente-welcome-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(var(--brand-rgb),.35);
  display: block;
}
.agente-welcome-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.agente-welcome-desc {
  font-size: 12.5px;
  color: #aaa;
  line-height: 1.5;
  max-width: 280px;
  margin-bottom: 16px;
}
.agente-quick-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
  align-self: flex-start;
  padding-left: 2px;
}
.agente-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.agente-quick-card {
  background: #161310;
  border: 1px solid #2a2520;
  border-radius: 10px;
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.agente-quick-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.agente-quick-icon { font-size: 16px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.agente-quick-title { font-size: 12px; font-weight: 600; color: #fff; }
.agente-quick-sub { font-size: 10.5px; color: #888; margin-top: 1px; line-height: 1.3; }

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