/* Astra Nexus - Cyber Aurora Dark Aesthetic */
:root {
  --bg-main: #060509;
  --bg-card: rgba(18, 16, 26, 0.72);
  --bg-card-hover: rgba(26, 23, 38, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(168, 85, 247, 0.4);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.35);
  --accent-neon: #a855f7;
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --glass-blur: blur(20px);
  --radius-pill: 9999px;
  --radius-card: 18px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

/* Custom Sleek Glass Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.25);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.55);
}

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
}

body {
  position: relative;
  width: 100vw;
}

/* Background Animated Aurora Waves */
.aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aurora-blob-1 {
  position: absolute;
  top: 15%;
  left: 20%;
  width: 55vw;
  height: 45vh;
  background: radial-gradient(ellipse at center, rgba(126, 34, 206, 0.38) 0%, rgba(88, 28, 135, 0.15) 50%, transparent 75%);
  filter: blur(70px);
  border-radius: 50%;
  animation: aurora-float 16s ease-in-out infinite alternate;
}

.aurora-blob-2 {
  position: absolute;
  top: 25%;
  right: 15%;
  width: 50vw;
  height: 40vh;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.12) 50%, transparent 75%);
  filter: blur(80px);
  border-radius: 50%;
  animation: aurora-float 22s ease-in-out infinite alternate-reverse;
}

.aurora-ribbon {
  position: absolute;
  top: 18%;
  left: 10%;
  right: 10%;
  height: 25vh;
  background: linear-gradient(135deg, transparent 20%, rgba(147, 51, 234, 0.25) 45%, rgba(79, 70, 229, 0.2) 65%, transparent 85%);
  filter: blur(55px);
  transform: rotate(-7deg) scale(1.1);
  animation: ribbon-pulse 12s ease-in-out infinite alternate;
}

@keyframes aurora-float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 20px) scale(1.08); }
  100% { transform: translate(40px, -25px) scale(0.95); }
}

@keyframes ribbon-pulse {
  0% { opacity: 0.7; transform: rotate(-8deg) scale(1.0); }
  50% { opacity: 0.95; transform: rotate(-5deg) scale(1.1); }
  100% { opacity: 0.75; transform: rotate(-9deg) scale(1.05); }
}

/* App Container */
.app-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

/* Top Floating Pill Navigation Bar */
.top-nav-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px 8px;
  position: relative;
  z-index: 50;
}

.nav-pill {
  display: flex;
  align-items: center;
  background: rgba(18, 16, 26, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 5px 8px;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(139, 92, 246, 0.08);
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.badge-dot.idle {
  background: #6b7280;
  box-shadow: none;
}

/* Hidden elements for regular users */
.admin-only-item {
  display: none !important;
}

.is-developer .admin-only-item {
  display: flex !important;
}

.mod-only-item {
  display: none !important;
}

.is-developer .mod-only-item,
.is-moderator .mod-only-item {
  display: flex !important;
}

/* Main Content Area */
.main-layout {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 4px 20px 14px;
  gap: 16px;
  box-sizing: border-box;
}

/* Left Sidebar / Channels Drawer */
.sidebar {
  width: 290px;
  flex-shrink: 0;
  height: 100%;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
}

.sidebar.collapsed {
  display: none;
}

.sidebar-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-status {
  font-size: 11px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 5px;
}

.channels-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.channel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 4px;
}

.channel-section-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.8px;
}

.add-channel-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  display: none;
}

.is-developer .add-channel-btn {
  display: inline-block;
}

.add-channel-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.channel-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.channel-item.active {
  background: rgba(139, 92, 246, 0.16);
  color: #fff;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.channel-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-avatar {
  font-size: 16px;
  position: relative;
}

.contact-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.contact-online-dot.offline {
  background: #6b7280;
  box-shadow: none;
}

.del-chan-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 11px;
  opacity: 0;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: opacity 0.2s;
  display: none;
}

.is-developer .del-chan-btn {
  display: inline-block;
}

.is-developer .channel-item:hover .del-chan-btn {
  opacity: 0.8;
}

