/* Redesigned Audio Dropdown with Music Selection and Toggles */

/* Desktop Audio Dropdown */
.audio-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    background: linear-gradient(180deg, 
        rgba(30, 30, 40, 0.98) 0%, 
        rgba(20, 20, 30, 0.98) 100%) !important;
    border: 2px solid rgba(139, 69, 19, 0.6) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8) !important;
    padding: 0 !important;
    min-width: 280px !important;
    backdrop-filter: blur(10px) !important;
    overflow: visible !important;
    z-index: 999999 !important;
}

/* Visible state */
.audio-dropdown:not(.hidden) {
    display: block !important;
}

/* Hidden state */
.audio-dropdown.hidden {
    display: none !important;
}

/* Audio Sections */
.audio-section {
    padding: 12px;
}

.audio-section-header {
    color: rgba(255, 215, 0, 0.9);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

/* Toggle Row */
.audio-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    margin-bottom: 8px;
}

.toggle-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Toggle Switch */
.audio-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.audio-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(60, 60, 70, 0.8);
    transition: all 0.3s ease;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.audio-toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(90deg, 
        rgba(255, 193, 7, 0.8) 0%, 
        rgba(255, 152, 0, 0.8) 100%);
    border-color: rgba(255, 193, 7, 0.4);
}

.audio-toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background: #fff;
}

/* Music Selection Area */
.music-selection {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.music-selection::-webkit-scrollbar {
    width: 6px;
}

.music-selection::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.music-selection::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.3);
    border-radius: 3px;
}

.music-selection::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 193, 7, 0.5);
}

/* Disabled state for music selection */
.music-selection.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Song Items */
.audio-dropdown .dropdown-item,
.mobile-audio-dropdown .dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 2px 0;
}

.audio-dropdown .dropdown-item:hover,
.mobile-audio-dropdown .dropdown-item:hover {
    background: rgba(255, 193, 7, 0.15);
    transform: translateX(2px);
}

.audio-dropdown .dropdown-item.active,
.mobile-audio-dropdown .dropdown-item.active {
    background: rgba(255, 193, 7, 0.25);
    border-left: 3px solid rgba(255, 193, 7, 0.8);
    padding-left: 5px;
}

.song-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.playing-icon {
    color: rgba(255, 193, 7, 0.9);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Divider */
.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 69, 19, 0.4) 50%, 
        transparent 100%);
    margin: 0;
}

/* Mobile Audio Dropdown */
.mobile-audio-dropdown {
    position: fixed !important;
    top: 55px !important;
    right: 10px !important;
    background: linear-gradient(180deg, 
        rgba(30, 30, 40, 0.98) 0%, 
        rgba(20, 20, 30, 0.98) 100%);
    border: 2px solid rgba(139, 69, 19, 0.6);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    padding: 0;
    min-width: 250px;
    z-index: 1001;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.mobile-audio-dropdown .audio-section {
    padding: 10px;
}

.mobile-audio-dropdown .audio-section-header {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.mobile-audio-dropdown .audio-toggle-row {
    padding: 6px 2px;
    margin-bottom: 6px;
}

.mobile-audio-dropdown .toggle-label {
    font-size: 12px;
}

.mobile-audio-dropdown .audio-toggle-switch {
    width: 42px;
    height: 22px;
}

.mobile-audio-dropdown .toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
}

.mobile-audio-dropdown .audio-toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.mobile-audio-dropdown .song-name {
    font-size: 12px;
}

.mobile-audio-dropdown .dropdown-item {
    padding: 8px 6px;
}

/* Visual feedback for muted states */
.audio-control.music-muted .mute-button::after,
.mobile-audio-btn.music-muted::after {
    content: '🎵';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    opacity: 0.5;
    text-decoration: line-through;
}

.audio-control.sfx-muted .mute-button::after,
.mobile-audio-btn.sfx-muted::after {
    content: '🔊';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 12px;
    opacity: 0.5;
    text-decoration: line-through;
}

/* Hover effects for toggle switches */
.audio-toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mobile-audio-dropdown {
        min-width: 220px;
        right: 5px;
        top: 45px;
    }
}
/* Volume Control Row */
.volume-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    margin: 8px 0;
}

.volume-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    white-space: nowrap;
}

.volume-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(60, 60, 70, 0.8);
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.volume-value {
    color: rgba(255, 215, 0, 0.9);
    font-size: 12px;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}
