﻿

/* Voice layout */
.voice-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    max-width: 100%;
    overflow: hidden;
}

.voice-main {
    display: flex;
    flex: 1;
    min-height: 0;
}

.voice-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px;
}

.voice-channel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.voice-channel-header h2 {
    margin: 0;
    font-family: var(--fd), sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--t1);
}

.voice-channel-icon {
    color: var(--t3);
    font-size: 18px;
}

.voice-connect-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
}

.voice-error {
    color: var(--red);
    font-size: 13px;
    margin: 0;
}

.btn-join {
    padding: 12px 32px;
    background: var(--a2);
    color: #0a0b0f;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--fd), sans-serif;
    font-weight: 700;
    font-size: 16px;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-join:hover:not(:disabled) {
    background: #00c98a;
    box-shadow: 0 0 16px rgba(0, 229, 160, 0.25);
    transform: translateY(-1px);
}

.btn-join:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Voice sidebar */
.voice-participants-sidebar {
    width: 280px;
    min-width: 280px;
    border-left: 1px solid var(--brd);
    background: var(--bg1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.voice-participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 12px;
}

/* Voice controls */
.voice-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--bg1);
    border-top: 1px solid var(--brd);
}

.voice-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 52px;
    height: 52px;
    justify-content: center;
    background: var(--bg3);
    color: var(--t2);
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}

.voice-control-btn .bi {
    font-size: 18px;
}

.voice-control-btn span {
    font-size: 0;
}

.voice-control-btn:hover {
    background: var(--bg4);
    color: var(--t1);
}


.voice-control-btn.btn-invite-voice {
    background: var(--acc);
    color: #fff;
    width: auto;
    padding: 0 16px;
    flex-direction: row;
    gap: 6px;
}

.voice-control-btn.btn-invite-voice span {
    font-size: 12px;
    font-weight: 500;
}

.voice-control-btn.btn-invite-voice:hover {
    background: #5a9fff;
}

.voice-control-btn.btn-leave {
    background: var(--red);
    color: #fff;
    width: auto;
    padding: 0 20px;
    flex-direction: row;
    gap: 6px;
}

.voice-control-btn.btn-leave span {
    font-size: 13px;
    font-family: var(--fd), sans-serif;
    font-weight: 700;
}

.voice-control-btn.btn-leave:hover {
    background: #e03a3a;
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.25);
}

/* Voice tiles grid */
.voice-tiles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0;
    align-content: center;
    justify-content: center;
}

.voice-tile {
    width: 200px;
    height: 200px;
    background: var(--bg2);
    border-radius: 20px;
    border: 1px solid var(--brd);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.voice-tile-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}


.voice-tile-video--visible + .voice-tile-avatar {
    display: none;
}

.voice-tile-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.voice-tile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--acc), #a855f7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fd), sans-serif;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 8px;
}

.voice-tile-name {
    font-family: var(--fd), sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--t1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 12px;
    text-align: center;
}


.voice-tile-muted-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--red);
}

.voice-sound-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
    margin-top: 4px;
}

.voice-sound-bars span {
    width: 4px;
    background: var(--a2);
    border-radius: 2px;
}

.voice-sound-bars span:nth-child(1) {
    animation: bar1 0.6s ease-in-out infinite;
}

.voice-sound-bars span:nth-child(2) {
    animation: bar2 0.5s ease-in-out infinite 0.1s;
}

.voice-sound-bars span:nth-child(3) {
    animation: bar1 0.55s ease-in-out infinite 0.2s;
}

.voice-sound-bars span:nth-child(4) {
    animation: bar3 0.65s ease-in-out infinite;
}

/* Screen share tile */
.voice-tile-screen {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 16 / 10;
    padding: 0;
}


.voice-tile-screen .screen-share-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 20px;
}


.voice-tile-screen .btn-watch-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--fd), sans-serif;
    font-weight: 600;
    font-size: 14px;
    z-index: 4;
}

.voice-tile-screen .btn-watch-screen:hover {
    background: rgba(0, 0, 0, 0.75);
}

.voice-tile-screen .screen-share-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.voice-tile-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 5;
    transition: background 0.15s;
}

.voice-tile-expand:hover {
    background: rgba(0, 0, 0, 0.8);
}

.voice-tile-expand--camera {
    top: 8px;
    right: 8px;
}

.voice-tile-video-overlay-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.btn-exit-video-fullscreen {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-exit-video-fullscreen:hover {
    background: rgba(0, 0, 0, 0.9);
}


.voice-tile.voice-tile--fullscreen .voice-tile-video {
    flex: 1;
    min-height: 0;
    display: block !important;
}

.voice-tile.voice-tile--fullscreen .voice-tile-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.voice-tile-screen--fullscreen .screen-share-container {
    flex: 1;
    min-height: 0;
    border-radius: 0;
}

.voice-tile-screen--fullscreen .screen-share-container video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.screen-share-overlay-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.screen-share-quality {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.screen-share-quality .quality-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.quality-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.quality-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.quality-btn.active {
    background: var(--acc);
    border-color: var(--acc);
}

.btn-exit-screen-share {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.btn-exit-screen-share:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Participant items in sidebar */
.participant-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.12s;
}

.participant-item:hover {
    background: var(--bg3);
}

.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--acc), #a855f7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fd), sans-serif;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.participant-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--fd), sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--t1);
}