.del-chan-btn:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2);
}

/* Voice Channel Members List */
.voice-members-list {
  display: flex;
  flex-direction: column;
  padding: 4px 0 6px 28px;
  gap: 6px;
}

.voice-member-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #d1d5db;
}

.voice-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.voice-avatar-mini.speaking {
  border-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  transform: scale(1.1);
}

/* User & Voice Control Panel Bottom */
.user-panel {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 8, 15, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-active-bar {
  display: none;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  justify-content: space-between;
  align-items: center;
}

.voice-active-bar.active {
  display: flex;
}

.voice-info-left {
  display: flex;
  flex-direction: column;
}

.voice-status-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #10b981;
}

.voice-channel-name {
  font-size: 10.5px;
  color: var(--text-dim);
}

.voice-leave-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-leave-btn:hover {
  background: rgba(239, 68, 68, 0.4);
}

.user-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  cursor: pointer;
}

.user-avatar-main {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  position: relative;
  background-size: cover;
  background-position: center;
}

.user-avatar-main.is-dev-avatar {
  border-color: #a855f7;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
}

.user-avatar-main.is-mod-avatar {
  border-color: #06b6d4;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
}

.dev-crown-badge {
  position: absolute;
  top: -8px;
  right: -5px;
  font-size: 13px;
  display: none;
}

.is-developer .dev-crown-badge {
  display: block;
}

.user-name-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

