/* ══════════════════════════════════════════════════════════════════
   KikiWebs Community Chat — chat.css
   ══════════════════════════════════════════════════════════════════ */

/* ── Floating Chat Button ────────────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #00C2FF, #0088cc);
  color: #070B14;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 50px;
  padding: 12px 20px 12px 14px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 194, 255, 0.45), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  letter-spacing: 0.02em;
}
.chat-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 32px rgba(0, 194, 255, 0.6), 0 2px 8px rgba(0,0,0,0.3);
}
.chat-fab:active { transform: scale(0.97); }
.chat-fab .chat-fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Pulse ring */
.chat-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50px;
  border: 2px solid rgba(0, 194, 255, 0.5);
  animation: chat-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes chat-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}
/* Badge for unread */
.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #FF5064;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary, #070B14);
}
.chat-fab-badge.visible { display: flex; }

/* ── Chat Panel ──────────────────────────────────────────────────── */
.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--bg-card, #0F1623);
  border: 1px solid rgba(0, 194, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,194,255,0.06);
  z-index: 901;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
  backdrop-filter: blur(12px);
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── Panel Header ────────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,194,255,0.12);
  background: linear-gradient(135deg, rgba(0,194,255,0.08), rgba(0,255,136,0.04));
  flex-shrink: 0;
  gap: 10px;
}
.chat-header-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #00C2FF, #0088cc);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #070B14;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary, #E8EAF0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.chat-header-subtitle {
  font-size: 11px;
  color: var(--text-muted, #5A6480);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.chat-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-green, #00FF88);
  font-weight: 600;
  font-size: 11px;
}
.chat-live-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-green, #00FF88);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.85);
  animation: chat-live-pulse 2s infinite ease-in-out;
  display: inline-block;
  flex-shrink: 0;
}
.chat-live-sep {
  color: var(--text-muted, #5A6480);
  font-size: 9px;
}
.chat-server-status {
  color: var(--text-secondary, #8892A4);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
@keyframes chat-live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.75); opacity: 0.45; }
}
.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chat-header-btn {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-secondary, #8892A4);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.chat-header-btn:hover { background: rgba(0,194,255,0.12); color: #00C2FF; }

/* ── Panel Tabs ──────────────────────────────────────────────────── */
.chat-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,194,255,0.1);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.chat-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted, #5A6480);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
  font-family: var(--font-heading, sans-serif);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.chat-tab-btn:hover { color: var(--text-secondary, #8892A4); }
.chat-tab-btn.active {
  color: #00C2FF;
}
.chat-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: #00C2FF;
  border-radius: 2px 2px 0 0;
}
.chat-tab-badge {
  background: #FF5064;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Auth Gate ───────────────────────────────────────────────────── */
.chat-auth-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 16px;
}
.chat-auth-gate-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(0,194,255,0.12), rgba(0,255,136,0.06));
  border: 1px solid rgba(0,194,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.chat-auth-gate h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #E8EAF0);
  margin: 0;
  font-family: var(--font-heading, sans-serif);
}
.chat-auth-gate p {
  font-size: 13px;
  color: var(--text-secondary, #8892A4);
  line-height: 1.6;
  margin: 0;
  max-width: 260px;
}
.chat-auth-gate .chat-preview {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,194,255,0.08);
  border-radius: 12px;
  padding: 12px;
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.chat-preview-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.chat-preview-avatar {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #00C2FF, #0088cc);
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-preview-bubble {
  background: rgba(0,194,255,0.1);
  border-radius: 0 12px 12px 12px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-secondary, #8892A4);
}
.chat-auth-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.chat-btn-signup {
  background: linear-gradient(135deg, #00C2FF, #0088cc);
  color: #070B14;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  transition: opacity 0.15s, transform 0.15s;
}
.chat-btn-signup:hover { opacity: 0.9; transform: translateY(-1px); }
.chat-btn-signin {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary, #8892A4);
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  transition: background 0.15s;
}
.chat-btn-signin:hover { background: rgba(255,255,255,0.09); }

/* ── Messages Area ───────────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,194,255,0.2); border-radius: 4px; }

/* Typing indicator */
.chat-typing {
  font-size: 11px;
  color: var(--text-muted, #5A6480);
  padding: 2px 12px 6px;
  min-height: 20px;
  flex-shrink: 0;
  font-style: italic;
}

/* ── Message Bubble ─────────────────────────────────────────────── */
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  animation: msg-pop 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes msg-pop {
  from { transform: scale(0.85) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.chat-msg.mine {
  flex-direction: row-reverse;
}
.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C2FF, #0088cc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #070B14;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-msg-body { max-width: 72%; display: flex; flex-direction: column; gap: 2px; }
.chat-msg.mine .chat-msg-body { align-items: flex-end; }
.chat-msg-username {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #5A6480);
  padding: 0 4px;
}
.chat-msg.mine .chat-msg-username { display: none; }
.chat-msg-bubble {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px 16px 16px 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary, #E8EAF0);
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.chat-msg.mine .chat-msg-bubble {
  background: linear-gradient(135deg, #00B4D8 0%, #7209B7 100%);
  border: none;
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 14px rgba(114, 9, 183, 0.25);
  font-weight: 450;
}
/* Reaction badge attached to message bubble */
.chat-msg-reaction-badge {
  position: absolute;
  bottom: -8px;
  right: 6px;
  background: var(--bg-card, #0F1623);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  cursor: pointer;
  z-index: 2;
}
.chat-msg.mine .chat-msg-reaction-badge {
  left: 6px;
  right: auto;
}

/* ── In-Chat Live Poll Cards (Photo 2) ─────────────────────────────── */
.chat-poll-card {
  background: linear-gradient(135deg, rgba(15, 22, 35, 0.95), rgba(24, 33, 53, 0.95));
  border: 1px solid rgba(0, 194, 255, 0.3);
  border-radius: 16px;
  padding: 14px;
  width: 100%;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-poll-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-poll-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #070B14;
}
.chat-poll-creator {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
}
.chat-poll-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}
.chat-poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-poll-option {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-poll-option:hover {
  background: rgba(0, 194, 255, 0.1);
  border-color: rgba(0, 194, 255, 0.35);
}
.chat-poll-option.voted {
  border-color: var(--accent-purple, #9D4EDD);
  background: rgba(157, 78, 221, 0.12);
}
.chat-poll-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(0, 194, 255, 0.35), rgba(157, 78, 221, 0.45));
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}
.chat-poll-opt-text {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.chat-poll-opt-pct {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: monospace;
}
.chat-poll-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
}
/* Sticker bubble */
.chat-msg-bubble.is-sticker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 40px;
  padding: 4px 8px;
  line-height: 1;
}
/* Image bubble */
.chat-msg-bubble.is-image {
  padding: 4px;
  background: rgba(0,0,0,0.2);
}
.chat-msg-bubble.is-image img {
  max-width: 220px;
  max-height: 160px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}
.chat-msg-time {
  font-size: 9px;
  color: var(--text-muted, #5A6480);
  padding: 0 4px;
  align-self: flex-end;
}
.chat-msg.mine .chat-msg-time { align-self: flex-end; }

/* ── Sticker Tray ────────────────────────────────────────────────── */
.chat-sticker-tray {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(0,194,255,0.08);
  flex-shrink: 0;
}
.chat-sticker-tray.open { display: flex; }
.chat-sticker-btn {
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
  line-height: 1;
}
.chat-sticker-btn:hover {
  transform: scale(1.3) rotate(-5deg);
  background: rgba(0,194,255,0.1);
}
.chat-sticker-btn:active { transform: scale(1.1); }

/* ── Plus Menu (Image upload) ────────────────────────────────────── */
.chat-plus-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(0,194,255,0.08);
  flex-shrink: 0;
}
.chat-plus-menu.open { display: flex; }
.chat-plus-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--text-secondary, #8892A4);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.chat-plus-option:hover { background: rgba(0,194,255,0.09); color: #00C2FF; }
.chat-plus-option svg { flex-shrink: 0; }

/* ── Input Bar ───────────────────────────────────────────────────── */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0,194,255,0.1);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.chat-input-action-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted, #5A6480);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.chat-input-action-btn:hover { background: rgba(0,194,255,0.12); color: #00C2FF; transform: scale(1.08); }
.chat-input-action-btn.active { background: rgba(0,194,255,0.18); color: #00C2FF; }
.chat-input-field {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(0,194,255,0.14);
  border-radius: 20px;
  color: var(--text-primary, #E8EAF0);
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  resize: none;
}
.chat-input-field::placeholder { color: var(--text-muted, #5A6480); }
.chat-input-field:focus { border-color: rgba(0,194,255,0.4); }
.chat-send-btn {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #00C2FF, #0088cc);
  border: none;
  border-radius: 50%;
  color: #070B14;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(0,194,255,0.3);
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 4px 14px rgba(0,194,255,0.5); }
.chat-send-btn:active { transform: scale(0.95); }

/* ── Hidden file input ───────────────────────────────────────────── */
#chat-img-input { display: none; }

/* Image preview strip above input */
.chat-img-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(0,194,255,0.08);
  flex-shrink: 0;
}
.chat-img-preview.visible { display: flex; }
.chat-img-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0,194,255,0.2);
}
.chat-img-remove {
  background: rgba(255,80,100,0.12);
  border: 1px solid rgba(255,80,100,0.25);
  color: #FF5064;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ── Friends Panel ───────────────────────────────────────────────── */
.chat-friends-panel {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.chat-friends-panel::-webkit-scrollbar { width: 4px; }
.chat-friends-panel::-webkit-scrollbar-thumb { background: rgba(0,194,255,0.2); border-radius: 4px; }
.chat-friends-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted, #5A6480);
  padding: 12px 14px 6px;
}
.chat-friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.chat-friend-item:hover { background: rgba(0,194,255,0.04); }
.chat-friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C2FF, #00FF88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #070B14;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-friend-info { flex: 1; min-width: 0; }
.chat-friend-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #E8EAF0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-friend-sub {
  font-size: 11px;
  color: var(--text-muted, #5A6480);
  margin-top: 1px;
}
.chat-friend-actions { display: flex; gap: 5px; }
.chat-friend-btn {
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  font-family: inherit;
}
.chat-friend-btn.accept {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.3);
  color: #00FF88;
}
.chat-friend-btn.accept:hover { background: rgba(0,255,136,0.2); }
.chat-friend-btn.decline {
  background: rgba(255,80,100,0.08);
  border-color: rgba(255,80,100,0.25);
  color: #FF5064;
}
.chat-friend-btn.decline:hover { background: rgba(255,80,100,0.16); }
.chat-friend-btn.follow {
  background: rgba(0,194,255,0.1);
  border-color: rgba(0,194,255,0.3);
  color: #00C2FF;
}
.chat-friend-btn.follow:hover { background: rgba(0,194,255,0.2); }
.chat-friend-btn.following {
  background: rgba(0,255,136,0.08);
  border-color: rgba(0,255,136,0.2);
  color: #00FF88;
}
.chat-friend-btn.request-sent {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-muted, #5A6480);
  cursor: default;
}

/* Empty state inside panel */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 10px;
  color: var(--text-muted, #5A6480);
  font-size: 13px;
}
.chat-empty-icon {
  font-size: 36px;
  margin-bottom: 4px;
}

/* ── Day Dividers ────────────────────────────────────────────────── */
.chat-day-divider {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #5A6480);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  position: relative;
  margin: 8px 0;
}
.chat-day-divider::before,
.chat-day-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 26%;
  height: 1px;
  background: rgba(255,255,255,0.07);
}
.chat-day-divider::before { left: 0; }
.chat-day-divider::after { right: 0; }

/* System message */
.chat-sys-msg {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted, #5A6480);
  background: rgba(0,194,255,0.05);
  border-radius: 12px;
  padding: 4px 12px;
  margin: 4px auto;
  max-width: 80%;
}

/* ── Profile Social Tab (in profile.html) ────────────────────────── */
.social-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}
.social-stat {
  text-align: center;
  cursor: pointer;
}
.social-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary, #E8EAF0);
  font-family: var(--font-heading, 'Outfit', sans-serif);
}
.social-stat-label {
  font-size: 11px;
  color: var(--text-muted, #5A6480);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}
.social-user-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.social-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card, #0F1623);
  border: 1px solid var(--border-card, rgba(255,255,255,0.06));
  border-radius: 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.social-user-item:hover { border-color: rgba(0,194,255,0.2); }
.social-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C2FF, #00FF88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #070B14;
  flex-shrink: 0;
  overflow: hidden;
}
.social-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.social-user-info { flex: 1; }
.social-user-name { font-size: 14px; font-weight: 600; color: var(--text-primary, #E8EAF0); }
.social-user-id { font-size: 11px; color: var(--text-muted, #5A6480); margin-top: 2px; }
.friend-request-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0,194,255,0.04);
  border: 1px solid rgba(0,194,255,0.14);
  border-radius: 14px;
  margin-bottom: 10px;
}
.friend-request-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    height: 75vh;
    max-height: 75vh;
  }
  .chat-fab { bottom: 20px; right: 16px; }
}

/* ── Clickable user header & avatar ── */
.chat-msg-avatar, .chat-msg-username {
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.chat-msg-avatar:hover {
  transform: scale(1.08);
}
.chat-msg-username:hover {
  color: var(--accent-blue, #00C2FF);
  text-decoration: underline;
}

/* ── Quoted Reply Preview inside bubble ── */
.chat-reply-quote {
  background: rgba(0, 0, 0, 0.28);
  border-left: 3px solid var(--accent-blue, #00C2FF);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-secondary, #8892A4);
  cursor: pointer;
}
.chat-reply-quote-user {
  font-weight: 700;
  color: var(--accent-blue, #00C2FF);
  font-size: 10px;
  margin-bottom: 2px;
}
.chat-reply-quote-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ── Message Action Footer (Likes + Reply + Time) ── */
.chat-msg-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 0 4px;
}
.chat-msg.mine .chat-msg-footer {
  justify-content: flex-end;
}
.chat-action-btn {
  background: none;
  border: none;
  color: var(--text-muted, #5A6480);
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.chat-action-btn:hover {
  color: var(--text-primary, #E8EAF0);
  background: rgba(255, 255, 255, 0.06);
}
.chat-like-btn.liked {
  color: #FF5064 !important;
}
.chat-like-btn.liked svg {
  fill: #FF5064;
  stroke: #FF5064;
}

/* ── Active Reply Bar above input ── */
.chat-reply-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0, 194, 255, 0.08);
  border-top: 1px solid rgba(0, 194, 255, 0.18);
  font-size: 11px;
  color: var(--text-secondary, #8892A4);
}
.chat-reply-bar.visible {
  display: flex;
}
.chat-reply-bar-text {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-reply-bar-close {
  background: none;
  border: none;
  color: var(--text-muted, #5A6480);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
}
.chat-reply-bar-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.1);
}

/* ── User Profile Card Modal ── */
.user-profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.user-profile-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.user-profile-card {
  background: var(--bg-card, #0F1623);
  border: 1px solid rgba(0, 194, 255, 0.25);
  border-radius: 20px;
  width: 360px;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 32px rgba(0,194,255,0.15);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.user-profile-modal-overlay.open .user-profile-card {
  transform: translateY(0) scale(1);
}
.user-profile-banner {
  height: 90px;
  background: linear-gradient(135deg, rgba(0,194,255,0.3), rgba(0,255,136,0.2));
  position: relative;
}
.user-profile-banner-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-profile-body {
  padding: 0 20px 20px;
  position: relative;
  text-align: center;
}
.user-profile-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid var(--bg-card, #0F1623);
  background: linear-gradient(135deg, #00C2FF, #00FF88);
  margin: -38px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #070B14;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.user-profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #E8EAF0);
  margin-bottom: 2px;
}
.user-profile-sub-count {
  font-size: 12px;
  color: var(--text-muted, #5A6480);
  margin-bottom: 12px;
}
.user-profile-bio {
  font-size: 12px;
  color: var(--text-secondary, #8892A4);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 0 8px;
}
.user-profile-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.btn-subscribe {
  background: #FF0033 !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 8px 18px !important;
  font-size: 12px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-subscribe:hover {
  background: #CC0029 !important;
  transform: translateY(-1px);
}
.btn-subscribe.subscribed {
  background: rgba(255,255,255,0.12) !important;
  color: var(--text-secondary, #8892A4) !important;
}
.btn-subscribe.subscribed:hover {
  background: rgba(255,50,50,0.2) !important;
  color: #FF5064 !important;
}

/* ══════════════════════════════════════════════════════════════════
   🎨 Redesigned Guest Chat Showcase (Artwork, Badges & Neon CTAs)
   ══════════════════════════════════════════════════════════════════ */
.chat-guest-showcase {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  background: var(--bg-card, #0F1623);
}

.chat-guest-banner-visual {
  position: relative;
  height: 140px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 194, 255, 0.2);
}

.chat-guest-live-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid rgba(0, 255, 136, 0.4);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-green, #00FF88);
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
}

.chat-guest-avatars-cluster {
  display: flex;
  align-items: center;
  gap: -6px;
}

.guest-avatar-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f2d48, #0b1220);
  border: 2px solid #070B14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  margin-right: -6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.guest-avatar-bubble.g-av-1 { background: linear-gradient(135deg, #00C2FF, #0055ff); }
.guest-avatar-bubble.g-av-2 { background: linear-gradient(135deg, #FF0055, #990033); }
.guest-avatar-bubble.g-av-3 { background: linear-gradient(135deg, #00FF88, #008844); }
.guest-avatar-bubble.g-av-4 { background: linear-gradient(135deg, #FFB400, #cc7700); }

.guest-avatars-label {
  margin-left: 14px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 8px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.chat-guest-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.chat-guest-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  line-height: 1.3;
}

.chat-guest-desc {
  font-size: 12px;
  color: var(--text-secondary, #8892A4);
  line-height: 1.45;
  margin: 0;
}

.chat-guest-perks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
}

.guest-perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guest-perk-item .perk-icon {
  font-size: 16px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 194, 255, 0.1);
  border: 1px solid rgba(0, 194, 255, 0.2);
  border-radius: 8px;
  flex-shrink: 0;
}

.guest-perk-item .perk-text {
  display: flex;
  flex-direction: column;
}

.guest-perk-item .perk-text strong {
  font-size: 12px;
  color: var(--text-primary, #F0F4FC);
}

.guest-perk-item .perk-text span {
  font-size: 10px;
  color: var(--text-muted, #556277);
}

.chat-guest-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.chat-guest-btn-signup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #00FF88, #00C2FF) !important;
  color: #070B14 !important;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-guest-btn-signup:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 255, 136, 0.5);
}

.chat-guest-btn-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: var(--text-primary, #F0F4FC) !important;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.chat-guest-btn-signin:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--accent-blue, #00C2FF) !important;
  color: #fff !important;
}

.chat-guest-guarantee {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted, #556277);
  margin-top: 2px;
}

/* ── Role & Tier Badges ───────────────────────────────────────────── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.3;
}
.badge-admin {
  background: linear-gradient(135deg, #FF5064, #FF007A);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(255, 80, 100, 0.4);
}
.badge-moderator, .badge-mod {
  background: linear-gradient(135deg, #00C2FF, #8B5CF6);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.4);
}
.badge-vip {
  background: linear-gradient(135deg, #FFD700, #FF8800);
  color: #070B14;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}
.badge-pro {
  background: linear-gradient(135deg, #00FF88, #00C2FF);
  color: #070B14;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

/* ── Chat Room Switcher Pills ────────────────────────────────────── */
.chat-room-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-room-switcher::-webkit-scrollbar { display: none; }
.chat-room-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #8892A4);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.chat-room-pill:hover {
  background: rgba(0, 194, 255, 0.12);
  border-color: rgba(0, 194, 255, 0.3);
  color: var(--text-primary, #fff);
}
.chat-room-pill.active {
  background: linear-gradient(135deg, rgba(0,194,255,0.25), rgba(0,255,136,0.15));
  border-color: var(--accent-blue, #00C2FF);
  color: #fff;
}

/* ── Chat Message Search Bar ─────────────────────────────────────── */
.chat-search-bar {
  display: none;
  align-items: center;
  padding: 6px 12px;
  background: rgba(7, 11, 20, 0.95);
  border-bottom: 1px solid rgba(0, 194, 255, 0.2);
}
.chat-search-bar.open { display: flex; }
.chat-search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-primary, #fff);
  font-size: 12px;
  outline: none;
}
.chat-search-input:focus {
  border-color: var(--accent-blue, #00C2FF);
}
.chat-search-close {
  background: none;
  border: none;
  color: var(--text-muted, #8892a4);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
}

/* ── Message Reactions Strip ─────────────────────────────────────── */
.chat-reactions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-secondary, #B0B8C6);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-reaction-pill:hover {
  background: rgba(0, 194, 255, 0.15);
  border-color: rgba(0, 194, 255, 0.4);
}
.chat-reaction-pill.reacted {
  background: rgba(0, 194, 255, 0.2);
  border-color: var(--accent-blue, #00C2FF);
  color: #fff;
}

/* ── Reaction Picker Flyout ──────────────────────────────────────── */
.chat-reaction-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--bg-card, #0F1623);
  border: 1px solid rgba(0, 194, 255, 0.3);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 100;
}
.chat-reaction-picker-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: transform 0.15s ease;
}
.chat-reaction-picker-btn:hover {
  transform: scale(1.3);
}

/* ── Report Modal ────────────────────────────────────────────────── */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.report-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.report-modal-card {
  background: var(--bg-card, #0F1623);
  border: 1px solid rgba(255, 80, 100, 0.4);
  border-radius: 20px;
  width: 420px;
  max-width: 100%;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 32px rgba(255, 80, 100, 0.15);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.report-modal-overlay.open .report-modal-card {
  transform: translateY(0) scale(1);
}

/* ── 📱 Responsive Mobile Layout (<600px) ────────────────────────── */
@media (max-width: 600px) {
  .chat-fab {
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 12px;
  }
  
  .chat-panel {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 85vh !important;
    max-height: calc(100vh - 60px) !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    transform: translateY(100%) !important;
  }
  
  .chat-panel.open {
    transform: translateY(0) !important;
  }
  
  .chat-panel-header {
    padding: 12px 14px;
  }
  
  .chat-panel-body {
    padding: 10px;
  }
  
  .chat-input-wrapper {
    padding: 8px 10px;
  }

  .user-profile-card {
    width: 100% !important;
    max-width: 340px;
    border-radius: 16px;
  }
}