.participant-status {
    font-family: var(--fm), monospace;
    font-size: 11px;
    color: var(--t3);
}

.muted-label {
    font-family: var(--fm), monospace;
    font-size: 11px;
    color: var(--red);
}


/* Voice sidebar tabs */
.voice-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--brd);
    padding: 0 12px;
}

.voice-sidebar-tab {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--t3);
    font-family: var(--fd), sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    text-align: center;
}

.voice-sidebar-tab:hover {
    color: var(--t2);
}

.voice-sidebar-tab.active {
    color: var(--acc);
    border-bottom-color: var(--acc);
}

/* Voice sidebar chat */
.voice-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.voice-chat-empty {
    text-align: center;
    color: var(--t3);
    font-size: 13px;
    margin-top: 24px;
}

.voice-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--brd);
}

.voice-chat-input input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg3);
    border: 1px solid var(--brd);
    border-radius: 10px;
    color: var(--t1);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.voice-chat-input input::placeholder {
    color: var(--t3);
}

.voice-chat-input input:focus {
    border-color: rgba(61, 139, 255, 0.35);
}

.voice-chat-send {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--acc);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}

.voice-chat-send:hover {
    background: #5a9fff;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    animation: fadeIn 0.15s ease forwards;
}


.af-modal-content {
    background: var(--bg2);
    border: 1px solid var(--brd);
    border-radius: 20px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .8);
    overflow: hidden;
}

.af-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--brd);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.af-modal-title {
    font-family: var(--fd), sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--t1);
}

.af-modal-sub {
    font-family: var(--fb), sans-serif;
    font-size: 13px;
    color: var(--t2);
    margin-top: 3px;
}

.af-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg3);
    border: 1px solid var(--brd);
    color: var(--t2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.af-modal-close:hover {
    color: var(--t1);
}

.af-modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg3);
    border: 1px solid var(--brd);
    border-radius: 11px;
    padding: 10px 14px;
    margin: 20px 24px 16px;
    transition: border-color .15s;
}

.af-modal-search:focus-within {
    border-color: rgba(61, 139, 255, .4);
}

.af-modal-search input {
    background: none;
    border: none;
    outline: none;
    font-family: var(--fb), sans-serif;
    font-size: 14px;
    color: var(--t1);
    width: 100%;
}

.af-search-icon {
    color: var(--t3);
    flex-shrink: 0;
}

.af-modal-results {
    padding: 0 24px 24px;
    max-height: 340px;
    overflow-y: auto;
}

.af-hint, .af-empty {
    text-align: center;
    padding: 24px 0 8px;
}

.af-hint-icon, .af-empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.af-hint-title, .af-empty-title {
    font-family: var(--fd), sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--t2);
}

.af-hint-sub, .af-empty-sub {
    font-family: var(--fb), sans-serif;
    font-size: 13px;
    color: var(--t3);
    margin-top: 4px;
}

.af-hint-example {
    color: var(--acc);
    font-family: var(--fm), monospace;
}

.af-loading {
    text-align: center;
    padding: 24px;
    color: var(--t2);
    font-size: 14px;
}

.af-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.af-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--brd);
    background: var(--bg3);
    transition: border-color .15s;
}

.af-result-row:hover {
    border-color: rgba(61, 139, 255, .3);
}

.af-result-av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--acc), #a855f7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fd), sans-serif;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.af-result-info {
    flex: 1;
    min-width: 0;
}

.af-result-name {
    font-family: var(--fd), sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--t1);
}

.af-result-sub {
    font-family: var(--fb), sans-serif;
    font-size: 12px;
    color: var(--t2);
    margin-top: 1px;
}

.af-result-action {
    flex-shrink: 0;
}

.af-btn-add {
    padding: 7px 16px;
    border-radius: 8px;
    border: none;
    background: var(--acc);
    color: #fff;
    font-family: var(--fm), monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}

.af-btn-add:hover:not(:disabled) {
    opacity: .85;
}

.af-btn-add:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.af-btn-sent {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 160, .3);
    background: rgba(0, 229, 160, .08);
    color: var(--a2);
    font-family: var(--fm), monospace;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.modal-content {
    background: var(--bg2);
    border-radius: 20px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--brd);
    animation: popIn 0.2s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

.modal-content h3 {
    font-family: var(--fd), sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--t1);
    margin: 0 0 4px;
}


.modal-content .field {
    margin: 12px 0;
}

.modal-content .field label {
    display: block;
    margin-bottom: 6px;
    color: var(--t2);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.modal-content .field input,
.modal-content .field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--brd);
    border-radius: 11px;
    background: var(--bg3);
    color: var(--t1);
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-content .field input:focus,
.modal-content .field select:focus {
    outline: none;
    border-color: var(--acc);
    box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.08);
}

.modal-content .field select {
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn-primary {
    padding: 9px 18px;
    background: var(--acc);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-primary:hover:not(:disabled) {
    background: #5a9fff;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 9px 18px;
    background: var(--bg3);
    color: var(--t2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}

.btn-secondary:hover {
    background: var(--bg4);
    color: var(--t1);
}

.voice-invite-modal h3, .voice-invite-received p {
    margin: 0 0 1rem;
}

.friends-invite-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.friend-invite-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.friend-invite-row button {
    margin-left: auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    background: var(--acc);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-close-modal {
    padding: 0.5rem 1rem;
    background: var(--bg4);
    color: var(--t1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}