.role-tag-pill {
  display: none;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.is-developer .role-tag-pill.dev-pill {
  display: inline-block;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.is-moderator .role-tag-pill.mod-pill {
  display: inline-block;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.user-tag {
  font-size: 11px;
  color: var(--text-dim);
}

.user-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-btn.active-danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.icon-btn.active-success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

/* Chat Central Container */
.chat-area {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chat-header {
  flex-shrink: 0;
  height: 56px;
  min-height: 56px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 16, 26, 0.4);
}

.channel-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.channel-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.channel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-btn {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.call-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
}

.call-btn.dm-call-btn {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.call-btn.dm-call-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.call-btn.in-call {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #f87171 !important;
  animation: pulse-danger 1.5s infinite;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.purge-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}

.purge-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Video Grid Area */
.video-grid-container {
  display: none;
  background: rgba(10, 8, 15, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  gap: 12px;
  overflow-x: auto;
  align-items: center;
  position: relative;
}

.video-grid-container.open {
  display: flex;
}

.video-card {
  position: relative;
  width: 220px;
  height: 140px;
  background: #12101a;
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card.speaking {
  border-color: #10b981;
  box-shadow: 0 0 12px #10b981;
}

.video-card-name {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
}

/* Messages Scrollable Area */
.messages-feed {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.message-item {
  display: flex;
  gap: 14px;
  max-width: 90%;
  position: relative;
  animation: message-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes message-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-size: cover;
  background-position: center;
}

.message-avatar.is-dev {
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.message-avatar.is-mod {
  border-color: #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-author {
  font-size: 13.5px;
  font-weight: 600;
  color: #e5e7eb;
}

.author-role-badge {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.author-role-badge.dev {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.author-role-badge.mod {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.message-time {
  font-size: 11px;
  color: var(--text-dim);
}

.msg-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  padding: 0 4px;
  display: none;
}

.is-developer .msg-del-btn,
.is-moderator .msg-del-btn {
  display: inline-block;
}

.is-developer .message-item:hover .msg-del-btn,
.is-moderator .message-item:hover .msg-del-btn {
  opacity: 0.7;
}

.msg-del-btn:hover {
  opacity: 1 !important;
  color: #ef4444;
}

.message-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  border-radius: 4px 16px 16px 16px;
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.message-item.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-item.own .message-bubble {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.2));
  border-color: rgba(168, 85, 247, 0.3);
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.message-item.own .message-meta {
  flex-direction: row-reverse;
}

.msg-media {
  max-width: 320px;
  max-height: 240px;
  border-radius: 12px;
  margin-top: 6px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.msg-media:hover {
  transform: scale(1.02);
}

/* Floating Pill Chat Input Area */
.chat-input-wrapper {
  flex-shrink: 0;
  padding: 12px 24px 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 20;
  background: rgba(10, 8, 15, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Scroll to Bottom Floating Pill */
.scroll-bottom-btn {
  position: absolute;
  bottom: 84px;
  right: 32px;
  background: rgba(22, 19, 32, 0.94);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.2s;
  user-select: none;
}

.scroll-bottom-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-bottom-btn:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.75), 0 0 22px rgba(168, 85, 247, 0.5);
}

.scroll-bottom-badge {
  background: #a855f7;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  margin-left: 2px;
  display: none;
}

.scroll-bottom-badge.has-unread {
  display: inline-block;
}

.input-pill {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-height: 52px;
  background: rgba(22, 19, 32, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 18px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(139, 92, 246, 0.12);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-pill:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
}

.chat-input::placeholder {
  color: var(--text-dim);
  font-size: 14.5px;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.send-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

/* Emoji Picker Popup */
.emoji-picker-popup {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 290px;
  background: rgba(22, 19, 32, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-active);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(168, 85, 247, 0.25);
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  z-index: 100;
}

.emoji-picker-popup.open {
  display: grid;
}

.emoji-item {
  font-size: 22px;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.15s;
}

.emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.2);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 6, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.card-modal {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 19, 32, 0.96);
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.card-modal-large {
  max-width: 760px;
  text-align: left;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #fff;
}

.login-logo {
  font-size: 40px;
  margin-bottom: -4px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Tabs */
.auth-tabs, .settings-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  margin-bottom: 6px;
}

.auth-tab-btn, .settings-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active, .settings-tab-btn.active {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.auth-form-group, .settings-form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: -4px;
}

.avatar-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0;
}

.avatar-opt {
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-opt.selected {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.2);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.form-input, .form-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-select option {
  background: #181524;
  color: #fff;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-purple);
}

.action-btn {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transition: all 0.2s;
  width: 100%;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
}

/* Audio Level Meter */
.mic-meter-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}

.mic-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #a855f7);
  transition: width 0.05s linear;
}

/* Camera Preview */
.camera-preview-wrapper {
  width: 100%;
  height: 160px;
  background: #0d0b14;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.camera-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-error, .settings-status {
  font-size: 12px;
  min-height: 16px;
}

.settings-status.success {
  color: #10b981;
}

.settings-status.error {
  color: #ef4444;
}

/* Admin Dashboard Specific Styles */
.admin-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-tab-btn.active {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.admin-user-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.admin-user-card.is-banned {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.04);
}

.admin-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-name {
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-badge-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.role-badge-btn.make-mod {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.35);
  color: #22d3ee;
}

.role-badge-btn.make-mod:hover {
  background: rgba(6, 182, 212, 0.3);
}

.role-badge-btn.remove-mod {
  background: rgba(156, 163, 175, 0.15);
  border-color: rgba(156, 163, 175, 0.3);
  color: #d1d5db;
}

.role-badge-btn.ban-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.role-badge-btn.ban-btn:hover {
  background: rgba(239, 68, 68, 0.35);
}

.role-badge-btn.unban-btn {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.role-badge-btn.unban-btn:hover {
  background: rgba(16, 185, 129, 0.35);
}

/* User Devices List */
.devices-accordion {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.devices-title {
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.device-row:last-child {
  border-bottom: none;
}

.device-name {
  color: #e5e7eb;
}

.device-ip {
  color: var(--text-dim);
  font-family: monospace;
}

.device-time {
  color: var(--text-dim);
}

/* Incoming Call Overlay (Discord-style) */
.incoming-call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 9, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.incoming-call-overlay.open {
  display: flex;
}

.incoming-call-box {
  background: rgba(22, 19, 34, 0.95);
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  border-radius: 24px;
  padding: 32px 36px;
  width: 90%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(139, 92, 246, 0.35);
}

.calling-pulse {
  position: relative;
  margin-bottom: 16px;
}

.call-avatar-pulse {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.6);
  animation: pulse-ring 1.6s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(168, 85, 247, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.incoming-call-name {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.incoming-call-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.incoming-call-buttons {
  display: flex;
  gap: 14px;
  width: 100%;
}

.call-btn-accept {
  flex: 1;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.call-btn-accept:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.call-btn-decline {
  flex: 1;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.call-btn-decline:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

/* Responsive Breakpoints & Device Adaptation */

/* Desktop & General defaults for mobile buttons */
.mobile-sidebar-toggle-btn,
.mobile-close-sidebar-btn,
.sidebar-backdrop {
  display: none;
}

.chat-header-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Mobile Phones (iPhone 14/15/16/17, Android) */
@media (max-width: 768px) {
  .top-nav-bar {
    padding: max(8px, env(safe-area-inset-top)) 10px 4px;
  }
  .nav-pill {
    padding: 4px 6px;
    gap: 3px;
    max-width: 98vw;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-pill::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    padding: 6px 10px;
    font-size: 13px;
    gap: 5px;
  }
  .nav-item span.text {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
  }
  .nav-item.nav-toggle-btn {
    display: none; /* Replaced by in-header toggle buttons for clear navigation */
  }
  .main-layout {
    padding: 4px 6px 6px;
    gap: 0;
  }

  /* Slide-in Drawer Sidebar */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 84vw;
    max-width: 320px;
    z-index: 999;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    border-radius: 0 20px 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 15px 0 45px rgba(0, 0, 0, 0.85);
    background: rgba(16, 14, 24, 0.97);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-close-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
  }

  .mobile-sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
    transition: background 0.15s;
  }
  .mobile-sidebar-toggle-btn:active {
    background: rgba(139, 92, 246, 0.4);
  }

  .chat-area {
    border-radius: 14px;
  }
  .chat-header {
    height: 52px;
    min-height: 52px;
    padding: 0 12px;
  }
  .channel-title {
    font-size: 14px;
  }
  .channel-desc {
    display: none;
  }
  .channel-header-right {
    gap: 6px;
  }
  .channel-header-right .call-btn {
    padding: 7px 12px;
    font-size: 12.5px;
  }
  .channel-header-right .call-btn span:last-child {
    display: inline-block;
  }
  .messages-feed {
    padding: 12px 12px;
    gap: 10px;
  }
  .message-item {
    max-width: 95%;
  }
  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .message-bubble {
    font-size: 13.5px;
    padding: 8px 12px;
  }
  .chat-input-wrapper {
    padding: 6px 10px max(10px, env(safe-area-inset-bottom));
  }
  .input-pill {
    min-height: 46px;
    padding: 4px 8px 4px 12px;
    gap: 6px;
  }
  .chat-input {
    font-size: 14px;
  }
  .scroll-bottom-btn {
    bottom: 74px;
    right: 18px;
    padding: 5px 12px;
    font-size: 11.5px;
  }
  .admin-user-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Friends Hub Mobile Adaptation: Unclipped Fixed Segmented Control */
  .friends-hub-header {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 10px 12px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }
  .friends-hub-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 36px !important;
    flex-shrink: 0 !important;
  }
  .friends-header-divider {
    display: none !important;
  }
  .friends-subtabs {
    width: 100% !important;
    margin: 0 !important;
    padding: 3px !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    background: rgba(22, 18, 38, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    touch-action: pan-y !important;
  }
  .friends-subtabs::-webkit-scrollbar {
    display: none;
  }
  .friends-subtab-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    padding: 0 2px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    white-space: nowrap !important;
    border-radius: 9px !important;
    border: 1px solid transparent !important;
    box-sizing: border-box !important;
    color: rgba(255, 255, 255, 0.8) !important;
    background: transparent !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: all 0.2s ease !important;
  }
  .friends-subtab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .friends-subtab-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(99, 102, 241, 0.6)) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid rgba(168, 85, 247, 0.8) !important;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4) !important;
  }
  .friends-subtab-btn.add-friend-tab-btn {
    color: #34d399 !important;
  }
  .friends-subtab-btn.add-friend-tab-btn.active {
    background: rgba(16, 185, 129, 0.35) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.8) !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35) !important;
  }
  .friends-hub-content {
    padding: 12px;
  }
  .friend-card {
    padding: 10px 12px;
  }
  .friend-card-name {
    font-size: 13.5px;
  }
  .friend-card-tag {
    font-size: 11px;
  }
}

/* Laptops & Tablets (769px to 1399px) */
@media (min-width: 769px) and (max-width: 1399px) {
  .sidebar {
    width: 270px;
  }
  .chat-area {
    border-radius: 16px;
  }
  .messages-feed {
    padding: 20px 24px;
  }
}

/* Large Desktop & Ultra-wide Monitors (1400px+) */
@media (min-width: 1400px) {
  .main-layout {
    padding: 8px 28px 20px;
    gap: 20px;
  }
  .sidebar {
    width: 320px;
    border-radius: 20px;
  }
  .chat-area {
    border-radius: 20px;
  }
  .chat-header {
    height: 62px;
    min-height: 62px;
    padding: 0 28px;
  }
  .channel-title {
    font-size: 16.5px;
  }
  .channel-desc {
    font-size: 13px;
  }
  .messages-feed {
    padding: 28px 36px;
    gap: 18px;
  }
  .message-item {
    max-width: 85%;
  }
  .message-avatar {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .message-author {
    font-size: 14.5px;
  }
  .message-bubble {
    font-size: 15px;
    line-height: 1.6;
    padding: 12px 18px;
  }
  .chat-input-wrapper {
    padding: 16px 28px 22px;
  }
  .input-pill {
    max-width: 960px;
    min-height: 58px;
    padding: 8px 16px 8px 22px;
  }
  .chat-input {
    font-size: 16px;
  }
  .send-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* =========================================================
   Friends Hub & Discord-Style 1-on-1 Calling Enhancements
   ========================================================= */

/* Friends Nav Button in Sidebar */
.friends-hub-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.friends-hub-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}

.friends-hub-nav-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
  color: #fff;
}

.friends-hub-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.friends-nav-icon {
  font-size: 18px;
}

.pending-badge {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Friends Hub Main Area */
.friends-hub-area {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
  position: relative;
}

.friends-hub-header {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  background: rgba(18, 16, 26, 0.5);
}

@media (min-width: 769px) {
  .friends-hub-header {
    height: 60px;
    min-height: 60px;
    padding: 0 24px;
    align-items: center;
    gap: 16px;
  }
}

.friends-hub-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friends-header-icon {
  font-size: 20px;
}

.friends-header-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.friends-header-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

@media (min-width: 769px) {
  .friends-subtabs {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }
}

.friends-subtabs::-webkit-scrollbar {
  display: none;
}

.friends-subtab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.friends-subtab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.friends-subtab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(99, 102, 241, 0.35));
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.friends-subtab-btn.add-friend-tab-btn {
  color: #34d399;
}

.friends-subtab-btn.add-friend-tab-btn:hover {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

.friends-subtab-btn.add-friend-tab-btn.active {
  background: rgba(16, 185, 129, 0.22);
  color: #10b981;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.pending-subtab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  margin-left: 2px;
}

.friends-hub-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
}

.friends-view-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friends-list-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.friends-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Friend Card */
.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.friend-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}

.friend-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.friend-card-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #12101a;
  background: #6b7280;
}

.friend-card-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.friend-card-info {
  display: flex;
  flex-direction: column;
}

.friend-card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-card-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}

.friend-card-tag {
  font-size: 12px;
  color: var(--text-dim);
}

.friend-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.friend-action-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #fff;
  border-color: rgba(168, 85, 247, 0.4);
  transform: scale(1.08);
}

.friend-action-btn.accept-btn {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.friend-action-btn.accept-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #fff;
}

.friend-action-btn.decline-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.friend-action-btn.decline-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

/* Add Friend Card Pane */
.add-friend-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
}

.add-friend-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.add-friend-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.add-friend-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 18px;
  transition: border-color 0.2s;
}

.add-friend-input-wrapper:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

.add-friend-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}

.add-friend-submit-btn {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.add-friend-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.add-friend-feedback {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
}

.add-friend-feedback.success {
  color: #10b981;
}

.add-friend-feedback.error {
  color: #ef4444;
}

@media (max-width: 600px) {
  .add-friend-card {
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .add-friend-input-wrapper {
    flex-direction: column;
    align-items: stretch;
    border-radius: 14px;
    padding: 8px;
    gap: 10px;
    background: rgba(0, 0, 0, 0.45);
  }
  .add-friend-input {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    font-size: 14px;
  }
  .add-friend-submit-btn {
    width: 100%;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
  }
}

.friends-empty-placeholder {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}

.friends-empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.friends-empty-text {
  font-size: 14px;
}

/* Outgoing Call Status Bar */
.outgoing-call-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.25), rgba(79, 70, 229, 0.2));
  border-bottom: 1px solid rgba(168, 85, 247, 0.35);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 20;
}

