  /* Chat message area scrollbar */
.chat-messages {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

/* Chrome, Edge, Safari */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: #2a2a2a;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background-color: #3a3a3a;
}

/* Popup/index safe scrolling */
.ds-chat-widget { display:flex; flex-direction:column; height:100%; min-height:0; }
.ds-chat-messages { flex:1; min-height:0; overflow:auto; }

/* Locked preview helpers */
.ds-chat-locked-container { position: relative; height: 100%; min-height: 0; overflow: hidden; }
.ds-chat-locked-blur { filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none; }
.ds-chat-login-overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding: 24px; z-index: 50; }

/* Locked card design (Matched to video player) */
.locked-card {
  width: 100%;
  max-width: 340px;
  max-height: 100%;
  border-radius: 20px;
  background: rgba(20,20,20,.6);
  backdrop-filter: blur(20px);
  padding: 20px 24px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
}
.lock-icon-circle {
  margin: 0 auto 10px auto;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.locked-card h4 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: .02em;
  margin-top: 0;
}
.locked-card p {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-bottom: 16px;
  line-height: 1.4;
}
.btn-locked-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--dart-green, #309f6a);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px;
  border-radius: 10px;
  transition: all .2s;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 12px rgba(48,159,106,.3);
}
.btn-locked-login:hover {
  background: #258558;
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 6px 16px rgba(48,159,106,.4);
}
.btn-locked-register {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  margin-top: 12px;
  text-decoration: none;
  transition: color .2s;
}
.btn-locked-register:hover {
  color: #fff;
  text-decoration: underline;
}

/* Active Users Panel Styles */
.active-users-panel {
  position: fixed;
  top: 64px; /* Start below navbar - adjust this value to match your navbar height */
  right: 0;
  height: calc(100vh - 64px); /* Full height minus navbar */
  width: 280px;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.98), rgba(15, 15, 15, 0.98));
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40; /* Below navbar (50) but above content */
  backdrop-filter: blur(20px);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.active-users-panel.open {
  transform: translateX(0);
}

.active-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.active-users-list {
  overflow-y: auto;
  max-height: calc(100vh - 124px); /* Full viewport height minus navbar (64px) and header (60px) */
  height: 100%;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #1a1a1a; /* More visible scrollbar */
}

.active-users-list::-webkit-scrollbar {
  width: 8px; /* Slightly wider for visibility */
}

.active-users-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.active-users-list::-webkit-scrollbar-thumb {
  background-color: #3a3a3a;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.active-users-list::-webkit-scrollbar-thumb:hover {
  background-color: #4a4a4a;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(-2px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: white;
  text-transform: uppercase;
  flex-shrink: 0;
  position: relative;
}

.user-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid rgba(10, 10, 10, 0.98);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

.user-role.admin {
  color: #10b981;
}

.users-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
}

.users-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* 8px */
  border-radius: 0.5rem; /* 8px */
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0.625rem; /* 8px 10px */
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem; /* 12px */
}

.users-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.users-toggle-btn .notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #10b981;
  border: 2px solid rgba(10, 10, 10, 0.98);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
}

.empty-state i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 12px;
  font-weight: 600;
}

/* Reply and Mention Styles */
.chat-message-item {
  position: relative;
  transition: background 0.15s ease;
  cursor: pointer;
}

.chat-message-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Admin Badge */
.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  margin-right: 2px;
  padding: 1px 1px;
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  font-weight: 700;
  vertical-align: middle;
  position: relative;
  top: -1px;
  opacity: 0.8;
}

/* Twitch-style inline reply indicator */
.reply-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-right: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  vertical-align: middle;
}

.reply-indicator:hover {
  background: rgba(255, 255, 255, 0.15);
}

.reply-indicator i {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.reply-indicator .reply-username {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.reply-indicator .reply-text {
  color: rgba(255, 255, 255, 0.5);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-mention {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.user-mention:hover {
  background: rgba(16, 185, 129, 0.25);
  text-decoration: underline;
}

#mentionDropdown {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #1a1a1a;
}

#mentionDropdown::-webkit-scrollbar {
  width: 6px;
}

#mentionDropdown::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

#mentionDropdown::-webkit-scrollbar-thumb {
  background-color: #3a3a3a;
  border-radius: 3px;
}
@media (min-width: 1024px) {
    .chat-sticky-height {
        height: calc(100vh - 160px);
        position: sticky;
        top: 20px;
    }
}