/* =========================================
   상단 고정 바 (Top Bar) 스타일
   ========================================= */

/* 상단 바 컨테이너 */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 76px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: linear-gradient(135deg, rgba(30, 28, 35, 0.92), rgba(25, 22, 30, 0.95));
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 2px solid rgba(212, 165, 116, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(212, 165, 116, 0.1) inset;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    isolation: isolate;
    contain: strict;
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    font-family: var(--f-sans);
}

/* 좌측: 상태 정보 */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}
.top-bar-left .stat {
    display: flex;
    align-items: center;
    gap: 6px;
}
.top-bar-left .stat-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.top-bar-left .stat-value {
    font-size: 0.85rem;
    color: var(--c-accent);
    font-weight: 700;
}

/* 중앙: 플레이어 */
.top-bar-center {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    max-width: 550px;
}

/* 컨트롤 버튼 그룹 */
.player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.top-bar-center .ctrl-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.top-bar-center .ctrl-btn:hover {
    color: var(--c-accent);
}
.top-bar-center .play-icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--c-accent);
    color: #1a1f2e;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.top-bar-center .play-icon-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(212, 165, 116, 0.5);
}
.top-bar-center .play-icon-btn i {
    line-height: 1;
    margin-left: 2px;
}

/* 곡 정보 */
.top-bar-center .now-playing {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 140px;
    flex-shrink: 0;
}
.top-bar-center .song-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.top-bar-center .artist {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 프로그레스 섹션 */
.progress-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.time-display {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    font-family: var(--f-sans);
    min-width: 32px;
    text-align: center;
}
.top-bar-center .progress-bar-wrap {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}
.top-bar-center .progress-bar-wrap:hover {
    height: 7px;
}
.top-bar-center .progress-bar {
    height: 100%;
    background: var(--c-accent);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
    pointer-events: none;
    position: relative;
}
.top-bar-center .progress-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
}

/* 우측: 플레이리스트 토글 */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}
.mobile-play-btn {
    display: none;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--c-accent);
    color: #1a1f2e;
    font-size: 0.7rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.mobile-play-btn:hover {
    transform: scale(1.05);
}
.playlist-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(212, 165, 116, 0.15);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.playlist-toggle:hover {
    background: rgba(212, 165, 116, 0.2);
    border-color: rgba(212, 165, 116, 0.5);
}
.playlist-toggle.active {
    background: var(--c-accent);
    color: #1a1f2e;
    border-color: var(--c-accent);
}
.playlist-toggle i {
    font-size: 0.95rem;
}

/* 플레이리스트 드롭다운 패널 */
.playlist-dropdown {
    position: fixed;
    top: 76px;
    right: 0;
    width: 340px;
    max-height: calc(100vh - 76px);
    background: rgba(26, 31, 46, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(212, 165, 116, 0.25);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999;
}
.playlist-dropdown.open { transform: translateX(0); }
.playlist-dropdown-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--c-accent);
}
.playlist-dropdown-list {
    padding: 15px 0;
}
.playlist-dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 25px;
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent;
}
.playlist-dropdown-item:hover { background: rgba(255,255,255,0.05); }
.playlist-dropdown-item.active { 
    background: var(--c-accent-soft); 
    border-left-color: var(--c-accent);
}
.playlist-dropdown-item .track-num {
    width: 28px;
    font-size: 0.85rem;
    color: #fff;
    text-align: center;
}
.playlist-dropdown-item.active .track-num { color: var(--c-accent); }
.playlist-dropdown-item .track-info {
    flex: 1;
    min-width: 0;
}
.playlist-dropdown-item .track-title {
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-dropdown-item .track-artist {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
}

/* 모바일 반응형 */
@media (max-width: 950px) {
    .top-bar {
        height: 52px;
        padding: 0 16px;
    }
    /* 좌측: 상태 정보 표시 */
    .top-bar-left {
        display: flex;
        gap: 16px;
    }
    .top-bar-left .stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .top-bar-left .stat-label {
        font-size: 0.55rem;
        letter-spacing: 0.5px;
    }
    .top-bar-left .stat-value {
        font-size: 0.8rem;
    }
    /* 중앙: 플레이어 숨김 */
    .top-bar-center {
        display: none;
    }
    body { padding-top: 52px !important; }
    
    /* 모바일 플레이 버튼 표시 */
    .mobile-play-btn { display: flex; }
    .playlist-toggle { 
        padding: 8px 12px;
    }
    .playlist-toggle span { display: none; }
    .playlist-dropdown { width: 100%; top: 52px; max-height: calc(100vh - 52px); }
}