.outgoing-call-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calling-pulse-mini {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  animation: pulse-ring 1.5s infinite;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.outgoing-call-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.outgoing-call-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.call-btn-cancel {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.call-btn-cancel:hover {
  transform: scale(1.03);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
}

.call-btn.dm-end-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.call-btn.dm-end-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
}

/* Voice Nav Indicator (Visual Only, Non-Navigating) */
.nav-voice-indicator {
  cursor: default !important;
  user-select: none;
  opacity: 0.85;
}

.nav-voice-indicator:hover {
  background: transparent !important;
  color: var(--text-muted) !important;
}

.nav-voice-indicator.active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3) !important;
}

/* =========================================================
   FaceTime-style Cinematic Video & Screen Share Stage
   ========================================================= */
.facetime-stage-modal {
  position: fixed;
  inset: 0;
  background: #050408;
  z-index: 9500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: facetime-fade 0.25s ease-out;
}

.facetime-stage-modal.open {
  display: flex;
}

@keyframes facetime-fade {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.facetime-top-bar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 9510;
  transition: opacity 0.3s ease;
}

.facetime-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 16, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.facetime-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.facetime-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

.facetime-badge {
  font-size: 11px;
  color: #10b981;
}

.facetime-close-btn {
  background: rgba(18, 16, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.facetime-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.03);
}

