/* ================================================
   VOICE CHANNEL STYLES (v8.7 Premium Redesign)
   Discord-inspired glassmorphism UI
   ================================================ */

:root {
    --vc-accent: #8b5cf6;
    --vc-bg-sidebar: rgba(15, 15, 25, 0.4);
    --vc-bg-hover: rgba(255, 255, 255, 0.08);
    --vc-bg-active: rgba(139, 92, 246, 0.15);
    --vc-text-muted: rgba(255, 255, 255, 0.4);
    --vc-text-bright: rgba(255, 255, 255, 0.95);
    --vc-danger: #ef4444;
    --vc-success: #10b981;
}

/* --- Voice Section Header (Aggressive Reset & Mirror v9.0 - Nuclear Fix) --- */
.voice-channels-section {
    margin-top: auto !important;
    /* Force to bottom in flex container */
    border-top: 1px solid #1e1f22 !important;
    width: 100% !important;
    background: rgba(43, 45, 49, 0.4);
    /* Discord-like subtle footer background */
}

/* Using ID + Classes for extreme specificity */
button#vc-toggle-btn.voice-channels-toggle {
    all: unset !important;
    /* CRITICAL */
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    background: #2B2D31 !important;
    /* Discord gray */
    color: #949BA4 !important;
    /* Discord muted text */
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    cursor: pointer !important;
    border-bottom: 1px solid #1e1f22 !important;
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2) !important;
    transition: color 0.15s ease, background-color 0.15s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

button#vc-toggle-btn.voice-channels-toggle:hover {
    color: #F2F3F5 !important;
    background: #35373C !important;
    /* Discord hover */
}

button#vc-toggle-btn.voice-channels-toggle i.vc-toggle-icon {
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #80848E !important;
}

.vc-toggle-label {
    flex: 1 !important;
    text-align: left !important;
}

.vc-toggle-arrow,
.vc-toggle-arrow-container {
    width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.5 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.vc-toggle-arrow-container i {
    width: 14px !important;
    height: 14px !important;
}

.vc-dropdown {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --- Voice Channel Item --- */
.voice-channel-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.voice-channel-item:hover {
    background: var(--vc-bg-hover);
}

.voice-channel-item.active {
    background: var(--vc-bg-active);
}

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

.vc-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: color 0.2s;
}

.voice-channel-item:hover .vc-icon,
.voice-channel-item.active .vc-icon {
    opacity: 0.9;
    color: var(--vc-accent);
}

.vc-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-channel-item:hover .vc-name,
.voice-channel-item.active .vc-name {
    color: var(--vc-text-bright);
}

/* --- Participants --- */
.vc-participants {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 26px;
}

.vc-participant {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.vc-participant:hover {
    background: rgba(255, 255, 255, 0.03);
}

.vc-participant-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vc-success);
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle separation */
    flex-shrink: 0;
    position: relative;
}

.vc-participant.is-self .vc-participant-name {
    color: var(--vc-accent);
    font-weight: 600;
}

.vc-participant-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Voice Controls Bar (Glassmorphism) --- */
.voice-controls-bar {
    display: none;
    flex-direction: column;
    padding: 12px;
    background: rgba(5, 5, 10, 0.6);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 10;
}

.vc-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.vc-connected-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--vc-success);
    box-shadow: 0 0 10px var(--vc-success);
    animation: vc-connected-pulse 2s infinite ease-in-out;
}

@keyframes vc-connected-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

.vc-status-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.vc-status-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--vc-success);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vc-channel-name {
    font-size: 11px;
    color: var(--vc-text-muted);
}

.vc-buttons {
    display: flex;
    gap: 8px;
}

.vc-btn {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vc-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.vc-btn svg {
    width: 18px;
    height: 18px;
}

.vc-btn.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--vc-danger);
}

.vc-btn.disconnect {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

.vc-btn.disconnect:hover {
    background: var(--vc-danger);
}

/* --- Speaking Indicator (Nuclear Glow v9.1) --- */
.vc-participant-dot.speaking {
    background: #a855f7 !important;
    /* Bright purple */
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.4),
        0 0 15px #a855f7,
        0 0 30px rgba(168, 85, 247, 0.4) !important;
    animation: vc-speaking-lux 1s infinite ease-in-out !important;
}

@keyframes vc-speaking-lux {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.25);
        filter: brightness(1.3);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* --- Mobile / Responsive Overlay --- */
@media (max-width: 768px) {
    .voice-controls-bar {
        position: fixed;
        bottom: 74px;
        /* Above mobile menu */
        left: 0;
        right: 0;
        z-index: 1000;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        margin: 0 10px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }

    .vc-status {
        margin-bottom: 0;
    }

    .vc-buttons {
        gap: 12px;
    }

    .vc-btn {
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
        border-radius: 10px;
    }
}