/* ═══════════════════════════════════════════════════
   voice.css — Voice channels & calls UI
   ═══════════════════════════════════════════════════ */

/* ── Voice Channel List Container ── */
.voice-channels-list {
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255,255,255,.02);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.voice-channels-list:empty { display: none; }

/* ── Voice Channel Cards (in channel list) ── */
.voice-channels-section { }
.voice-channels-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 12px 16px 4px; font-weight: 700; }

.voice-channel-card {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .2s, border-color .2s;
}
.voice-channel-card:hover { background: rgba(255,255,255,.03); }
.voice-channel-card.active { border-left-color: var(--accent); background: rgba(var(--accent-rgb),.04); }

.voice-channel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.voice-channel-header svg, .voice-channel-header i { color: var(--muted); }
.voice-channel-card.active .voice-channel-header,
.voice-channel-card.active .voice-channel-header svg,
.voice-channel-card.active .voice-channel-header i { color: var(--accent); }

.voice-channel-name { flex: 1; font-size: 14px; font-weight: 600; }
.voice-channel-count { font-size: 11px; color: var(--muted); }

/* Participants in voice channel */
.voice-channel-participants {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 0 24px;
}

.voice-participant {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.voice-participant-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}

.voice-participant.speaking .voice-participant-avatar {
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34,197,94,.5), 0 0 20px rgba(34,197,94,.2);
  animation: voiceSpeaking .8s ease infinite;
}

@keyframes voiceSpeaking {
  0%, 100% { box-shadow: 0 0 6px rgba(34,197,94,.4), 0 0 12px rgba(34,197,94,.15); }
  50% { box-shadow: 0 0 14px rgba(34,197,94,.6), 0 0 24px rgba(34,197,94,.25); }
}

.voice-participant-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-participant.muted .voice-muted-icon { color: #ef4444; }
.voice-participant .voice-muted-icon svg { width: 12px; height: 12px; }

/* Create voice channel button */
.voice-create-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.voice-create-btn:hover { color: var(--accent); }

/* ── Floating Voice Bubble ── */
.voice-bubble {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(17,24,39,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--glass-border);
  z-index: calc(var(--z-drawer) + 1);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow .3s, border-color .3s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.voice-bubble:active { cursor: grabbing; }

.voice-bubble--entering {
  animation: voiceBubbleFadeIn .3s ease;
}

@keyframes voiceBubbleFadeIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.voice-bubble--speaking {
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,.5), 0 0 24px rgba(34,197,94,.2), 0 4px 24px rgba(0,0,0,.4);
  animation: voiceBubblePulse 2s ease infinite;
}

@keyframes voiceBubblePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(34,197,94,.4), 0 0 16px rgba(34,197,94,.15), 0 4px 24px rgba(0,0,0,.4); border-color: #22c55e; }
  50%      { box-shadow: 0 0 18px rgba(34,197,94,.6), 0 0 32px rgba(34,197,94,.25), 0 4px 24px rgba(0,0,0,.4); border-color: #4ade80; }
}

.voice-bubble-base {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-bubble-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.voice-bubble-icon {
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-bubble-speaker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.voice-bubble-speaker.visible {
  opacity: 1;
}

.voice-bubble-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid rgba(17,24,39,1);
  line-height: 1;
}

.voice-bubble--snapping {
  transition: left .2s ease-out, top .2s ease-out, box-shadow .3s, border-color .3s;
}

/* ── Voice Bubble Popup Card ── */
.voice-bubble-popup {
  position: fixed;
  width: 280px;
  max-height: 400px;
  background: rgba(17,24,39,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  z-index: calc(var(--z-drawer) + 2);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: voicePopupIn .2s ease;
}

@keyframes voicePopupIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.voice-bubble-popup-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.voice-bubble-popup-vc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-bubble-popup-group-name {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.voice-bubble-popup-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #22c55e;
  margin-top: 6px;
}

.voice-bubble-popup-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

/* Participants list */
.voice-bubble-popup-participants {
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  padding: 8px 0;
}

.voice-bubble-popup-participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text);
}

.voice-bubble-popup-participant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}

.voice-bubble-popup-participant.speaking .voice-bubble-popup-participant-avatar {
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34,197,94,.5);
}

.voice-bubble-popup-participant-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-bubble-popup-participant-muted {
  color: #ef4444;
  flex-shrink: 0;
}

/* Controls footer */
.voice-bubble-popup-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
}

.voice-bubble-popup-controls .voice-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, transform .15s;
}
.voice-bubble-popup-controls .voice-ctrl-btn:hover { background: rgba(255,255,255,.1); transform: scale(1.05); }
.voice-bubble-popup-controls .voice-ctrl-btn.active { background: #ef4444; color: #fff; }
.voice-bubble-popup-controls .voice-ctrl-btn.active:hover { background: #dc2626; }

.voice-bubble-popup-controls .voice-ctrl-disconnect {
  background: #ef4444 !important;
  color: #fff !important;
}
.voice-bubble-popup-controls .voice-ctrl-disconnect:hover {
  background: #dc2626 !important;
  transform: scale(1.08);
}

/* ── Call Overlays ── */
.voice-call-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: voiceOverlayFadeIn .3s ease;
}

@keyframes voiceOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.voice-call-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
  background: rgba(17,24,39,.7);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  min-width: 280px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.voice-call-ring-anim {
  position: relative;
  width: 96px;
  height: 96px;
}

.voice-call-ring-anim::before,
.voice-call-ring-anim::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: voiceRingPulse 2s ease-out infinite;
}
.voice-call-ring-anim::after { animation-delay: 1s; }

@keyframes voiceRingPulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.voice-call-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--glass-border);
  position: relative;
  z-index: 1;
}

.voice-call-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.voice-call-label {
  font-size: 14px;
  color: var(--muted);
}

.voice-call-timer {
  font-family: 'Rajdhani', monospace;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 2px;
}

.voice-call-actions {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.voice-call-accept,
.voice-call-reject {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform .15s, box-shadow .2s;
}

.voice-call-accept {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 0 20px rgba(34,197,94,.3);
}
.voice-call-accept:hover {
  transform: scale(1.1);
  box-shadow: 0 0 28px rgba(34,197,94,.5);
}

.voice-call-reject {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 20px rgba(239,68,68,.3);
}
.voice-call-reject:hover {
  transform: scale(1.1);
  box-shadow: 0 0 28px rgba(239,68,68,.5);
}

/* Active call controls in overlay */
.voice-call-controls {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

/* ── Connection quality ── */
.voice-quality-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.voice-quality-dot.good { background: #22c55e; }
.voice-quality-dot.fair { background: #f59e0b; }
.voice-quality-dot.poor { background: #ef4444; }

/* ── Mobile-first voice defaults ── */
.voice-bubble-popup-controls .voice-ctrl-btn { width: 44px; height: 44px; }
.voice-call-accept,
.voice-call-reject { width: 64px; height: 64px; }

/* === DESKTOP LAYOUT (activează când ai design desktop) ===
@media (min-width: 801px) {
  .voice-bubble-popup-controls .voice-ctrl-btn { width: 40px; height: 40px; }
  .voice-call-accept,
  .voice-call-reject { width: 56px; height: 56px; }
}
=== END DESKTOP LAYOUT === */
