/* ═══════════════════════════════════════════════════════════
   VOICE CSS — Discord Voice Room Aesthetic
═══════════════════════════════════════════════════════════ */

/* Embedded Voice Panel in Main Canvas */
.voice-panel {
  background: #2b2d31;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 4;
}

.voice-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.voice-icon {
  color: var(--status-online);
  animation: pulse-green 2s infinite;
  display: inline-flex;
  align-items: center;
}

.voice-status {
  font-size: 0.75rem;
  color: var(--status-online);
  font-weight: 600;
  margin-left: auto;
}

/* Participants Grid inside Voice Banner */
.voice-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.2rem 0;
}

.voice-user-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1e1f22;
  border: 2px solid transparent;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  min-width: 110px;
  position: relative;
  transition: all 0.15s ease;
}

.voice-user-avatar-wrap {
  position: relative;
  width: 26px;
  height: 26px;
}

.voice-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

/* Discord Active Speaker Green Glowing Ring */
.voice-user-card.speaking {
  border-color: var(--status-online);
  box-shadow: 0 0 10px rgba(35, 165, 90, 0.4);
}

.voice-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #dbdee1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px;
}

.voice-user-status-icons {
  margin-left: auto;
  font-size: 0.75rem;
  display: flex;
  gap: 2px;
}

.icon-muted { color: #f23f43; }
.icon-deafened { color: #f23f43; }

/* Voice Control Actions Bar */
.voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

.voice-btn {
  background: #313338;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #b5bac1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.15s;
}

.voice-btn:hover {
  background: #383a40;
  color: #ffffff;
}

.voice-btn.active-off {
  background: #f23f43;
  border-color: #d83a3e;
  color: #ffffff;
}

.voice-btn-leave {
  background: #f23f43;
  border-color: #d83a3e;
  color: #ffffff;
}

.voice-btn-leave:hover {
  background: #d83a3e;
}

/* Join Voice Channel Button in Sidebar & Topbar */
.btn-join-voice {
  width: 100%;
  padding: 0.45rem;
  margin-bottom: 0.75rem;
  background: rgba(35, 165, 90, 0.15);
  border: 1px solid rgba(35, 165, 90, 0.3);
  color: #23a55a;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s;
}

.btn-join-voice:hover {
  background: rgba(35, 165, 90, 0.25);
  color: #ffffff;
}

.btn-topbar-voice {
  background: var(--status-online) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(35, 165, 90, 0.35) !important;
}

.btn-topbar-voice:hover {
  background: #1f924e !important;
}

@keyframes pulse-green {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

@media (max-width: 768px) {
  .voice-panel {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .voice-participants {
    max-height: 100px;
    gap: 0.45rem;
  }
  .voice-user-card {
    min-width: 95px;
    padding: 0.3rem 0.5rem;
  }
  .voice-btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .btn-topbar-voice span {
    display: none;
  }
  .btn-topbar-voice {
    padding: 0.45rem;
    border-radius: 50%;
  }
}

/* WebRTC Debug Panel for Admins */
#webrtc-debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(10, 10, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #00ff00;
  font-family: monospace;
  font-size: 11px;
  padding: 10px;
  border-radius: 8px;
  z-index: 9999;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  pointer-events: all;
}
.webrtc-debug-header {
  font-weight: bold;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.webrtc-debug-header button {
  background: none;
  border: none;
  color: #ff4444;
  cursor: pointer;
}
.webrtc-debug-peer {
  margin-bottom: 8px;
  padding: 4px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
}
.ice-connected, .ice-completed { color: #00ff00; }
.ice-failed, .ice-disconnected { color: #ff4444; }
.ice-new, .ice-checking { color: #ffaa00; }