.facetime-main-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  cursor: pointer;
}

.facetime-main-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: object-fit 0.2s;
}

.facetime-main-viewport.fit-contain video {
  object-fit: contain !important;
}

.facetime-fit-toggle {
  position: absolute;
  top: max(75px, calc(env(safe-area-inset-top) + 60px));
  left: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 9510;
  transition: all 0.2s;
}

.facetime-fit-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.facetime-pip-card {
  position: absolute;
  top: max(75px, calc(env(safe-area-inset-top) + 60px));
  right: 18px;
  width: 110px;
  height: 155px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.25);
  z-index: 9520;
  cursor: pointer;
  background: #111;
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.facetime-pip-card:hover {
  transform: scale(1.05);
  border-color: var(--accent-purple);
}

.facetime-pip-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.facetime-pip-label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
}

.facetime-controls-bar {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(18, 16, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  z-index: 9530;
  transition: opacity 0.3s ease;
}

.facetime-ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.facetime-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.facetime-ctrl-btn.active-danger {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
}

.facetime-ctrl-btn.active-success {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.6);
}

.facetime-ctrl-btn.facetime-end-call-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
  width: 52px;
  height: 52px;
}

.facetime-ctrl-btn.facetime-end-call-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.8);
}

/* Video Card FaceTime Expand Hint */
.video-card {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.6);
}

.video-card-expand-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.8;
  transition: opacity 0.2s;
  pointer-events: none;
}

.video-card:hover .video-card-expand-badge {
  opacity: 1;
}


