/* ============================================
   Echtz — Premium Design System v6
   ============================================ */

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a2e;
  --surface-3: #22223a;
  --border: rgba(124, 58, 237, 0.15);
  --border-subtle: rgba(255,255,255,0.06);
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-glow: rgba(124, 58, 237, 0.25);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.2);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --glass-bg: rgba(18, 18, 26, 0.85);
  --glass-border: rgba(255,255,255,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --header-h: 56px;
  --sidebar-w: 280px;
  --font: 'Inter', -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition: 200ms ease;
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #e2e8f0;
  --border: rgba(124, 58, 237, 0.12);
  --border-subtle: rgba(0,0,0,0.06);
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255,255,255,0.85);
  --glass-border: rgba(0,0,0,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.hidden { display: none !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.message-highlight {
  padding: 12px;
  border-left: 4px solid var(--highlight-color);
  background: rgba(var(--highlight-color-rgb), 0.1);
  border-radius: 4px;
  margin: 8px 0;
}

img { max-width: 100%; display: block; }

/* Glass Effects */
.modal { 
  background: var(--glass-bg); 
  backdrop-filter: blur(20px); 
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); 
  border-radius: 24px; 
  box-shadow: 0 20px 50px rgba(0,0,0,0.5); 
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes modal-pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 800px; }
.modal-header { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); background: rgba(255,255,255,0.02); }
.modal-body { padding: 20px 24px; }

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.glass-surface {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--error); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* YouTube Search Panel */
.yt-search-panel { 
  top: 60px; right: 0; width: 320px; max-height: 500px;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; z-index: 2100;
  animation: popoverFadeIn 0.2s ease-out; overflow: hidden;
}
.yt-results-grid { max-height: 380px; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.yt-result-item { 
  display: flex; gap: 10px; padding: 8px; cursor: pointer; 
  border-radius: var(--radius-sm); border-bottom: 1px solid var(--border-subtle); 
  align-items: center; transition: background 0.2s;
}
.yt-result-item:hover { background: var(--surface-2); }
.yt-result-thumb { width: 90px; height: 50px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.yt-result-title { flex: 1; font-size: 11px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }

/* YT Embed in Chat */
.yt-embed { 
  margin: 12px 0; border-radius: 12px; overflow: hidden; background: #000; 
  aspect-ratio: 16/9; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
.yt-embed iframe { width: 100%; height: 100%; border: none; }

.status-mute { margin-left: 5px; font-size: 14px; position: relative; top: 1px; color: var(--error); filter: drop-shadow(0 0 2px var(--error)); }
.user-item-offline .status-dot { opacity: 0.5; }
.user-item-avatar i { font-size: 12px; margin-left: 5px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition); position: relative; font-size: 16px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn-sm { width: 32px; height: 32px; font-size: 14px; }

.badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--error); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
}

.btn-report-alert {
  color: var(--error) !important;
  border-color: var(--error) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.input-wrapper {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 0 12px;
  transition: border-color var(--transition);
}
.input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.input-wrapper i { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.input-wrapper input, .input-wrapper select {
  flex: 1; background: none; border: none; color: var(--text);
  font-family: var(--font); font-size: 14px; padding: 10px 0; outline: none; width: 100%;
}
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper select { cursor: pointer; }
.input-wrapper select option { background: var(--surface); color: var(--text); }

/* Global modal input styling */
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body input[type="email"],
.modal-body select,
.modal-body textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}
.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body input[type="number"]:focus,
.modal-body input[type="email"]:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.modal-body input::placeholder,
.modal-body textarea::placeholder { color: var(--text-muted); }

/* Modern Input — Premium & Consistent */
.modern-input, .bio-textarea, #dm-input {
  width: 100%;
  background: var(--surface-2) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  outline: none !important;
  transition: all 0.2s !important;
}
.modern-input:focus, .bio-textarea:focus, #dm-input:focus {
  border-color: var(--primary) !important;
  background: var(--surface-3) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}
.modern-input {
  width: 100%;
  background: var(--surface-2) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  outline: none !important;
  transition: all 0.2s !important;
}
.modern-input:focus {
  border-color: var(--primary) !important;
  background: var(--surface-3) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Custom Checkbox Styling — Modern & Premium */
.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
}

.custom-checkbox {
  position: relative;
  width: 22px;
  height: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lightbox-img-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

#lightbox-img, #lightbox-video {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: lightbox-zoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-video {
  position: relative;
  max-width: 250px;
  cursor: pointer;
}
.message-video video {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}
.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.2);
}

.form-group-checkbox:hover .custom-checkbox {
  border-color: var(--primary);
  background: var(--surface-3);
}

.form-group-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }

.form-group-checkbox input:checked ~ .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.custom-checkbox::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  display: none;
}

.form-group-checkbox input:checked ~ .custom-checkbox::after {
  display: block;
}

