/* 플레이리스트 페이지 전용 스타일 */

/* 플레이리스트 오버레이 */
.playlist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 플레이리스트 레이어 */
.playlist-layer {
    position: relative;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 닫기 버튼 */
.playlist-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.playlist-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* 검색 섹션 */
.playlist-search-section {
    margin-bottom: 15px;
    padding-top: 10px;
}

/* 플레이리스트 목록 섹션 */
.playlist-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 검색 영역 */
.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 5px 40px 5px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 카테고리 선택 */
.category-container {
    margin-bottom: 15px;
}

.category-select {
    width: 100%;
    padding: 5px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.category-select option {
    background: #2d3e50;
    color: white;
}

/* 장르 선택 시 플레이/저장/해제/공유 버튼 */
.genre-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.genre-action-btn {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.genre-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.genre-action-btn#genrePlayBtn {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* 저장할 장르 다중 선택 */
.saved-genres-section {
    margin-bottom: 12px;
}
.saved-genres-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}
.saved-genres-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    max-height: 80px;
    overflow-y: auto;
}
.saved-genre-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}
.saved-genre-checkbox-label input {
    margin: 0;
}

/* 표시 영역 */
.display-area {
    min-height: 300px;
    margin-bottom: 15px;
}

/* 앨범 아트 뷰 */
.album-view {
    text-align: center;
}

.now-playing-info {
    margin-top: 20px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.now-playing-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
}

.now-playing-artist {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* 플레이리스트 뷰 */
.playlist-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    margin-bottom: 10px;
}

.playlist-header span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.toggle-view-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 플레이리스트 컨테이너 */
.playlist {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.playlist::-webkit-scrollbar {
    width: 8px;
}

.playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

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

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

/* 플레이리스트 아이템 */
.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.playlist-item.active {
    background: rgba(102, 126, 234, 0.3);
    border-left: 3px solid #667eea;
}

.playlist-item-info {
    flex: 1;
    text-align: left;
}

.playlist-item-title {
    font-size: 15px;
    font-weight: 500;
    color: white;
    margin-bottom: 4px;
}

.playlist-item-artist {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.playlist-item-play {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.playlist-item:hover .playlist-item-play {
    color: rgba(255, 255, 255, 0.9);
}

.playlist-item.active .playlist-item-play {
    color: #667eea;
}

.playlist-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.playlist-item-share {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}
.playlist-item-share:hover {
    background: rgba(255, 255, 255, 0.2);
}
.playlist-item-drag {
    cursor: grab;
    color: rgba(255, 255, 255, 0.65);
    padding: 0 8px;
    user-select: none;
    font-size: 16px;
    letter-spacing: 1px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}
.playlist-item-drag:hover {
    color: rgba(255, 255, 255, 0.9);
}
.playlist-item-drag:active {
    cursor: grabbing;
}
.playlist-item-draggable.playlist-item-dragging {
    opacity: 0.6;
}
.playlist-item-drag-over {
    border-top: 2px solid #667eea;
}

.playlist-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* 플레이리스트 추천 뷰 (장르 미선택 시) */
.playlist-recommendation {
    padding: 0 10px 20px;
    overflow-y: auto;
}
.recommend-section {
    margin-bottom: 20px;
}
.recommend-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 4px 0;
}
.recommend-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
.recommend-more-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}
.recommend-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.recommend-albums-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.recommend-album-card {
    flex: 0 0 100px;
    cursor: pointer;
    text-align: center;
}
.recommend-album-art {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 6px;
}
.recommend-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recommend-album-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recommend-tracks-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.recommend-track-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
}
.recommend-track-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.recommend-track-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.recommend-track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recommend-track-info {
    flex: 1;
    min-width: 0;
}
.recommend-track-title {
    font-size: 14px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recommend-track-play {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.8);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recommend-track-play:hover {
    background: rgba(102, 126, 234, 1);
}

/* 뷰 전환 버튼 */
.show-playlist-btn {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 15px;
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-playlist-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .playlist-layer {
        width: 95%;
        max-height: 90vh;
        padding: 15px;
    }
    
    .playlist-close-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }
    
    .search-input {
        font-size: 14px;
        padding: 5px 35px 5px 10px;
    }
    
    .category-select {
        font-size: 14px;
        padding: 5px 10px;
    }
    
    .playlist-item {
        padding: 5px 12px;
    }
    
    .playlist-item-title {
        font-size: 14px;
    }
    
    .playlist-item-artist {
        font-size: 12px;
    }
    
    .now-playing-title {
        font-size: 16px;
    }
    
    .now-playing-artist {
        font-size: 13px;
    }
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
    .playlist-overlay {
        -webkit-tap-highlight-color: transparent;
    }
    
    .playlist-close-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .playlist-item {
        min-height: 44px; /* 터치하기 쉬운 최소 높이 */
    }
}

