/* Marcy Labs - Elite Community & Voice Forum Design System */
:root {
  --bg-dark: #080a10;
  --bg-surface: #0f121d;
  --bg-card: #161b2b;
  --bg-card-hover: #1e2439;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.4);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-code: 'Fira Code', monospace;
  
  --header-height: 64px;
  --sidebar-left-width: 280px;
  --sidebar-right-width: 290px;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Helper Text Classes */
.text-violet { color: var(--primary); }
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }
.text-green { color: #22c55e; }

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ==================== 1. TOP GLOBAL HEADER ==================== */
.top-header {
  height: var(--header-height);
  background: rgba(15, 18, 29, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #22c55e;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;

}
.status-dot.green {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 2s infinite;
}
.status-dot.idle { background: var(--accent-amber); }

@keyframes pulse-dot {
  0% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.6; transform: scale(0.95); }
}

.software-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* BUTTON STYLES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-glow-violet {
  background: linear-gradient(135deg, var(--primary), #6d28d9);
  color: #fff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}
.btn-glow-violet:hover {
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.6);
  transform: translateY(-1px);
}

.btn-store {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--text-main);
  position: relative;
}
.btn-store:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--primary);
}

.badge-discount {
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.6rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-weight: 800;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}
.user-profile-widget:hover {
  background: rgba(255, 255, 255, 0.07);
}

.user-avatar-wrapper {
  position: relative;
}

.user-avatar, .avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.username {
  font-size: 0.85rem;
  font-weight: 600;
}

/* BADGES */
.badge-vip { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }
.badge-owner { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-admin { background: rgba(6, 182, 212, 0.2); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.4); }
.badge-mod { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }

.badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ==================== 2. MAIN LAYOUT & LEFT SIDEBAR ==================== */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.left-sidebar {
  width: var(--sidebar-left-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.server-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.server-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.server-member-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Navigation Tabs */
.nav-section-tabs {
  display: flex;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.tab-btn {
  flex: 1;
  padding: 0.5rem;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.channels-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.channel-category {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 0 0.5rem;
}

.btn-icon-xs {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}
.btn-icon-xs:hover { color: var(--text-main); }

.channel-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.channel-item:hover, .channel-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}
.channel-item.active {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
  border-left: 3px solid var(--primary);
}

.unread-count {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}
.badge-ticket {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.lock-icon {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--accent-rose);
}

/* Voice Rooms Cards */
.voice-room-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.voice-room-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.voice-room-card.connected {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent-cyan);
}

.room-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.vc-user-count {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.vc-users-avatars {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 1.25rem;
}

.vc-user-avatar {
  position: relative;
  width: 26px;
  height: 26px;
}
.vc-user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Glowing Speaking Ring Animation */
.vc-user-avatar.speaking img {
  border: 2px solid var(--accent-cyan);
}
.speaking-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulse-speaking 1.2s infinite;
}

@keyframes pulse-speaking {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Voice Dock Bottom */
.voice-dock {
  background: rgba(10, 12, 20, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.voice-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.voice-status-bar.connected {
  background: rgba(16, 185, 129, 0.15);
}
.voice-status-bar.connected .voice-icon {
  color: var(--accent-emerald);
}

.vc-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vc-labels {
  display: flex;
  flex-direction: column;
}

.vc-connected-room {
  font-size: 0.75rem;
  font-weight: 700;
}
.vc-latency {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Audio Visualizer Mini */
.audio-visualizer-mini {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.audio-visualizer-mini .bar {
  width: 3px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 2px;
  transition: height 0.1s;
}
.voice-status-bar.connected .audio-visualizer-mini .bar {
  animation: bar-wave 0.8s infinite ease-in-out alternate;
}
.audio-visualizer-mini .bar:nth-child(2) { animation-delay: 0.2s; }
.audio-visualizer-mini .bar:nth-child(3) { animation-delay: 0.4s; }
.audio-visualizer-mini .bar:nth-child(4) { animation-delay: 0.1s; }

@keyframes bar-wave {
  0% { height: 3px; }
  100% { height: 14px; }
}

.voice-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.vc-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.vc-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.vc-btn.active-off {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

.btn-disconnect {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
}
.btn-disconnect:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* ==================== 3. CENTER CONTENT STAGE ==================== */
.center-content {
  flex: 1;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
}
.view-panel.active {
  display: flex;
}

/* Forum Hero Card */
.forum-hero-card {
  margin: 1.25rem;
  padding: 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%), var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-content {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-amber);
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}

.hero-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-item .number {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-cyan);
}
.stat-item .label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Forum Controls Bar */
.forum-controls-bar {
  padding: 0 1.25rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover, .pill.active {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  border-color: var(--primary);
}

.forum-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.45rem 0.85rem;
  width: 260px;
}
.forum-search-box i { color: var(--text-dim); font-size: 0.85rem; }
.forum-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.8rem;
  width: 100%;
}

/* Threads Feed Container */
.threads-feed {
  padding: 0 1.25rem 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.thread-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.thread-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.thread-card.pinned {
  border-left: 4px solid var(--accent-amber);
}

.vote-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  min-width: 44px;
}
.btn-vote {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-vote:hover { color: var(--primary); }
.vote-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.thread-main-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.thread-header-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.thread-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.thread-snippet {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-footer-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

/* ==================== 4. TEXT CHAT VIEW PANEL ==================== */
#chatViewPanel {
  background: var(--bg-dark);
}

.chat-header {
  height: 60px;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 18, 29, 0.5);
}

.chat-channel-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.channel-hash-icon {
  font-size: 1.2rem;
  color: var(--text-dim);
}

.chat-channel-info h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}
.channel-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-header-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.chat-messages-container {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-item {
  display: flex;
  gap: 0.85rem;
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.message-header .sender-name {
  font-size: 0.9rem;
  font-weight: 700;
}
.message-header .msg-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.message-text {
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 0.6rem 0.85rem;
  border-radius: 0 10px 10px 10px;
  border: 1px solid var(--border-color);
  max-width: 650px;
}

.code-block {
  background: #0d0f18;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.6rem;
  font-family: var(--font-code);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-top: 0.4rem;
  white-space: pre-wrap;
}

.typing-indicator-bar {
  padding: 0.25rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-input-wrapper {
  margin: 0 1.25rem 1.25rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-attach {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}
.btn-attach:hover { color: var(--primary); }

#chatInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
}

.chat-input-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-tool {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem;
}
.btn-tool:hover { color: var(--text-main); }

.btn-send {
  background: var(--primary);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-send:hover { background: var(--primary-hover); }

/* ==================== 5. RIGHT SIDEBAR ==================== */
.right-sidebar {
  width: var(--sidebar-right-width);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
}

.widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.widget-header h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-pill-green {
  font-size: 0.6rem;
  font-weight: 800;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.widget-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.store-item-preview {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}
.item-price { color: var(--accent-cyan); }

.item-tags {
  display: flex;
  gap: 0.3rem;
  font-size: 0.6rem;
}
.tag-status { color: #22c55e; background: rgba(34, 197, 94, 0.1); padding: 0.1rem 0.3rem; border-radius: 3px; }
.tag-feature { color: var(--text-dim); }

.btn-buy-sm {
  margin-top: 0.2rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.3rem;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.btn-buy-sm:hover {
  background: var(--primary);
}

/* Members Presence List */
.members-presence-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.presence-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.group-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.member-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.member-avatar-wrapper {
  position: relative;
}
.member-avatar-wrapper img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.member-details {
  display: flex;
  flex-direction: column;
}
.member-name-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.member-name {
  font-size: 0.8rem;
  font-weight: 600;
}
.member-custom-status {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ==================== 6. MODALS ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--primary-glow);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-card.modal-lg { max-width: 780px; }
.modal-card.modal-sm { max-width: 420px; }

@keyframes modal-pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.btn-close-modal:hover { color: #fff; }

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(10, 12, 20, 0.5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.form-row {
  display: flex;
  gap: 1rem;
}
.form-row .form-group { flex: 1; }

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.5rem 0;
}

/* Thread Detail View in Modal */
.thread-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.author-name { font-weight: 700; font-size: 0.9rem; }
.timestamp { font-size: 0.75rem; color: var(--text-dim); }

.thread-full-content {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
}

.thread-replies-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.replies-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.reply-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

.add-reply-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}
.add-reply-box textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem;
  color: var(--text-main);
}

/* Store Modal Grid */
.store-products-grid {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.product-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}
.product-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}
.card-ribbon {
  position: absolute;
  top: -10px;
  right: 15px;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}
.product-price {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
}
.product-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
}

.btn-rose {
  background: var(--accent-rose);
  color: #fff;
}
.btn-rose:hover {
  background: #e11d48;
}
.error-msg {
  color: var(--accent-rose);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}