/* Voice Message UI — Premium Acrylic */
.voice-msg-player {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  margin-top: 8px;
  width: fit-content;
  min-width: 200px;
  max-width: 300px;
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s;
}
.voice-msg-player:hover { transform: scale(1.02); background: var(--surface-3); }

.voice-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--primary-glow);
  transition: all 0.2s;
}
.voice-play-btn:hover { transform: scale(1.1); filter: brightness(1.1); }

.voice-waveform {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.voice-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s linear;
}

/* Pinned Message Bar — Sticky & Elegant */
.pinned-msg-bar {
  background: var(--surface-2);
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 16px;
  z-index: 101;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: sticky;
  top: 0;
}
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pinned-msg-icon { color: var(--primary); font-size: 16px; animation: pulse 2s infinite; }
.pinned-msg-content { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.unpin-btn { 
  font-size: 16px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-muted); cursor: pointer; background: transparent; border: none; transition: all 0.2s;
}
.unpin-btn:hover { background: var(--surface-3); color: var(--error); transform: rotate(90deg); }

.link-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 13px; font-family: var(--font); transition: color var(--transition);
}
.link-btn:hover { color: var(--primary); }
.link-btn strong { color: var(--primary); }

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.auth-background {
  position: absolute; inset: 0; background: var(--bg); overflow: hidden;
}
.auth-glow {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.4;
  animation: glowFloat 8s ease-in-out infinite;
}
.auth-glow-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: -100px; }
.auth-glow-2 { width: 350px; height: 350px; background: var(--accent); bottom: -80px; right: -80px; animation-delay: -3s; }
.auth-glow-3 { width: 250px; height: 250px; background: #ec4899; top: 50%; left: 50%; animation-delay: -5s; }

@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

.auth-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }
.auth-card { padding: 32px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon { font-size: 48px; margin-bottom: 8px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.auth-title { font-family: var(--font-display); font-size: 32px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }

/* ============================================
   APP LAYOUT
   ============================================ */
.app { 
  display: flex; flex-direction: column; 
  height: 100vh; height: 100dvh; 
  width: 100%; overflow: hidden; 
  position: fixed; top: 0; left: 0; 
}

.app-header {
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; border-bottom: 1px solid var(--border-subtle); z-index: 100;
  flex-shrink: 0;
}
.header-left, .header-right { display: flex; align-items: center; gap: 4px; }
.header-logo { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.logo-icon { font-size: 20px; }
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 18px; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header-center { flex: 1; display: flex; justify-content: center; }
.current-room-info { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: var(--radius-full); background: var(--surface-2); }
.room-icon { font-size: 16px; }
.room-name { font-weight: 600; font-size: 14px; }
.room-users-count { font-size: 12px; color: var(--text-muted); }

/* Coins Display */
.coins-display {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-radius: var(--radius-full); font-weight: 800; font-size: 13px;
  color: #ffcc00; cursor: pointer;
  background: rgba(255, 204, 0, 0.1); 
  border: 1px solid rgba(255, 204, 0, 0.3);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.1);
  transition: all var(--transition);
}
.coins-display:hover { background: rgba(255, 204, 0, 0.15); transform: translateY(-1px); }
.coins-display i { color: #ffcc00; filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.4)); }

.avatar-btn {
  position: relative; width: 36px; height: 36px; border: none; border-radius: 50%;
  cursor: pointer; background: none; padding: 0;
}
.avatar {
  border-radius: 50%; object-fit: cover;
  background: var(--surface-3);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 96px; height: 96px; }

.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--surface); position: absolute; bottom: 0; right: 0;
}
.status-online { background: var(--success); }
.status-away { background: var(--warning); }
.status-busy { background: var(--error); }
.status-invisible { background: var(--text-muted); }
.status-offline { background: var(--text-muted); }

.app-body { display: flex; flex: 1; overflow: hidden; }

/* ============================================
   ANNOUNCEMENTS BAR
   ============================================ */
.announcements-bar {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(245, 158, 11, 0.05);
}
.announcements-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; cursor: pointer; transition: background var(--transition);
  font-size: 12px;
}
.announcements-bar-inner:hover { background: rgba(245, 158, 11, 0.08); }
.announcement-latest {
  display: flex; align-items: center; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.announcements-content {
  padding: 8px 16px; border-top: 1px solid var(--border-subtle);
  max-height: 200px; overflow-y: auto;
}
.announcement-item {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.announcement-item:hover {
  background: rgba(255,255,255,0.03);
  border-bottom-color: var(--primary);
}

/* ============================================
   SIDEBARS
   ============================================ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle); overflow: hidden;
  transition: transform 0.3s ease, width 0.3s ease;
}
.sidebar-right { border-right: none; border-left: 1px solid var(--border-subtle); }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.sidebar-header-actions { display: flex; gap: 4px; }
.sidebar-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 8px; }

.sidebar-tabs {
  display: flex; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
  background: var(--surface); padding: 0;
}
.tab-btn {
  flex: 1; padding: 10px 8px; background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); text-transform: uppercase; letter-spacing: 0.5px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.tab-btn:hover { color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Room List */
.room-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
}
.room-item:hover { background: var(--surface-2); }
.room-item.badge { position: absolute; background: var(--error); border: 2px solid var(--bg); border-radius: var(--radius-full); min-width: 18px; padding: 0 4px; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* Coin Styling (No Background, Professional Gold) */
.coin-text { color: #ffcc00 !important; font-weight: 800; text-shadow: 0 0 5px rgba(255,204,0,0.2); background: transparent !important; }
.fa-coins, .fa-gem, .fa-crown { color: #ffcc00 !important; background: transparent !important; }
.user-stats-item, .coins-display { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 8px !important; }

/* Mod-Log Card Styling */
.log-list { display: flex; flex-direction: column; gap: 12px; padding: 10px; }
.log-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s;
}
.log-card:hover { transform: translateY(-2px); border-color: var(--primary); }.drawing-controls { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 12px; 
  padding: 12px; 
  background: var(--surface-2); 
  border-radius: 12px;
  margin-bottom: 12px;
}
.drawing-control-item { display: flex; flex-direction: column; gap: 4px; }
.drawing-control-item label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* Custom Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  outline: none;
  margin: 10px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}
.log-card-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; margin-bottom: 4px; }
.log-card-body { font-size: 13px; line-height: 1.4; }
.log-card-footer { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; }
.log-label { font-weight: 800; text-transform: uppercase; font-size: 10px; color: var(--primary); margin-right: 6px; }

/* Universal Modal Input Styling */
.modal-body :is(input[type="text"], input[type="number"], input[type="password"], select, textarea) {
  width: 100%; padding: 12px 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 14px; transition: border-color var(--transition);
}
.modal-body :is(input, select, textarea):focus { border-color: var(--primary); outline: none; background: rgba(255,255,255,0.08); }

/* Mod-Action Modal Fix */
#mod-action-modal .modal { max-width: 480px; width: 92%; }
#mod-action-modal .modal-body { padding: 32px; overflow-x: hidden; display: flex; flex-direction: column; gap: 4px; }
#mod-action-modal .form-row { flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }

/* Profile Edit & Settings Tab Spacing - Removed inner padding, added Margin */
.profile-tab-pane { transition: all 0.3s ease; padding: 15px !important; }
#profile-edit-tab, #profile-settings-tab { 
  margin: 0 !important; 
  padding: 15px !important;
  max-width: 100%;
  overflow-y: auto;
}
.profile-tab-pane .form-group input, 
.profile-tab-pane .form-group textarea, 
.profile-tab-pane .form-group select {
  background: var(--surface-2) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
}
@media (max-width: 768px) {
  #profile-edit-tab, #profile-settings-tab { padding: 15px !important; }
}

