/* ═══════════════════════════════════════════════
   ŻeloTV — Chat
   Chat panel · messages · compose · suggestions ·
   standalone · whitelist dropdown · toggle button
   ═══════════════════════════════════════════════ */

/* ── Chat panel — width-based animation for smooth resize ── */
.chat-panel {
  width: 340px; min-width: 340px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--bg);
  transition: width .3s cubic-bezier(.4,0,.2,1),
              min-width .3s cubic-bezier(.4,0,.2,1),
              opacity .25s ease;
  will-change: width, min-width;
  overflow: hidden;
}
.chat-panel.collapsed {
  width: 0; min-width: 0; border-left: none;
  opacity: 0;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.chat-head-actions { display: flex; gap: 4px; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
}

/* Chat message animations */
.chat-msg {
  padding: 4px 8px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.4;
  animation: chatIn .25s ease both;
  word-wrap: break-word;
}
.chat-msg:hover { background: rgba(255,255,255,0.03); }
@keyframes chatIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.removing {
  animation: chatOut .2s ease forwards;
}
@keyframes chatOut {
  to { opacity: 0; transform: translateX(-20px); height: 0; padding: 0; margin: 0; }
}
.chat-author {
  font-weight: 600; font-size: 13px;
  cursor: default;
}
.chat-author.admin { color: var(--live-red); }
.chat-clan { font-size: 10px; font-weight: 700; color: var(--accent); margin-right: 4px; }
.chat-text { color: var(--text-dim); }

/* Chat input area — matches info bar height */
.chat-input-area {
  height: var(--chat-input-h); min-height: var(--chat-input-h); max-height: var(--chat-input-h);
  padding: 0 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
}
.chat-compose {
  display: flex; align-items: center; gap: 8px; width: 100%;
}
.chat-input {
  flex: 1; font-size: 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; color: var(--text); min-width: 0;
  outline: none; transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; cursor: pointer;
  transition: opacity var(--transition);
}
.chat-send:hover { opacity: .85; }
.chat-send:active { transform: scale(0.92); }
.chat-login-prompt { text-align: center; padding: 4px 0; }

/* ── Chat command autocomplete suggestions ───── */
.chat-suggestions {
  padding: 4px 8px; border-top: 1px solid var(--border);
  background: var(--bg); max-height: 180px; overflow-y: auto;
}
.chat-sug-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text);
  transition: background var(--transition);
}
.chat-sug-item:hover, .chat-sug-item.active { background: var(--bg-card-hover); }
.chat-sug-item img { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.chat-sug-name { font-weight: 500; }
.chat-sug-cmd { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13px; font-weight: 600; color: var(--accent); }
.chat-sug-param { font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.chat-sug-desc { font-size: 12px; color: var(--text-dim); margin-left: auto; }

/* ── Chat toggle button ──────────────────────── */
.chat-toggle-btn {
  position: absolute; right: 340px;
  top: 50%; transform: translateY(-50%);
  z-index: 20;
  width: 24px; height: 48px;
  border: none; padding: 0;
  border-radius: 6px 0 0 6px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: right .3s cubic-bezier(.4,0,.2,1), background .15s ease;
  backdrop-filter: blur(4px);
}
.chat-toggle-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.chat-toggle-btn.chat-hidden { right: 0; }
.chat-toggle-btn svg {
  width: 14px; height: 14px;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  transform: rotate(180deg);
}
.chat-toggle-btn.chat-hidden svg { transform: rotate(0deg); }

/* ── Standalone chat (pop-out for OBS) ────────── */
.standalone-chat {
  height: 100vh; display: flex; flex-direction: column;
  background: transparent; /* transparent bg for OBS */
}
#vChat { background: transparent; }
#vChat .chat-messages {
  background: transparent;
}

/* ── Chat crown & system messages ───────────── */
.chat-crown { margin-right: 2px; font-size: 12px; }
.chat-system {
  padding: 4px 10px;
  font-size: 12px; color: var(--text-dim);
  font-style: italic; text-align: center;
  opacity: 0.8;
}
.chat-system .chat-text { color: var(--text-dim); }

/* ── Whitelist dropdown ─────────────────────── */
.wl-dropdown {
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,0.95);
  padding: 12px;
  max-height: 300px; overflow-y: auto;
}
.wl-drop-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.wl-drop-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.wl-drop-body { display: flex; flex-direction: column; gap: 8px; }
.wl-drop-add { display: flex; gap: 6px; align-items: center; }
.wl-drop-add .chat-input { font-size: 12px; padding: 6px 10px; }
.wl-drop-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: var(--radius-sm);
  font-size: 13px;
}
.wl-drop-user:hover { background: var(--bg-card-hover); }
.wl-drop-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; pointer-events: auto; }
.wl-drop-name { flex: 1; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-drop-remove { flex-shrink: 0; }
.wl-drop-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }
