/* ═══════════════════════════════════════════════════════════════════
   Chat Widget — Radio Passion Varadero  (plugin chat v1)
   Préfixe: .rpv-chat__ (widget public)  /  .dj-chat__ (panel DJ)
═══════════════════════════════════════════════════════════════════ */

/* ── Bouton flottant ──────────────────────────────────────────── */
#rpv-chat-btn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #ff6b00, #a78bfa);
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 9990;
  box-shadow: 0 4px 20px rgba(255,107,0,.4);
  border: none;
  transition: transform .2s, box-shadow .2s;
}
#rpv-chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(255,107,0,.55); }
#rpv-chat-btn.rpv-visible { display: flex; }

#rpv-chat-btn::before {
  content: '';
  position: absolute; top: 3px; right: 3px;
  width: 12px; height: 12px;
  background: #22c55e;
  border-radius: 50%; border: 2px solid #0a0e14;
  animation: rpvPulse 1.8s infinite;
}
@keyframes rpvPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: .65; }
}

#rpv-chat-btn svg { width: 24px; height: 24px; fill: #fff; pointer-events: none; }

#rpv-chat-unread {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-family: Inter, sans-serif;
}
#rpv-chat-unread.rpv-visible { display: flex; }

/* ── Fenêtre chat ─────────────────────────────────────────────── */
#rpv-chat-win {
  position: fixed;
  bottom: 86px; right: 24px;
  width: 320px; height: 420px;
  background: #1a2a3a; border-radius: 14px;
  display: none; flex-direction: column;
  z-index: 9991;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
  font-family: Inter, system-ui, sans-serif;
  overflow: hidden;
  animation: rpvSlideIn .2s ease-out;
}
#rpv-chat-win.rpv-visible { display: flex; }
@keyframes rpvSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rpv-chat__hdr {
  background: linear-gradient(135deg, #ff6b00, #a78bfa);
  padding: 11px 14px; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
.rpv-chat__hdr-top { display: flex; align-items: center; gap: 10px; }
.rpv-chat__ico {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.rpv-chat__dj-name { color: #fff; font-weight: 700; font-size: 13px; }
.rpv-chat__dj-sub  { color: rgba(255,255,255,.8); font-size: 10px; }
.rpv-chat__close {
  margin-left: auto; background: none; border: none;
  color: rgba(255,255,255,.75); cursor: pointer; font-size: 18px; line-height: 1;
  transition: color .15s; padding: 2px;
}
.rpv-chat__close:hover { color: #fff; }
.rpv-chat__nowplaying {
  background: rgba(0,0,0,.2); border-radius: 6px;
  padding: 4px 8px; font-size: 10px; color: rgba(255,255,255,.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rpv-chat__msgs {
  flex: 1; overflow-y: auto;
  padding: 10px; display: flex; flex-direction: column; gap: 7px;
  background: #0f1923; scroll-behavior: smooth;
}
.rpv-chat__msgs::-webkit-scrollbar { width: 4px; }
.rpv-chat__msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.rpv-chat__msg { display: flex; gap: 7px; align-items: flex-start; }
.rpv-chat__av {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
  text-transform: uppercase;
}
/* ── Couleurs par type d'auteur ────────────────────────────────── */
.rpv-chat__msg--guest      .rpv-chat__av { background: #3a5a7a; }
.rpv-chat__msg--registered .rpv-chat__av { background: #ea580c; }
.rpv-chat__msg--dj         .rpv-chat__av {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.rpv-chat__msg--guest      .rpv-chat__author { color: #7ab3d4; }
.rpv-chat__msg--registered .rpv-chat__author { color: #fb923c; }
.rpv-chat__msg--dj         .rpv-chat__author { color: #c4b5fd; }

.rpv-chat__msg--dj .rpv-chat__bubble {
    background: linear-gradient(135deg, #1e1040, #0d1b3e);
    border-left: 3px solid #7c3aed;
}

.rpv-chat__badge--dj  { background: #7c3aed;           color: #fff; }
.rpv-chat__badge--reg { background: rgba(234,88,12,.2); color: #fb923c; border: 1px solid rgba(234,88,12,.4); }

.rpv-chat__bubble {
  background: #1a2a3a; padding: 6px 9px;
  border-radius: 0 8px 8px 8px;
  max-width: calc(100% - 40px);
}
.rpv-chat__author {
  font-size: 9px; font-weight: 700; margin-bottom: 2px;
}
.rpv-chat__text  { color: #e8e8e8; font-size: 12px; line-height: 1.4; word-break: break-word; }
.rpv-chat__meta  { color: #444; font-size: 9px; margin-top: 2px; display: flex; gap: 5px; align-items: center; }
.rpv-chat__ts    { color: #444; }
.rpv-chat__badge { font-size: 9px; padding: 1px 4px; border-radius: 4px; }

.rpv-chat__foot {
  padding: 8px 10px; background: #1a2a3a;
  border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.rpv-chat__name-row { display: flex; gap: 6px; margin-bottom: 6px; }
.rpv-chat__name-in {
  flex: 0 0 100px;
  background: #0f1923; border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 5px 8px;
  color: #e8e8e8; font-size: 11px; outline: none; font-family: inherit;
}
.rpv-chat__name-in:focus { border-color: rgba(255,107,0,.4); }
.rpv-chat__msg-row { display: flex; gap: 6px; }
.rpv-chat__msg-in {
  flex: 1; background: #0f1923;
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  padding: 6px 10px; color: #e8e8e8; font-size: 12px;
  outline: none; font-family: inherit; resize: none;
  height: 36px; line-height: 1.3;
}
.rpv-chat__msg-in:focus { border-color: rgba(255,107,0,.4); }
.rpv-chat__send {
  background: #ff6b00; border: none; border-radius: 8px;
  width: 36px; height: 36px; color: #fff; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.rpv-chat__send:hover    { background: #e55a00; }
.rpv-chat__send:disabled { background: #333; cursor: not-allowed; }

.rpv-chat__rl   { font-size: 10px; color: #777; text-align: center; padding: 3px 0 1px; min-height: 16px; }
.rpv-chat__cta  {
  background: rgba(255,107,0,.08); border: 1px solid rgba(255,107,0,.15);
  border-radius: 8px; padding: 8px 10px; margin-top: 5px; display: none;
}
.rpv-chat__cta.rpv-visible { display: block; }
.rpv-chat__cta ul { list-style: none; padding: 0; margin: 0 0 6px; font-size: 10px; color: #aaa; }
.rpv-chat__cta li { padding-left: 14px; position: relative; }
.rpv-chat__cta li::before { content: '\2713 '; color: #ff6b00; position: absolute; left: 0; }
.rpv-chat__cta a {
  display: inline-block; background: #ff6b00; color: #fff !important;
  text-decoration: none; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; transition: background .15s;
}
.rpv-chat__cta a:hover { background: #e55a00; }

/* ── Séparateur d'heure ────────────────────────────────────────── */
.rpv-chat__time-sep {
    text-align: center; font-size: 9px; color: #556;
    position: relative; margin: 4px 0; flex-shrink: 0;
}
.rpv-chat__time-sep::before,
.rpv-chat__time-sep::after {
    content: ''; position: absolute; top: 50%;
    width: 28%; height: 1px; background: rgba(255,255,255,.08);
}
.rpv-chat__time-sep::before { left: 0; }
.rpv-chat__time-sep::after  { right: 0; }

/* ── Barre son ─────────────────────────────────────────────────── */
.rpv-chat__sound-bar {
    display: flex; align-items: center; gap: 6px;
    font-size: 9px; color: #556; padding: 3px 0 5px; flex-shrink: 0;
}
.rpv-chat__sound-toggle {
    margin-left: auto; background: none; border: none;
    font-size: 9px; color: #445; cursor: pointer; padding: 0;
    font-family: inherit;
}
.rpv-chat__sound-toggle:hover { color: #ff6b00; }

/* ── Typing indicator ──────────────────────────────────────────── */
.rpv-chat__typing {
    min-height: 20px; padding: 2px 10px;
    font-size: 9px; color: #3a5a7a;
    display: flex; align-items: center; gap: 5px;
    flex-shrink: 0; background: #0f1923;
}
.rpv-chat__typing-dots {
    display: flex; gap: 3px; align-items: center;
}
.rpv-chat__typing-dot {
    width: 4px; height: 4px;
    background: #3a5a7a; border-radius: 50%;
    animation: rpvDotBounce .9s infinite;
}
.rpv-chat__typing-dot:nth-child(2) { animation-delay: .15s; }
.rpv-chat__typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes rpvDotBounce {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-4px); }
}

/* ── Réactions ─────────────────────────────────────────────────── */
.rpv-chat__bubble { position: relative; }
.rpv-chat__reacts {
    display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px;
}
.rpv-chat__react {
    display: flex; align-items: center; gap: 2px;
    background: #0d1b2a; border: 1px solid #1a2a3a;
    border-radius: 10px; padding: 2px 6px;
    font-size: 10px; cursor: pointer; transition: background .12s;
    user-select: none;
}
.rpv-chat__react:hover   { background: #1a2a3a; }
.rpv-chat__react.mine    { border-color: rgba(124,58,237,.5); background: rgba(124,58,237,.1); }
.rpv-chat__react.star-dj { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.102); }
.rpv-chat__react-count   { font-size: 8.5px; color: #7ab3d4; font-weight: 700; }
.rpv-chat__picker {
    position: absolute; z-index: 10;
    bottom: calc(100% + 4px); left: 0;
    display: flex; gap: 2px;
    background: #0a1520; border: 1px solid #1a2a3a;
    border-radius: 20px; padding: 5px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    animation: rpvPickerIn .15s ease-out;
}
@keyframes rpvPickerIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rpv-chat__picker-btn {
    font-size: 16px; cursor: pointer; padding: 2px 3px;
    border-radius: 6px; background: none; border: none;
    transition: background .1s; line-height: 1;
}
.rpv-chat__picker-btn:hover { background: #1a2a3a; transform: scale(1.2); }

/* ── Toast popup ───────────────────────────────────────────────── */
.rpv-chat__toast {
    position: fixed;
    bottom: calc(var(--nav-bottom-h, 56px) + var(--mini-player-h, 60px) + 80px);
    right: 20px;
    width: 280px;
    background: #1e2d3d;
    border: 1px solid rgba(124,58,237,.35);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,.5);
    z-index: 9992;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .25s ease-out, transform .25s ease-out,
                visibility 0s linear .25s;
}
.rpv-chat__toast.rpv-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .25s ease-out, transform .25s ease-out,
                visibility 0s linear 0s;
}
.rpv-chat__toast-av {
    width: 32px; height: 32px; border-radius: 50%;
    background: #3a5a7a;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
    text-transform: uppercase;
}
.rpv-chat__toast-body { flex: 1; min-width: 0; }
.rpv-chat__toast-name { font-size: 10px; font-weight: 700; color: #7ab3d4; margin-bottom: 1px; }
.rpv-chat__toast-msg  {
    font-size: 10px; color: #d4dde6;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rpv-chat__toast-close {
    background: none; border: none; color: #445; cursor: pointer;
    font-size: 13px; flex-shrink: 0; padding: 2px; line-height: 1;
}
.rpv-chat__toast-close:hover { color: #888; }

@media (max-width: 480px) {
  #rpv-chat-win { right: 8px; left: 8px; width: auto; bottom: 76px; height: 370px; }
  #rpv-chat-btn { right: 16px; bottom: 16px; }
  .rpv-chat__toast { right: 8px; left: 8px; width: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   Panel DJ (.dj-chat__)
═══════════════════════════════════════════════════════════════════ */
.dj-chat {
  background: var(--bg-2, #111827);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 320px; max-height: 480px;
  font-family: Inter, system-ui, sans-serif;
}

.dj-chat__tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.2); flex-shrink: 0;
}
.dj-chat__tab {
  flex: 1; padding: 9px 6px; background: none; border: none;
  color: #888; font-size: 11px; cursor: pointer; transition: color .15s;
  border-bottom: 2px solid transparent; font-family: inherit;
}
.dj-chat__tab:hover         { color: #ccc; }
.dj-chat__tab.dj-chat--act  { color: #ff6b00; border-bottom-color: #ff6b00; }

.dj-chat__pane { flex: 1; overflow-y: auto; display: none; }
.dj-chat__pane.dj-chat--act { display: flex; flex-direction: column; }

.dj-chat__msgs {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 5px;
  background: #0a0e14;
}
.dj-chat__msgs::-webkit-scrollbar { width: 4px; }
.dj-chat__msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

.dj-chat__row { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; }
.dj-chat__row:hover { background: rgba(255,255,255,.02); border-radius: 6px; }
.dj-chat__av {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; text-transform: uppercase;
}
.dj-chat__row--dj         .dj-chat__av { background: #a78bfa; }
.dj-chat__row--registered .dj-chat__av { background: #ff6b00; }
.dj-chat__row--guest      .dj-chat__av { background: #444; }
.dj-chat__body { flex: 1; min-width: 0; }
.dj-chat__who  { font-size: 9px; font-weight: 700; margin-bottom: 1px; }
.dj-chat__row--dj         .dj-chat__who { color: #c4b5fd; }
.dj-chat__row--registered .dj-chat__who { color: #ff9944; }
.dj-chat__row--guest      .dj-chat__who { color: #888; }
.dj-chat__txt  { font-size: 11px; color: #ddd; word-break: break-word; }
.dj-chat__time { font-size: 9px; color: #555; }
.dj-chat__acts { display: flex; gap: 4px; flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.dj-chat__row:hover .dj-chat__acts { opacity: 1; }
.dj-chat__act {
  background: rgba(255,255,255,.06); border: none;
  border-radius: 4px; padding: 3px 6px; font-size: 10px;
  cursor: pointer; color: #999; transition: background .15s, color .15s;
}
.dj-chat__act:hover        { background: rgba(255,107,0,.2); color: #ff9944; }
.dj-chat__act--ban:hover   { background: rgba(239,68,68,.2); color: #fca5a5; }
.dj-chat__act--del:hover   { background: rgba(239,68,68,.15); color: #fca5a5; }
.dj-chat__act--heart       { color: #fbbf24; }
.dj-chat__act--heart:hover { background: rgba(251,191,36,.15); color: #fbbf24; }

.dj-chat__input-row {
  display: flex; gap: 6px; padding: 8px;
  background: rgba(0,0,0,.3); border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.dj-chat__in {
  flex: 1; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  padding: 6px 10px; color: #e8e8e8; font-size: 11px;
  outline: none; font-family: inherit;
}
.dj-chat__in:focus { border-color: rgba(255,107,0,.4); }
.dj-chat__send-btn {
  background: #ff6b00; border: none; border-radius: 8px;
  padding: 0 12px; color: #fff; cursor: pointer; font-size: 12px;
  transition: background .15s;
}
.dj-chat__send-btn:hover { background: #e55a00; }
.dj-chat__tools {
  display: flex; gap: 6px; padding: 6px 8px;
  border-top: 1px solid rgba(255,255,255,.04); flex-shrink: 0;
}
.dj-chat__tool {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; padding: 4px 8px; font-size: 10px;
  color: #888; cursor: pointer; transition: background .15s;
}
.dj-chat__tool:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

.dj-chat__todo-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.dj-chat__todo-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.03); border-radius: 8px; padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.05);
}
.dj-chat__todo-item.done { opacity: .45; }
.dj-chat__todo-content { flex: 1; min-width: 0; }
.dj-chat__todo-author { font-size: 9px; font-weight: 700; color: #ff9944; }
.dj-chat__todo-text   { font-size: 11px; color: #ddd; word-break: break-word; }
.dj-chat__todo-time   { font-size: 9px; color: #555; }
.dj-chat__todo-done {
  background: none; border: 1px solid #22c55e; border-radius: 50%;
  width: 22px; height: 22px; color: #22c55e; cursor: pointer; flex-shrink: 0;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.dj-chat__todo-done:hover { background: rgba(34,197,94,.2); }
.dj-chat__todo-del {
  background: none; border: none; color: #555; cursor: pointer;
  font-size: 14px; flex-shrink: 0; transition: color .15s; padding: 0 2px;
}
.dj-chat__todo-del:hover { color: #ef4444; }
.dj-chat__todo-sep { font-size: 10px; color: #444; padding: 4px 0; text-align: center; }

.dj-chat__ban-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.dj-chat__ban-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(239,68,68,.05); border: 1px solid rgba(239,68,68,.1);
  border-radius: 8px; padding: 7px 10px;
}
.dj-chat__ban-ip    { font-size: 11px; color: #fca5a5; font-weight: 600; flex: 1; }
.dj-chat__ban-meta  { font-size: 9px; color: #666; }
.dj-chat__unban {
  background: none; border: 1px solid rgba(34,197,94,.3);
  border-radius: 6px; padding: 3px 8px; font-size: 10px;
  color: #86efac; cursor: pointer; transition: background .15s;
}
.dj-chat__unban:hover { background: rgba(34,197,94,.15); }
.dj-chat__empty { text-align: center; padding: 24px; color: #555; font-size: 12px; }

.dj-chat-embed {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  height: 100%;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2, #111827);
}

.dj-chat-embed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.18);
}

.dj-chat-embed__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
}

.dj-chat-embed__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