.settings-section { margin-bottom: 32px; }

.room-item.active { background: var(--primary-glow); border: 1px solid var(--primary); }
.room-item-icon { font-size: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: var(--radius-sm); flex-shrink: 0; overflow: hidden; }
.room-item.active .room-item-icon { background: var(--primary); }
.room-item-info { flex: 1; min-width: 0; }
.room-item-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-item-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-gear-btn { opacity: 0; transition: opacity var(--transition); flex-shrink: 0; }
.room-item:hover .room-gear-btn { opacity: 1; }

/* User List */
.user-list-divider {
  padding: 12px 16px 4px; font-size: 10px; font-weight: 800;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em;
}
.user-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
}
.user-item:hover { background: var(--surface-2); }
.user-item-offline { opacity: 0.45; }
.user-item-avatar { position: relative; flex-shrink: 0; }
.user-item-info { flex: 1; min-width: 0; }
.user-item-name { 
  font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 4px; 
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.user-item-mood { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; font-weight: 500; }

/* Rank Badges Fix */
.role-badge {
  display: inline-flex; align-items: center; height: 16px; padding: 0 8px; font-size: 9px;
  font-weight: 800; text-transform: uppercase; border-radius: 10px; color: #fff !important; line-height: 1;
}
.role-badge.role-owner { background: linear-gradient(135deg, #ff0000, #ff8c00); }
.role-badge.role-admin { background: linear-gradient(135deg, #7c3aed, #db2777); }
.role-badge.role-mod   { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.role-badge.role-vip   { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

/* Report Icon Alert */
.report-alert-active {
  color: var(--error) !important;
  animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
  0% { transform: scale(1); filter: drop-shadow(0 0 0px var(--error)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 5px var(--error)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--error)); }
}

/* Highlighted Message (Announcement Style in Chat) */
.message-highlight {
  margin: 16px 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.message-highlight-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}
.message-highlight-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.badge {
  position: absolute;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  z-index: 5;
}
.badge.hidden { display: none; }

/* ============================================
   CHAT AREA
   ============================================ */
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
.chat-messages-inner { 
  padding: 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 2px; 
  min-height: 100%; 
}
.load-more { text-align: center; padding: 12px; }

/* Message Bubbles */
.message {
  display: flex; gap: 10px; padding: 6px 0;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:translateY(0) } }
.message-avatar { flex-shrink: 0; cursor: pointer; }
.message-body { flex: 1; min-width: 0; }
.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.message-username { font-weight: 700; font-size: 13px; cursor: pointer; transition: color var(--transition); }
.message-username:hover { color: var(--primary); }
.message-time { font-size: 11px; color: var(--text-muted); }
.message-content { font-size: 14px; line-height: 1.6; word-wrap: break-word; color: var(--text); }
.message-content img { max-width: 320px; max-height: 300px; border-radius: var(--radius-sm); margin-top: 4px; cursor: pointer; }
.message-content a { color: var(--accent); }

.message-reply {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 4px;
  background: var(--surface-2); border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 12px; color: var(--text-muted);
}
.message-actions-menu {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.message:hover .message-actions-menu { 
  display: flex; 
  opacity: 1; 
  visibility: visible; 
  transform: translateY(-50%) translateX(0);
}
/* Enhanced Discoverability */
.message-actions-trigger {
  opacity: 0.7;
  transition: opacity 0.2s;
}
.message-actions-trigger:hover {
  opacity: 1;
  background: var(--surface-3) !important;
}

.context-menu {
  position: fixed;
  z-index: 5000;
  min-width: 180px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  animation: dropIn 0.15s ease;
}

.message-system-slim { 
  display: block; width: 100%; text-align: center; margin: 4px 0; 
  padding: 4px 10px; font-size: 11px; color: var(--text-muted); opacity: 0.8;
  font-family: inherit; font-weight: 500;
}
.message-system-slim span { background: rgba(255,255,255,0.02); border-radius: 20px; padding: 2px 10px; }
.message-system { display: block; text-align: center; margin: 12px 0; padding: 0 20px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.message-system i { margin-right: 4px; }

.message-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface-2); border-radius: var(--radius-sm); margin-top: 4px; }
.message-file i { color: var(--primary); }

.message-gif img { border-radius: var(--radius-sm); max-width: 250px; }

/* Chat Input */
.chat-input-area { 
  border-top: 1px solid var(--border-subtle); 
  padding: 10px 16px; 
  background: var(--bg); 
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
}
@media (max-width: 600px) {
  .chat-input-area { 
    padding: 10px; 
    padding-bottom: calc(env(safe-area-inset-bottom, 15px) + 8px); 
    background: var(--bg);
    border-top: 1px solid var(--border-subtle);
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 500;
    width: 100%;
  }
  .chat-messages {
    margin-bottom: 70px;
  }
}
.chat-input-wrapper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: var(--radius); padding: 4px 8px; }
.input-grow textarea { 
  width: 100%; background: none; border: none; color: var(--text); 
  font-family: var(--font); font-size: 14px; padding: 12px 4px; outline: none; 
  resize: none; scrollbar-width: none;
}
.input-grow textarea::placeholder { font-size: 13px; color: var(--text-muted); opacity: 0.7; }
.send-btn { color: var(--primary) !important; }
.send-btn:hover { background: var(--primary-glow) !important; }
.gif-label { font-size: 11px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip:text; }

.reply-preview {
  background: var(--surface-2); padding: 6px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; 
  position: relative; border-radius: 8px 8px 0 0; max-height: 36px;
}
.reply-preview-body { 
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-preview-body i { color: var(--primary); font-size: 9px; }

.typing-indicator { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 12px; color: var(--text-muted); }
.typing-dots { display: flex; gap: 3px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: typingDot 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal { width: 100%; animation: modalIn 0.3s ease; }
@keyframes modalIn { from{opacity:0;transform:scale(0.95) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }
.modal-sm { max-width: 300px; }
.modal-md { max-width: 380px; }
.modal-lg { max-width: 500px; max-height: 85vh; display: flex; flex-direction: column; }
@media (max-width: 480px) { .modal { max-width: 95vw; margin: 0; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.modal-header-actions { display: flex; align-items: center; gap: 8px; }
.modal-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
@media (min-width: 768px) {
  .modal-body { padding: 32px; }
}

.modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
@media (min-width: 768px) {
  .modal-footer { margin: 0; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; }
}

/* Shop Grid */
.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; padding: 4px;
}
.shop-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 20px; gap: 8px; border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}
.shop-item:hover { transform: translateY(-4px); border-color: var(--primary); }
.shop-item-icon { font-size: 32px; margin-bottom: 4px; }
.shop-item h4 { font-size: 15px; font-weight: 700; }
.shop-item p { font-size: 11px; color: var(--text-muted); }
.shop-item-price { font-weight: 800; color: var(--warning); margin: 8px 0; }
.shop-item.locked { opacity: 0.6; filter: grayscale(1); pointer-events: none; }

/* Bio Editor */
.bio-textarea {
  width: 100%; height: 260px; background: var(--surface-2);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--text); padding: 12px; font-family: var(--font);
  font-size: 14px; outline: none; resize: none; margin-top: 12px;
}
.bio-textarea:focus { border-color: var(--primary); }

/* Profile Grid & Achievements */
.achievement-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px;
}
.achievement-item {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
  font-size: 18px; color: var(--text-muted); transition: all 0.2s ease;
  position: relative;
}
.achievement-item.earned {
  color: var(--warning); background: var(--primary-glow); border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}
.achievement-item:hover .achievement-tooltip { opacity: 1; visibility: visible; transform: translateY(-5px); }
.achievement-tooltip {
  position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
  background: var(--surface-3); padding: 5px 10px; border-radius: 4px;
  font-size: 11px; white-space: nowrap; opacity: 0; visibility: hidden;
  transition: all 0.2s ease; z-index: 10; pointer-events: none; border: 1px solid var(--border);
}

/* Name Colors / Gradients */
.name-gradient-1 { background: linear-gradient(to right, #7c3aed, #06b6d4); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.name-gradient-2 { background: linear-gradient(to right, #f59e0b, #ef4444); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.name-gradient-3 { background: linear-gradient(to right, #ec4899, #8b5cf6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.name-gradient-4 { background: linear-gradient(to right, #10b981, #3b82f6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Message fading */
.message.fading { opacity: 0.5; transition: opacity 5s linear; }
.message.expired { opacity: 0; transform: scale(0.95); transition: all 0.5s ease; }

/* ============================================
   PROFILE MODAL OVERHAUL
   ============================================ */
.profile-header { text-align: center; padding-bottom: 16px; position: relative; }
.profile-cover { height: 100px; background: var(--gradient); border-radius: var(--radius-sm); margin: -20px -20px 0; position: relative; }
.profile-avatar-wrap { position: relative; width: 70px; height: 70px; margin: -35px auto 10px; z-index: 2; display: flex; justify-content: center; }
.profile-avatar-wrap .avatar { border: 3px solid var(--surface); width: 70px; height: 70px; background: var(--surface); }
.profile-name { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-top: 2px; }
.profile-badges { display: flex; justify-content: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.profile-info-grid { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-secondary); width: 100%; }
.profile-info-item { display: flex; align-items: center; gap: 6px; justify-content: center; }
.profile-info-item i { width: 12px; color: var(--primary); text-align: center; }
.admin-section { margin-top: 16px; padding: 10px; background: rgba(239, 68, 68, 0.05); border: 1px dashed var(--error); border-radius: var(--radius-sm); text-align: left; }
.admin-title { font-size: 11px; font-weight: 700; color: var(--error); text-transform: uppercase; margin-bottom: 6px; }

/* Bio Input in Edit Modal */
.bio-textarea-edit {
  width: 100%; height: 120px; background: var(--surface-2);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--text); padding: 12px; font-family: var(--font);
  font-size: 14px; outline: none; resize: none;
  transition: border-color var(--transition);
}
.bio-textarea-edit:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* Profile 3-dot menu */
.profile-menu-dots {
  position: absolute; top: 8px; right: 8px; z-index: 5;
}
.profile-menu-dots .icon-btn {
  background: rgba(0,0,0,0.4); color: #fff;
  border-radius: 50%; width: 28px; height: 28px; font-size: 12px;
}
.profile-menu-dots .icon-btn:hover { background: rgba(0,0,0,0.6); }
.profile-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  min-width: 180px; padding: 6px; z-index: 10;
  animation: dropIn 0.15s ease;
  background: var(--surface) !important;
  backdrop-filter: none !important;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow);
}

/* Profile Tabs */
.profile-tab-toggle {
  display: flex; gap: 4px; justify-content: center;
  background: var(--surface-2); border-radius: var(--radius-full); padding: 3px;
}
.profile-tab-btn {
  flex: 1; padding: 6px 16px; border: none; border-radius: var(--radius-full);
  background: transparent; color: var(--text-muted); font-family: var(--font);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.profile-tab-btn.active {
  background: var(--gradient); color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.profile-tab-btn:hover:not(.active) { color: var(--text); }

/* Profile likes hover */
.profile-likes-wrap:hover {
  background: var(--surface-3) !important;
  transform: scale(1.05);
}

/* ============================================
   DM LAYOUT (CodyChat Style)
   ============================================ */
.dm-layout { display: flex; height: 60vh; padding: 0 !important; }
.dm-list { width: 240px; border-right: 1px solid var(--border-subtle); overflow-y: auto; flex-shrink: 0; }
.dm-chat { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dm-chat-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.dm-partner-name { font-weight: 700; }
.dm-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.dm-input-area { padding: 12px; border-top: 1px solid var(--border-subtle); background: var(--bg); }
.dm-input-area .chat-input-wrapper { background: var(--surface-2); border-radius: var(--radius); padding: 4px 12px; }
.dm-input-area input { flex: 1; background: none; border: none; color: var(--text); padding: 10px 0; outline: none; font-size: 14px; }

.dm-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; transition: all var(--transition); border-bottom: 1px solid var(--border-subtle);
}
.dm-item:hover { background: var(--surface-2); }
.dm-item.active { background: var(--primary-glow); }
.dm-item-info { flex: 1; min-width: 0; }
.dm-item-name { font-weight: 600; font-size: 13px; }
.dm-item-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.dm.user-item { 
  display: flex; align-items: center; gap: 12px; padding: 10px 15px; 
  cursor: pointer; transition: background 0.2s; border-radius: 12px; margin: 2px 8px;
}
.user-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-item-name { 
  font-weight: 700; font-size: 13.5px; color: var(--text); 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.user-item-rank { 
  font-size: 10px; color: var(--text-muted); font-weight: 800; 
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.dm-item-time { font-size: 10px; color: var(--text-muted); }
.dm-item-badge { min-width: 18px; height: 18px; padding: 0 5px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; }

/* DM Messages (Bubble Style) */
.dm-message { display: flex; margin-bottom: 4px; animation: msgIn 0.2s ease; }
.dm-message-self { justify-content: flex-end; }
.dm-message-other { justify-content: flex-start; }

.dm-bubble {
  max-width: 75%; padding: 8px 14px; font-size: 14px; line-height: 1.5;
  word-wrap: break-word; position: relative;
}
.dm-bubble-other { background: var(--surface-2); color: var(--text); border-radius: 4px 16px 16px 16px; border: 1px solid var(--border-subtle); }
.dm-bubble-self { background: var(--primary); color: #fff; border-radius: 16px 16px 4px 16px; box-shadow: 0 4px 12px var(--primary-glow); }

/* Blockquote in Chat */
.message-reply-quote {
  padding: 6px 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}
.message-reply-quote:hover { background: rgba(255,255,255,0.06); }

/* RPS Game Overlay */
.game-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8); z-index: 1000002;
  display: flex; align-items: center; justify-content: center;
}
.game-card {
  width: 90%; max-width: 400px; padding: 32px; text-align: center;
}
.game-options { display: flex; gap: 20px; justify-content: center; margin-top: 24px; }
.game-opt-btn {
  font-size: 40px; background: var(--surface-2); border: 2px solid transparent;
  width: 80px; height: 80px; border-radius: 50%; cursor: pointer;
  transition: all 0.2s;
}
.game-opt-btn:hover { transform: scale(1.1); background: var(--surface-3); border-color: var(--primary); }

.dm-message-footer {
  display: flex; align-items: center; gap: 4px; justify-content: flex-end;
  margin-top: 2px;
}
.dm-message-time { font-size: 10px; opacity: 0.6; }
.dm-receipt { font-size: 10px; opacity: 0.6; }
.dm-receipt-read { color: #60a5fa !important; opacity: 1; }
.dm-bubble-other .dm-receipt-read { color: #3b82f6 !important; }

/* DM media */
.dm-message-media { margin-bottom: 4px; }
.dm-message-media img {
  max-width: 200px; max-height: 200px; border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ============================================
   REPORT MODAL
   ============================================ */
.report-reasons {
  display: flex; flex-direction: column; gap: 8px; margin-top: 6px;
}
.report-reason-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); font-size: 13px;
  border: 1px solid var(--border-subtle);
}
.report-reason-item:hover { border-color: var(--primary); background: var(--primary-glow); }
.report-reason-item input[type="radio"] {
  width: 14px; height: 14px; accent-color: var(--primary);
}

/* Report review items */
.report-item {
  padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm);
  margin-bottom: 8px; border: 1px solid var(--border-subtle);
}
.report-header {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-list { display: flex; flex-direction: column; gap: 2px; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--radius-sm); transition: all var(--transition); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-glow); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 14px; flex-shrink: 0; }
.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   DROPDOWNS & PICKERS
   ============================================ */
.dropdown-menu {
  position: fixed; z-index: 600; width: 260px; padding: 8px;
  animation: dropIn 0.2s ease;
}
@keyframes dropIn { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }
.dropdown-header { display: flex; align-items: center; gap: 12px; padding: 12px; }
.dropdown-header-info { min-width: 0; }
.dropdown-name { font-weight: 700; font-size: 14px; }
.dropdown-level { font-size: 11px; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.dropdown-section-title { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding: 8px 12px 4px; letter-spacing: 0.5px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; width: 100%;
  border: none; background: none; color: var(--text); font-family: var(--font);
  font-size: 13px; cursor: pointer; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item i { width: 16px; color: var(--text-muted); }
.dropdown-item .status-dot { position: static; border: none; width: 8px; height: 8px; }
.dropdown-item-danger { color: var(--error); }
.dropdown-item-danger i { color: var(--error); }

/* Context Menu */
.context-menu {
  position: fixed; z-index: 700; min-width: 180px; padding: 6px;
  animation: dropIn 0.15s ease;
}

/* Picker */
.picker-panel {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  width: 360px; max-height: 380px; z-index: 400; display: flex; flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.picker-header { padding: 10px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.picker-search { width: 100%; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 13px; outline: none; }
.picker-search:focus { border-color: var(--primary); }
.picker-grid { flex: 1; overflow-y: auto; padding: 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-item { font-size: 22px; padding: 4px; text-align: center; cursor: pointer; border-radius: 6px; transition: background var(--transition); border: none; background: none; }
.emoji-item:hover { background: var(--surface-2); transform: scale(1.2); }
.gif-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.gif-item { cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; transition: transform var(--transition); }
.gif-item:hover { transform: scale(1.03); }
.gif-item img { width: 100%; height: auto; display: block; }
.picker-footer { padding: 6px 10px; text-align: right; border-top: 1px solid var(--border-subtle); }
.picker-credit { font-size: 10px; color: var(--text-muted); }

/* ============================================
   TOASTS
   ============================================ */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  min-width: 280px; max-width: 400px; animation: toastIn 0.3s ease;
  font-size: 13px;
}
@keyframes toastIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }
.toast-success { border-left: 3px solid var(--success); }

/* Settings Tab Content */
.settings-tab-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.settings-section {
  padding: 15px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}

/* Muted Input Overlay */
.muted-input-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--error);
  font-weight: 700;
  font-size: 14px;
  z-index: 10;
  border-radius: var(--radius);
}

.toast-error { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--primary); }
.toast i { font-size: 16px; flex-shrink: 0; }
.toast-success i { color: var(--success); }
.toast-error i { color: var(--error); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--primary); }

/* Upload Progress */
.upload-progress { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 400; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px 20px; min-width: 240px; }
.upload-progress-bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: var(--gradient); border-radius: 2px; transition: width 0.3s ease; width: 0%; }
.upload-progress-text { display: block; text-align: center; margin-top: 6px; font-size: 11px; color: var(--text-muted); }

/* Empty State */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 14px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar-right { position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 200; transform: translateX(100%); transition: transform 0.3s ease; }
  .sidebar-right.open { transform: translateX(0); }
}
@media (max-width: 768px) {
  .sidebar-left { position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 200; transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar-left.open { transform: translateX(0); }
  .header-center { display: none; }
  .header-logo .logo-text { display: none; }
  .picker-panel { width: calc(100vw - 24px); bottom: 60px; }
  .dm-layout { flex-direction: column; }
  .dm-list { width: 100%; border-right: none; border-bottom: 1px solid var(--border-subtle); max-height: 200px; }
  .modal { margin: 0 12px; }

  /* Mobile chat fix: proper flex layout instead of position:fixed */
  .app-body { height: calc(100% - var(--header-h)); }
  .chat-area { height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }
  .chat-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .chat-input-area { 
    flex-shrink: 0; 
    padding: 12px 12px calc(40px + env(safe-area-inset-bottom, 0px)); /* Higher on mobile */
    background: var(--bg); 
    border-top: 1px solid var(--border-subtle); 
    position: relative; 
    z-index: 50; 
  }
  
  /* Ensure input is visible when keyboard is up */
  .chat-input-wrapper { padding: 4px 8px; }
  
  .dm-layout { height: 80vh; }
}
@media (max-width: 480px) {
  .form-row { flex-direction: column; gap: 0; }
  :root { --sidebar-w: 100vw; }
/* Media queries and other styles */
.settings-section { padding: 15px; }
.profile-edit-wrapper, .profile-settings-wrapper { padding: 15px; }
  .header-logo .logo-icon { font-size: 18px; }
  
  /* Better spacing for sections in modals */
  .admin-section { padding: 12px; margin: 10px 0; }
  .settings-section { padding: 15px; } /* Standardized to 15px */
  .message-content img { max-width: 100%; height: auto; }
  
  .profile-info-grid { font-size: 11px; }
}

/* Muted UI Overlay */
.muted-input-overlay {
  position: absolute; inset: 0; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); z-index: 10;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  gap: 8px; border: 1px solid var(--border-subtle);
}

/* Blocked / Kicked Screen CSS */
.blocked-screen {
  position: fixed; inset: 0; background: var(--bg); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.5s ease;
}
.blocked-content {
  max-width: 400px; width: 100%; padding: 40px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.blocked-icon { font-size: 64px; }
#blocked-title { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--error); }
.blocked-reason { color: var(--text-secondary); line-height: 1.6; }
.blocked-expiry { font-weight: 700; color: var(--primary); background: var(--primary-glow); padding: 8px 16px; border-radius: var(--radius-full); font-size: 13px; }
.kick-timer { font-size: 14px; font-weight: 600; color: var(--warning); }
#kick-countdown { font-size: 20px; font-weight: 800; }

/* Notification close fix */
#notif-modal .modal-header-actions { margin-right: -8px; }

/* DM CodyChat Style Overhaul */
.dm-popover {
  position: absolute; top: 70px; right: 20px; width: 340px; max-height: 500px;
  background: var(--surface) !important; 
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; z-index: 2000;
  animation: popoverFadeIn 0.2s ease-out; overflow: hidden;
  backdrop-filter: none !important;
}
.dm-popover-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); font-weight: 700;
}
.dm-popover-list { overflow-y: auto; flex: 1; max-height: 400px; }

.dm-sidepanel {
  position: fixed; top: 0; right: -420px; width: 420px; height: 100dvh;
  background: var(--surface); border-left: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; z-index: 2100;
  box-shadow: -15px 0 45px rgba(0,0,0,0.6);
  transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.dm-sidepanel.open { right: 0; }
@media (max-width: 600px) { .dm-sidepanel { width: 100%; right: -100%; } .dm-sidepanel.open { right: 0; } }

.dm-sidepanel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 14px; background: var(--surface-2);
}
.dm-sidepanel-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.dm-sidepanel-input { padding: 20px; border-top: 1px solid var(--border-subtle); background: var(--bg); }

@keyframes modal-pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.modal-actions, .modal-footer {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 16px 24px !important;
  background: rgba(0,0,0,0.03);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal-body { 
  max-height: 75vh; 
  overflow-y: auto; 
  padding: 15px;
  flex: 1;
  min-width: 0;
}
.profile-save-btn {
  padding: 8px 20px !important;
  min-width: 120px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#drawing-modal .modal-body { background: #1a1a1a !important; padding: 12px; display: flex; flex-direction: column; align-items: center; }
#drawing-canvas { max-width: 100%; height: auto; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dm-preview-item {
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: background 0.2s; border-bottom: 1px solid var(--border-subtle);
}
.dm-preview-item:hover { background: var(--surface-3); }
.dm-preview-item:last-child { border-bottom: none; }
.dm-preview-info { flex: 1; min-width: 0; }
.dm-preview-name { font-weight: 600; font-size: 13px; }
.dm-preview-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-preview-badge {
  background: var(--primary); color: white; border-radius: 50%;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
}

/* Sidebar Tabs */
.sidebar-tabs { display: flex; background: var(--surface-2); border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.sidebar-tabs .tab-btn { 
  flex: 1; padding: 12px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; 
  color: var(--text-muted); transition: all 0.2s; border: none; background: transparent !important; cursor: pointer;
  border-bottom: 2px solid transparent; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-tabs .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.sidebar-tabs .tab-btn:hover:not(.active) { color: var(--text); }

.sidebar-tab-content { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.sidebar-tab-content.hidden { display: none; }

/* Utility Dropdown */
.utility-dropdown {
  position: absolute;
  bottom: 80px; 
  left: 20px;
  width: 240px;
  background: var(--surface) !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 8px;
  animation: popoverFadeIn 0.2s ease-out;
}
.utility-dropdown .dropdown-header-sm {
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.utility-dropdown .dropdown-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}
.utility-dropdown .dropdown-item:hover {
  background: var(--surface-3);
  color: var(--primary);
  transform: translateX(4px);
}
.utility-dropdown .dropdown-item i {
  width: 16px;
  text-align: center;
}

.announcement-item {
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.announcement-item:hover { 
  transform: translateY(-2px); 
  outline: 2px solid var(--primary);
  box-shadow: 0 5px 20px rgba(124, 58, 237, 0.25);
}

/* ============================================
   IMAGE LIGHTBOX
   ============================================ */
#lightbox-modal {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000005;
  transition: opacity 0.3s ease;
}
#lightbox-modal.hidden { display: none !important; opacity: 0; pointer-events: none; }

#lightbox-modal .modal {
  max-width: 95vw;
  max-height: 90vh;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 12px;
  overflow: visible;
  padding: 0;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-img-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  cursor: zoom-out;
}

.lightbox-controls {
  position: absolute;
  top: -48px;
  right: 0;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.lightbox-btn {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}
.lightbox-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* ============================================
   STAFF REPORTS GRID
   ============================================ */
.report-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}
.report-actions-grid .btn {
  height: 34px;
  font-size: 11px;
  padding: 0 4px;
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}
.report-actions-grid .btn:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}
.report-actions-grid .btn-primary {
  background: var(--primary);
  border: none;
}
.report-actions-grid .btn-primary:hover {
  filter: brightness(1.1);
}