/* 앨범 패널 (homeBtn → 앨범 레이어) */
.bottom-sheet-album-panel {
    padding: 16px;
    overflow-y: auto;
    max-height: 70vh;
}
.album-panel-header {
    margin-bottom: 12px;
}
.album-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.album-panel-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.album-action-btn {
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.album-action-btn:hover {
    background: rgba(255,255,255,0.2);
}
.album-grid-container {
    display: block;
}
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}
.album-card {
    cursor: pointer;
    text-align: center;
}
.album-card-art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.album-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.album-card-art-placeholder {
    font-size: 2rem;
}
.album-card-title {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.album-detail-panel {
    padding: 0;
}
.album-back-btn {
    margin-bottom: 12px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}
.album-detail-art {
    width: 100%;
    max-width: 240px;
    margin: 0 auto 12px;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.album-detail-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.album-detail-art-placeholder {
    font-size: 4rem;
}
.album-detail-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}
.album-detail-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.album-detail-btn:hover {
    background: rgba(255,255,255,0.2);
}
.album-detail-play {
    background: rgba(255,255,255,0.25);
    font-weight: 600;
}
.album-detail-info {
    margin-bottom: 12px;
}
.album-detail-header {
    margin-bottom: 12px;
}
.album-detail-name {
    font-size: 1.1rem;
    color: #fff;
    margin: 0 0 4px 0;
}
.album-detail-producer {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}
.album-detail-tracks {
    list-style: none;
    padding: 0;
    margin: 0;
}
/* 앨범 곡 항목: 플레이리스트와 동일한 레이아웃(곡명/작성자 + 우측 공유·재생) */
.album-detail-track {
    border-bottom: none;
    margin-bottom: 8px;
}
.album-detail-track:last-child {
    margin-bottom: 0;
}

/* 하단 시트 검색 패널 */
.bottom-sheet-search-panel {
    padding: 12px 12px 12px 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.bottom-sheet-search-panel .sheet-search-page-header {
    margin-bottom: 12px;
    padding: 0;
}
.sheet-search-header {
    margin-bottom: 14px;
}
.sheet-search-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.sheet-search-form {
    margin-bottom: 14px;
}
.sheet-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.sheet-search-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
}
.sheet-search-input::placeholder {
    color: rgba(255,255,255,0.5);
}
.sheet-search-type {
    padding: 8px 12px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}
.sheet-search-type option {
    background: #3d4a5c;
    color: #fff;
}
.sheet-search-type option:hover,
.sheet-search-type option:focus,
.sheet-search-type option:checked {
    background: #667eea;
    color: #fff;
}
.sheet-search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.sheet-search-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.sheet-search-reset-btn {
    padding: 10px 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    cursor: pointer;
}
.sheet-search-reset-btn:hover {
    background: rgba(255,255,255,0.15);
}
.sheet-search-results-wrap {
    flex: 1;
    overflow-y: auto;
}
.sheet-search-results {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sheet-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.sheet-search-result-item:hover {
    background: rgba(255,255,255,0.06);
}
.sheet-search-result-info {
    flex: 1;
    min-width: 0;
}
.sheet-search-result-title {
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sheet-search-result-artist {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sheet-search-result-play {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.6);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sheet-search-result-play:hover {
    background: rgba(102, 126, 234, 0.9);
}
.sheet-search-empty {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255,255,255,0.6);
}

