/* ─────────────────────────────────────────────────────────────
   Asistente IA · panel de chat lateral con FAB
   Roller Pingüinos · 2026
   ───────────────────────────────────────────────────────────── */

/* ──── FAB (botón flotante) ───────────────────────────────────── */
.rp-asist-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--rp-yellow);
  color: #1a1205;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-shadow: 0 12px 32px -8px rgba(255,182,18,0.55),
              0 4px 12px -2px rgba(0,0,0,0.4);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.rp-asist-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 16px 40px -8px rgba(255,182,18,0.65);
}
.rp-asist-fab:active { transform: translateY(0) scale(0.96); }

.rp-asist-fab.has-suggestion::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #FF6B6B;
  border: 2px solid #0a1018;
  animation: rp-asist-pulse 1.5s ease-in-out infinite;
}
@keyframes rp-asist-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.2); opacity: 0.7; }
}

/* ──── Panel chat ─────────────────────────────────────────────── */
.rp-asist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: rgba(5, 10, 18, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.rp-asist-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  top: auto;
  z-index: 91;
  width: min(420px, 100vw);
  max-height: min(640px, 100vh);
  height: 80vh;
  background: var(--rp-card, #0d1520);
  border-top-left-radius: 18px;
  border-top: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  border-left: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  box-shadow: -8px -8px 40px -8px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  animation: rp-asist-slide-up .28s cubic-bezier(.2,.8,.2,1) both;
  overflow: hidden;
}
@keyframes rp-asist-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@media (min-width: 768px) {
  .rp-asist-panel {
    bottom: 24px;
    right: 24px;
    top: auto;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    border-top-right-radius: 18px;
    height: 600px;
    box-shadow: -8px 8px 40px -8px rgba(0,0,0,0.6);
  }
}

/* Header */
.rp-asist-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,182,18,0.08), transparent);
}
.rp-asist-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--rp-yellow, #FFB612);
  color: #1a1205;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
}
.rp-asist-title {
  flex: 1;
  min-width: 0;
}
.rp-asist-title-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--rp-text, #fff);
}
.rp-asist-title-sub {
  font-size: 11px;
  color: var(--rp-text-muted, #8899aa);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rp-asist-title-sub::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #34D399;
  box-shadow: 0 0 6px rgba(52,211,153,0.6);
}
.rp-asist-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  color: var(--rp-text-muted, #8899aa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.rp-asist-close:hover { background: rgba(255,255,255,0.10); color: var(--rp-text, #fff); }

/* Lista de mensajes */
.rp-asist-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rp-asist-body::-webkit-scrollbar { width: 6px; }
.rp-asist-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 3px;
}

.rp-asist-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: rp-asist-msg-in .22s ease-out;
}
@keyframes rp-asist-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rp-asist-msg.is-user {
  align-self: flex-end;
  background: var(--rp-yellow, #FFB612);
  color: #1a1205;
  border-bottom-right-radius: 4px;
}

.rp-asist-msg.is-bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  color: var(--rp-text, #fff);
  border: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  border-bottom-left-radius: 4px;
}

.rp-asist-msg.is-action {
  align-self: flex-start;
  background: rgba(52,211,153,0.10);
  color: var(--rp-success, #34d399);
  border: 1px solid rgba(52,211,153,0.30);
  border-bottom-left-radius: 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Indicador de "escribiendo" */
.rp-asist-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.rp-asist-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--rp-text-muted, #8899aa);
  animation: rp-asist-typing-bounce 1.2s ease-in-out infinite;
}
.rp-asist-typing span:nth-child(2) { animation-delay: .15s; }
.rp-asist-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes rp-asist-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Sugerencias rápidas */
.rp-asist-sugerencias {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 0;
}
.rp-asist-chip {
  background: rgba(255,182,18,0.10);
  border: 1px solid rgba(255,182,18,0.30);
  color: var(--rp-yellow, #FFB612);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.rp-asist-chip:hover { background: rgba(255,182,18,0.20); }

/* Footer / input */
.rp-asist-foot {
  border-top: 1px solid var(--rp-border, rgba(255,255,255,0.08));
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--rp-card, #0d1520);
}
.rp-asist-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rp-border, rgba(255,255,255,0.10));
  border-radius: 10px;
  color: var(--rp-text, #fff);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.rp-asist-input:focus {
  border-color: rgba(255,182,18,0.4);
  background: rgba(255,182,18,0.04);
}
.rp-asist-input::placeholder { color: var(--rp-text-muted, #8899aa); }

.rp-asist-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--rp-yellow, #FFB612);
  color: #1a1205;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, transform .1s ease;
}
.rp-asist-send:hover { background: #e6a20e; }
.rp-asist-send:active { transform: scale(0.95); }
.rp-asist-send[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Disclaimer */
.rp-asist-footnote {
  font-size: 10px;
  color: var(--rp-text-muted, #8899aa);
  text-align: center;
  padding: 6px 16px 8px;
}

[x-cloak] { display: none !important; }
