/* ====================================================================
   SC-TOWER v4 - Audio Enhancements CSS
   Voice Activity Indicators, PTT Feedback, Settings & Diagnostics
   ==================================================================== */

/* ====================================================================
   1. VOICE PARTICIPANTS LIST
   ==================================================================== */

.voice-participants-container {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), rgba(0, 191, 255, 0.05));
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.voice-participants-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.voice-participants-title {
    font-size: 16px;
    font-weight: bold;
    color: #00ff88;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-participants-count {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.voice-participant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.voice-participant-item:hover {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(0, 255, 136, 0.4);
    transform: translateX(3px);
}

/* Speaking indicator - animated pulse */
.voice-participant-item.speaking {
    background: rgba(0, 255, 136, 0.15);
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    animation: speakingPulse 1s ease-in-out infinite;
}

@keyframes speakingPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
        border-color: #00ff88;
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
        border-color: #00ffbb;
    }
}

.voice-participant-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(100, 100, 100, 0.5);
    border: 2px solid rgba(150, 150, 150, 0.5);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.voice-participant-item.speaking .voice-participant-indicator {
    background: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    animation: indicatorPulse 0.8s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

.voice-participant-name {
    flex: 1;
    font-size: 14px;
    color: #e0e0e0;
    font-weight: 500;
}

.voice-participant-item.speaking .voice-participant-name {
    color: #00ff88;
    font-weight: 600;
}

.voice-participant-volume {
    width: 60px;
    height: 4px;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.voice-participant-volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00bfff);
    border-radius: 2px;
    transition: width 0.1s ease;
    width: 0%;
}

.voice-participant-item.speaking .voice-participant-volume-bar {
    animation: volumeFlicker 0.3s ease-in-out infinite;
}

@keyframes volumeFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Empty state */
.voice-participants-empty {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* ====================================================================
   2. PTT VISUAL FEEDBACK
   ==================================================================== */

/* PTT Button Enhanced States */
.ptt-btn {
    position: relative;
    transition: all 0.2s ease;
}

.ptt-btn.active {
    background: linear-gradient(135deg, #00ff88, #00bfff);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
    animation: pttPulse 0.8s ease-in-out infinite;
    transform: scale(1.05);
}

@keyframes pttPulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
    }
    50% {
        box-shadow: 0 0 45px rgba(0, 255, 136, 0.9);
    }
}

.ptt-btn.active::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #00ff88;
    border-radius: inherit;
    animation: pttRipple 1s ease-out infinite;
}

@keyframes pttRipple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Fullscreen Transmitting Overlay */
.ptt-transmitting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 136, 0.1);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
    animation: overlayFadeIn 0.2s ease;
}

.ptt-transmitting-overlay.active {
    display: flex;
}

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

.ptt-transmitting-indicator {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #00ff88;
    border-radius: 15px;
    padding: 30px 60px;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.5);
    animation: transmitPulse 1s ease-in-out infinite;
}

@keyframes transmitPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 50px rgba(0, 255, 136, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 70px rgba(0, 255, 136, 0.8);
    }
}

.ptt-transmitting-text {
    font-size: 32px;
    font-weight: bold;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ptt-transmitting-icon {
    font-size: 40px;
    animation: iconRotate 2s linear infinite;
}

@keyframes iconRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ====================================================================
   3. AUDIO SETTINGS PANEL
   ==================================================================== */

.audio-settings-panel {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(16, 16, 36, 0.95));
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.audio-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.audio-settings-title {
    font-size: 18px;
    font-weight: bold;
    color: #00ff88;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-settings-toggle {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: #00ff88;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.audio-settings-toggle:hover {
    background: rgba(0, 255, 136, 0.3);
    border-color: #00ff88;
}

.audio-settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.audio-setting-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-setting-label {
    font-size: 14px;
    color: #00ff88;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-setting-select,
.audio-setting-input {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.audio-setting-select:hover,
.audio-setting-input:hover {
    border-color: rgba(0, 255, 136, 0.5);
}

.audio-setting-select:focus,
.audio-setting-input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.audio-setting-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 3px;
    outline: none;
}

.audio-setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    transition: all 0.2s ease;
}

.audio-setting-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
}

.audio-setting-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    transition: all 0.2s ease;
    border: none;
}

.audio-setting-value {
    display: inline-block;
    min-width: 40px;
    text-align: right;
    color: #00bfff;
    font-weight: 600;
    font-size: 14px;
}

.audio-setting-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-setting-checkbox-wrapper:hover {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(0, 255, 136, 0.4);
}

.audio-setting-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #00ff88;
}

.audio-setting-checkbox-label {
    flex: 1;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
}

/* ====================================================================
   4. AUDIO DIAGNOSTICS PANEL
   ==================================================================== */

.audio-diagnostics-panel {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(16, 16, 36, 0.95));
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.audio-diagnostics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 191, 255, 0.2);
}

.audio-diagnostics-title {
    font-size: 18px;
    font-weight: bold;
    color: #00bfff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-diagnostics-refresh {
    background: rgba(0, 191, 255, 0.2);
    border: 1px solid rgba(0, 191, 255, 0.4);
    color: #00bfff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.audio-diagnostics-refresh:hover {
    background: rgba(0, 191, 255, 0.3);
    border-color: #00bfff;
}

.audio-diagnostics-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.audio-diagnostic-item {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audio-diagnostic-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.audio-diagnostic-value {
    font-size: 16px;
    color: #00bfff;
    font-weight: 600;
}

.audio-diagnostic-value.good {
    color: #00ff88;
}

.audio-diagnostic-value.warning {
    color: #ffaa00;
}

.audio-diagnostic-value.error {
    color: #ff4444;
}

.audio-diagnostic-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-diagnostic-status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
}

.audio-diagnostic-status-icon.connected {
    background: #00ff88;
    box-shadow: 0 0 8px #00ff88;
}

.audio-diagnostic-status-icon.connecting {
    background: #ffaa00;
    animation: statusBlink 1s ease-in-out infinite;
}

.audio-diagnostic-status-icon.disconnected {
    background: #ff4444;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ====================================================================
   5. TRANSMISSION QUEUE INDICATOR
   ==================================================================== */

.transmission-queue-indicator {
    position: fixed;
    bottom: 120px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffaa00;
    border-radius: 10px;
    padding: 15px 20px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
    z-index: 1000;
    animation: queueSlideIn 0.3s ease;
}

.transmission-queue-indicator.active {
    display: flex;
}

@keyframes queueSlideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.transmission-queue-title {
    font-size: 14px;
    color: #ffaa00;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.transmission-queue-position {
    font-size: 24px;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
}

.transmission-queue-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* ====================================================================
   6. RESPONSIVE DESIGN
   ==================================================================== */

@media (max-width: 768px) {
    .audio-diagnostics-content {
        grid-template-columns: 1fr;
    }

    .ptt-transmitting-text {
        font-size: 24px;
    }

    .ptt-transmitting-indicator {
        padding: 20px 40px;
    }

    .transmission-queue-indicator {
        bottom: 80px;
        right: 10px;
        padding: 10px 15px;
    }
}
