/**
 * 멜번 러닝맵 - 통합 음악 플레이어 스타일
 * Spotify, Apple Music, YouTube Music 지원
 */

/* 하단 고정 플레이어 바 */
.music-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: transform 0.3s ease, height 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.music-player-bar.hidden {
    transform: translateY(100%);
}

.music-player-bar.expanded {
    height: 300px;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
}

/* 플레이어 컨테이너 */
.player-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

/* 앨범 아트 */
.player-album-art {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-album-art.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

/* 트랙 정보 */
.player-track-info {
    flex: 1;
    min-width: 0;
    color: white;
}

.player-track-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.player-artist-name {
    font-size: 14px;
    opacity: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #b3b3b3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 컨트롤 버튼 */
.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.player-btn.play-pause {
    width: 50px;
    height: 50px;
    background: white;
    color: #1db954;
    font-size: 24px;
}

.player-btn.play-pause:hover {
    transform: scale(1.15);
}

/* 진행 바 */
.player-progress {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-time {
    font-size: 12px;
    color: white;
    opacity: 0.9;
    min-width: 40px;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-bar-fill::after {
    opacity: 1;
}

/* 볼륨 컨트롤 */
.player-volume {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 서비스 선택 버튼 */
.player-service-selector {
    display: flex;
    gap: 10px;
}

.service-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.service-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.service-btn.active {
    background: white;
    border-color: white;
}

.service-btn.spotify.active {
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    color: white !important;
    border-color: #1db954;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.service-btn.apple-music.active {
    color: #fa243c;
}

.service-btn.youtube-music.active {
    color: #ff0000;
}

/* 플레이리스트 패널 */
.playlist-panel {
    display: none;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
}

.music-player-bar.expanded .playlist-panel {
    display: block;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.playlist-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-right: 12px;
}

.playlist-item-info {
    flex: 1;
    color: white;
}

.playlist-item-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.playlist-item-meta {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

/* 로그인 프롬프트 */
.login-prompt {
    text-align: center;
    color: white;
    padding: 20px;
}

.login-prompt h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.login-prompt p {
    margin: 0 0 20px 0;
    opacity: 0.9;
}

.login-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.login-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-btn.spotify {
    background: #1db954;
    color: white;
}

.login-btn.apple-music {
    background: #fa243c;
    color: white;
}

.login-btn.youtube-music {
    background: #ff0000;
    color: white;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 모바일 최적화 - 대폭 개선 */
@media (max-width: 768px) {
    .music-player-bar {
        height: 60px;
        padding: 6px 10px;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .music-player-bar.expanded {
        height: auto;
        max-height: 55vh;
        overflow-y: auto;
        padding: 10px;
    }
    
    .player-container {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* 앨범 아트 */
    .player-album-art {
        width: 42px;
        height: 42px;
        border-radius: 5px;
        flex-shrink: 0;
    }
    
    /* 트랙 정보 */
    .player-track-info {
        flex: 1;
        min-width: 0;
    }
    
    .player-track-name {
        font-size: 11px;
        font-weight: 600;
        margin-bottom: 1px;
    }
    
    .player-artist-name {
        font-size: 9px;
    }
    
    /* 컨트롤 버튼 */
    .player-controls {
        gap: 3px;
        flex-shrink: 0;
    }
    
    .player-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .player-btn.play-pause {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    /* 진행 바 - 숨김 */
    .player-progress {
        display: none;
    }
    
    /* 볼륨 숨기기 */
    .player-volume {
        display: none;
    }
    
    /* 서비스 선택 버튼 */
    .player-service-selector {
        display: none;
    }
    
    /* 확장 버튼 */
    #player-expand {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* 플레이리스트 패널 */
    .playlist-panel {
        margin-top: 8px;
        max-height: 40vh;
        padding: 8px;
    }
    
    .playlist-item {
        padding: 7px;
        margin-bottom: 5px;
    }
    
    .playlist-item-icon {
        width: 30px;
        height: 30px;
        margin-right: 8px;
        font-size: 14px;
    }
    
    .playlist-item-name {
        font-size: 11px;
    }
    
    .playlist-item-meta {
        font-size: 9px;
    }
    
    /* 로그인 프롬프트 */
    .login-prompt {
        padding: 10px 8px;
    }
    
    .login-prompt h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .login-prompt p {
        font-size: 10px;
        margin-bottom: 10px;
    }
    
    .login-buttons {
        flex-direction: row;
        gap: 6px;
        justify-content: center;
    }
    
    .login-btn {
        padding: 7px 12px;
        font-size: 10px;
        border-radius: 18px;
    }
    
    .login-btn i {
        font-size: 13px;
    }
}

/* 작은 모바일 추가 최적화 */
@media (max-width: 480px) {
    .music-player-bar {
        height: 55px;
        padding: 5px 8px;
    }
    
    .player-album-art {
        width: 38px;
        height: 38px;
    }
    
    .player-track-name {
        font-size: 10px;
    }
    
    .player-artist-name {
        font-size: 8px;
    }
    
    .player-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .player-btn.play-pause {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 6px 10px;
        font-size: 9px;
    }
}

/* 스크롤바 스타일 */
.playlist-panel::-webkit-scrollbar {
    width: 8px;
}

.playlist-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.playlist-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.playlist-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 애니메이션 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.music-player-bar {
    animation: slideUp 0.3s ease-out;
}

/* 로딩 상태 */
.player-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 10px;
}

.player-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* 서비스별 테마 */
.music-player-bar.spotify-theme {
    background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%) !important;
}

.music-player-bar.youtube-theme {
    background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%) !important;
}

/* 로그인 프롬프트 스타일 개선 */
.login-prompt {
    text-align: center;
    padding: 30px 20px;
    color: white;
}

.login-prompt h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.login-prompt p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 24px;
}

.login-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.login-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.login-btn.spotify {
    background: #1DB954;
    color: white;
}

.login-btn.spotify:hover {
    background: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.login-btn.youtube {
    background: #FF0000;
    color: white;
}

.login-btn.youtube:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
}

.login-btn i {
    font-size: 1.1rem;
}


/* ========================================
   스마트 추천 플레이리스트 스타일
   ======================================== */

/* 스마트 추천 섹션 */
.smart-rec-section {
    margin-bottom: 15px;
}

.smart-rec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.smart-rec-badge {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smart-rec-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

/* 추천 플레이리스트 아이템 - Featured */
.playlist-item.featured {
    background: linear-gradient(135deg, rgba(29, 185, 84, 0.3) 0%, rgba(25, 20, 20, 0.5) 100%);
    border: 1px solid rgba(29, 185, 84, 0.4);
    padding: 15px;
    border-radius: 12px;
}

.playlist-item.featured:hover {
    background: linear-gradient(135deg, rgba(29, 185, 84, 0.4) 0%, rgba(25, 20, 20, 0.6) 100%);
    border-color: rgba(29, 185, 84, 0.6);
    transform: translateX(5px);
}

/* 추천 플레이리스트 아이템 - Compact */
.playlist-item.compact {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
}

.playlist-item.compact:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 카테고리 배지 */
.playlist-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

/* 플레이리스트 설명 */
.playlist-item-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 4px 0 0 0;
    line-height: 1.3;
}

/* 재생 버튼 */
.playlist-item-play {
    color: #1db954;
    font-size: 1.8rem;
    opacity: 0.7;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 10px;
}

.playlist-item:hover .playlist-item-play {
    opacity: 1;
    transform: scale(1.1);
}

/* 모바일 스마트 추천 */
@media (max-width: 768px) {
    .smart-rec-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .smart-rec-badge {
        font-size: 0.65rem;
        padding: 3px 10px;
    }
    
    .smart-rec-message {
        font-size: 0.75rem;
    }
    
    .playlist-item.featured {
        padding: 10px;
    }
    
    .playlist-item-desc {
        display: none;
    }
    
    .playlist-item-play {
        font-size: 1.4rem;
    }
    
    .playlist-category {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
}
