/* web/css/audio.css */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

/* ===== АУДИО ИНДИКАТОР ===== */
#audio-indicator {
    font-family: var(--font-tech);
    font-size: var(--font-size-lg);
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    min-width: 60px; /* Фиксированная минимальная ширина */
    width: 60px; /* Фиксированная ширина */
    text-align: center;
    user-select: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

#audio-indicator.active {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    animation: pulse 1s ease-in-out infinite;
}

#audio-indicator.muted {
    color: #666 !important;
    border-color: #333;
    animation: none !important;
    box-shadow: none !important;
}

/* ===== ОБЕРТКА ДЛЯ АУДИО ===== */
.audio-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ===== РЕГУЛЯТОР ГРОМКОСТИ ===== */
.volume-control {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 15, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 8px;
    padding: 10px 16px;
    display: none;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: volumeFadeIn 0.15s ease;
    min-width: 100px;
}

.audio-wrapper:hover .volume-control {
    display: flex;
}

.volume-control:hover {
    display: flex !important;
}

@keyframes volumeFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ===== ОБЕРТКА ДЛЯ ПОЛЗУНКА ===== */
.volume-slider-wrapper {
    position: relative;
    width: 80px;
    height: 20px;
    display: flex;
    align-items: center;
}

/* ===== ТРЕК (фон) ===== */
.volume-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    pointer-events: none;
    overflow: hidden;
}

/* ===== ЗАЛИВКА ТРЕКА ===== */
.volume-track-fill {
    height: 100%;
    width: 0%;
    background: #00ff88;
    border-radius: 2px;
    transition: width 0.05s linear;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* ===== ПОЛЗУНОК ===== */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: 100%;
    height: 20px;
    background: transparent;
    outline: none;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.5);
    transition: all 0.15s ease;
    border: 2px solid rgba(0, 255, 136, 0.3);
    margin-top: -5px;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 24px rgba(0, 255, 136, 0.7);
    border-color: #00ff88;
}

.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: transparent;
    border: none;
    border-radius: 2px;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #00ff88;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.5);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 24px rgba(0, 255, 136, 0.7);
    border-color: #00ff88;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    background: transparent;
    border: none;
    border-radius: 2px;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
    .volume-control {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        padding: 12px 20px;
        border-radius: 10px;
        background: rgba(10, 20, 15, 0.98);
        border: 1px solid rgba(0, 255, 136, 0.3);
        display: none !important;
        min-width: 140px;
    }

    .audio-wrapper .volume-control.visible {
        display: flex !important;
        animation: volumeFadeInMobile 0.2s ease;
    }

    @keyframes volumeFadeInMobile {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(10px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0) scale(1);
        }
    }

    .volume-slider-wrapper {
        width: 120px;
    }
}

@media (max-width: 480px) {
    .volume-control {
        padding: 10px 16px;
        bottom: 70px;
        min-width: 120px;
    }

    .volume-slider-wrapper {
        width: 100px;
    }
}

@media (hover: none) {
    .audio-wrapper:hover .volume-control {
        display: none !important;
    }
}

.audio-wrapper.touch-active .volume-control {
    display: flex !important;
}