/* ── Voice icon shared ── */

.voice-icon {
    font-size: 12px;
    opacity: 0.75;
}

/* ── Full voice view (rendered into messagesContainer when viewing active voice channel) ── */

.voice-full-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e1e;
    padding: 24px 24px 16px;
    gap: 16px;
    box-sizing: border-box;
}

.voice-full-header {
    font-size: 14px;
    font-weight: 600;
    color: #96989d;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.voice-full-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
    gap: 16px;
    justify-content: center;
    align-content: center;
    overflow-y: auto;
}

.voice-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px 18px;
    border-radius: 12px;
    background: #2a2a2a;
    transition: background 0.15s;
}

.voice-tile.speaking {
    background: #1a3a2a;
}

.voice-tile-av-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}

.voice-tile-av-wrap.speaking {
    box-shadow: 0 0 0 4px #3ba55d;
}

.voice-tile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.voice-tile-initials {
    background: #5865f2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    border-radius: 50%;
}

.voice-tile-name {
    font-size: 14px;
    font-weight: 600;
    color: #dcddde;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.voice-tile-icons {
    display: flex;
    gap: 4px;
    font-size: 16px;
    min-height: 20px;
}

.voice-full-controls {
    display: flex;
    justify-content: center;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.voice-full-leave-btn {
    background: #ed4245;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.02em;
}

.voice-full-leave-btn:hover {
    background: #c03537;
}

/* ── Join Voice splash button (shown in messages-container) ── */

.voice-join-splash-btn {
    margin-top: 12px;
    padding: 10px 28px;
    font-size: 15px;
    width: auto;
}

/* ── Channel list — wrapper + voice participant sub-entries ── */

.channel-group {
    display: flex;
    flex-direction: column;
}

.voice-channel-participants {
    padding: 2px 0 4px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-channel-participant {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #96989d;
}

.voice-mini-av {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.voice-mini-initials {
    background: #5865f2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
}

.voice-mini-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* ── Messages panel needs relative positioning for the floating voice panel ── */

.messages-panel {
    position: relative;
}

/* ── Voice Mini Panel (floating box anchored just above the input bar) ── */

.voice-mini-panel {
    position: absolute;
    bottom: 72px;
    right: 12px;
    z-index: 100;
    width: 220px;
    background: #1a2a20;
    border: 1px solid #3ba55d;
    border-radius: 10px;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.vmp-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vmp-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.vmp-label {
    font-size: 12px;
    font-weight: 600;
    color: #3ba55d;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vmp-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.vmp-return-btn,
.vmp-leave-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
}

.vmp-return-btn {
    color: #dcddde;
}

.vmp-return-btn:hover {
    background: rgba(255,255,255,0.1);
}

.vmp-leave-btn {
    color: #ed4245;
}

.vmp-leave-btn:hover {
    background: rgba(237,66,69,0.15);
}

.vmp-participant {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}

.vmp-participant.vmp-speaking {
    box-shadow: 0 0 0 2px #3ba55d;
}

.vmp-participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.vmp-participant-initials {
    background: #5865f2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.vmp-last-speaker {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #96989d;
    padding: 2px 0;
}

.vmp-ls-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.vmp-ls-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.vmp-ls-initials {
    background: #5865f2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
}

.vmp-ls-name {
    color: #dcddde;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vmp-controls {
    display: flex;
    gap: 6px;
    justify-content: center;
}


/* ── DM Voice Split Bar (sits above messagesContainer, fixed height) ── */

.dm-voice-bar {
    flex-shrink: 0;
    height: 180px;
    background: #1a2a20;
    border-bottom: 2px solid #3ba55d;
    flex-direction: column;
    overflow: hidden;
}

.dm-voice-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3ba55d;
    flex-shrink: 0;
    border-bottom: 1px solid #1e5c38;
}

.dm-voice-bar-leave {
    background: #ed4245;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.dm-voice-bar-leave:hover {
    background: #c03537;
}

.dm-voice-bar-grid {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
}

/* Compact tile sizing inside the DM bar */
.dm-voice-bar-grid .voice-tile {
    width: 110px;
    min-width: 110px;
    padding: 12px 10px 10px;
    flex-shrink: 0;
}

.dm-voice-bar-grid .voice-tile-av-wrap,
.dm-voice-bar-grid .voice-tile-avatar,
.dm-voice-bar-grid .voice-tile-initials {
    width: 50px;
    height: 50px;
}

.dm-voice-bar-grid .voice-tile-initials {
    font-size: 18px;
}
