/* 전역 오디오 플레이어 CSS - 우선순위 충돌 방지 */

/* 기본 오디오 플레이어 스타일 */
#global-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    padding: 8px 20px;
    border-top: 1px solid #333;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateY(0);
    transition: transform 0.3s ease;
    overflow: visible !important;
}

/* 오디오 플레이어 숨김 처리 - 높은 우선순위 */
body.login-page #global-audio-player,
body.register-page #global-audio-player,
body.admin-main-page #global-audio-player,
body.create-admin-page #global-audio-player {
    display: none !important;
}

/* 곡 정보 영역 */
#global-audio-player .current-song-info {
    min-width: 200px;
    max-width: 300px;
    order: 0;
    margin-right: 15px;
}

#global-audio-player .song-title-display {
    color: #e8f4fd;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 컨트롤 버튼 영역 */
#global-audio-player .custom-player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 1;
    flex: 1;
}

/* 스킵 버튼 - SoundCloud 스타일 */
#global-audio-player .skip-btn {
    background: transparent;
    color: #f1c40f;
    border: 1px solid #f1c40f;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

#global-audio-player .skip-btn:hover {
    background: #f1c40f;
    color: #000;
    transform: scale(1.1);
}

/* 재생/일시정지 버튼 - SoundCloud 스타일 */
#global-audio-player .play-pause-btn {
    background: #000;
    color: #f1c40f;
    border: 2px solid #f1c40f;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#global-audio-player .play-pause-btn:hover {
    background: #f1c40f;
    color: #000;
    transform: scale(1.1);
}

#global-audio-player .play-pause-btn:active {
    transform: scale(0.95);
}

/* 시간 표시 */
#global-audio-player .time-display {
    display: flex;
    gap: 5px;
    color: #e8f4fd;
    font-size: 12px;
    min-width: 80px;
}

/* 진행바 - SoundCloud 스타일 */
#global-audio-player .progress-bar {
    flex: 1;
    position: relative;
    height: 4px;
    background: #555;
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
}

#global-audio-player .progress-bar:hover {
    height: 6px;
}

#global-audio-player .progress-fill {
    height: 100%;
    background: #f1c40f;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease, background 0.2s ease;
}

#global-audio-player .progress-bar:hover .progress-fill {
    background: #f39c12;
}

#global-audio-player .progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

/* 볼륨 컨트롤 - SoundCloud 스타일 (세로 팝업) */
#global-audio-player .volume-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    order: 2;
    overflow: visible !important;
}

#global-audio-player .volume-icon {
    color: #f1c40f;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

#global-audio-player .volume-icon:hover {
    transform: scale(1.1);
}

/* 세로 슬라이더 팝업 - body 직접 자식 */
.volume-slider-popup {
    position: fixed;
    /* left와 bottom은 JavaScript에서 동적으로 설정 */
    width: 40px;
    height: 120px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98));
    padding: 7px 10px;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 10001;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* hover 효과 제거 - 클릭으로만 작동 */

/* 클릭으로 활성화된 상태 */
.volume-slider-popup.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* 세로 슬라이더 - 표준 방법 */
.volume-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px;
    height: 100px;
    padding: 0;
    margin: 0;
    background: transparent;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-runnable-track {
    width: 4px;
    height: 100px;
    background: linear-gradient(to top, #f1c40f 0%, #555 0%);
    border-radius: 2px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: -5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(241, 196, 15, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.5), 0 0 0 3px rgba(241, 196, 15, 0.3);
}

.volume-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.volume-slider::-moz-range-track {
    width: 4px;
    height: 100px;
    background: linear-gradient(to top, #f1c40f 0%, #555 0%);
    border-radius: 2px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(241, 196, 15, 0.2);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.5), 0 0 0 3px rgba(241, 196, 15, 0.3);
}

.volume-slider::-moz-range-thumb:active {
    transform: scale(1.1);
}

/* 버튼은 데스크톱에서 기본 숨기기 */
#global-audio-player .volume-up-btn,
#global-audio-player .volume-down-btn {
    display: none;
    background: #f1c40f;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #333;
    font-size: 12px;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#global-audio-player .volume-up-btn:hover,
#global-audio-player .volume-down-btn:hover {
    background: #f39c12;
    transform: scale(1.1);
}

#global-audio-player .volume-display {
    color: #e8f4fd;
    font-size: 12px;
    min-width: 35px;
    text-align: right;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    #global-audio-player {
        padding: 6px 15px;
        gap: 10px;
    }
    
    #global-audio-player .current-song-info {
        min-width: 150px;
        max-width: 200px;
    }
    
    #global-audio-player .song-title-display {
        font-size: 12px;
    }
    
    #global-audio-player .volume-controls {
        min-width: 100px;
        overflow: visible !important;
    }
    
    /* 모바일에서는 슬라이더 팝업만 사용 */
    .volume-slider-popup:not(.active) {
        display: none !important;
    }
    
    /* +/- 버튼 숨기기 */
    #global-audio-player .volume-up-btn,
    #global-audio-player .volume-down-btn {
        display: none !important;
    }
    
    /* 모바일용 팝업 크기 조정 */
    .volume-slider-popup {
        width: 35px;
        height: 94px;
        padding: 7px 8px;
    }
    
    .volume-slider-popup .volume-slider {
        display: block !important;
        writing-mode: vertical-lr !important;
        direction: rtl !important;
        width: 4px !important;
        height: 80px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        outline: none !important;
        cursor: pointer !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .volume-slider-popup .volume-slider::-webkit-slider-runnable-track {
        width: 4px !important;
        height: 80px !important;
        background: linear-gradient(to top, #f1c40f 0%, #555 0%) !important;
        border-radius: 2px !important;
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3) !important;
    }
    
    .volume-slider-popup .volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none !important;
        appearance: none !important;
        width: 14px !important;
        height: 14px !important;
        background: linear-gradient(135deg, #f1c40f, #f39c12) !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        margin-left: -5px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(241, 196, 15, 0.2) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .volume-slider-popup .volume-slider::-moz-range-track {
        width: 4px !important;
        height: 80px !important;
        background: linear-gradient(to top, #f1c40f 0%, #555 0%) !important;
        border-radius: 2px !important;
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3) !important;
    }
    
    .volume-slider-popup .volume-slider::-moz-range-thumb {
        width: 14px !important;
        height: 14px !important;
        background: linear-gradient(135deg, #f1c40f, #f39c12) !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(241, 196, 15, 0.2) !important;
    }
}

@media (max-width: 480px) {
    #global-audio-player .volume-controls {
        overflow: visible !important;
    }
}

@media (max-width: 260px) {
    #global-audio-player .volume-controls {
        overflow: visible !important;
    }
    
    #global-audio-player .volume-up-btn,
    #global-audio-player .volume-down-btn {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }
}
