* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    grid-template-areas: 
        "search player popular"
        "results player popular";
}

/* 區塊樣式 */
.search-section,
.search-results-section,
.player-section,
.playlist-section,
.popular-section {
    background: rgba(45, 45, 45, 0.8);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.search-section {
    grid-area: search;
}

.search-results-section {
    grid-area: results;
}

.player-section {
    grid-area: player;
}

.popular-section {
    grid-area: popular;
}

/* 標題樣式 */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 500;
}

.section-header .icon {
    font-size: 24px;
    margin-right: 10px;
    color: #f4d03f;
}

.section-header h2 {
    color: #f4d03f;
    font-weight: 500;
}

/* 搜尋區域 */
.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px #f4d03f;
}

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

.search-box button,
.add-to-playlist-btn,
.player-controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #f4d03f;
    color: #1a1a1a;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.search-box button:hover,
.add-to-playlist-btn:hover,
.player-controls button:hover {
    background: #f1c40f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 208, 63, 0.3);
}

/* 搜尋結果 */
.results-container {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.search-result-item img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffffff;
}

.search-result-artist {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.add-to-playlist-btn {
    padding: 8px 16px;
    font-size: 12px;
}

/* 播放器區域 */
.player-container {
    text-align: center;
}

#videoPlayer {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 8px;
    margin-bottom: 20px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.current-song {
    font-size: 16px;
    color: #f4d03f;
}

.player-controls {
    display: flex;
    gap: 10px;
}

.player-controls button {
    padding: 10px 20px;
    font-size: 14px;
}

/* 點歌清單 */
.playlist-container {
    max-height: 300px;
    overflow-y: auto;
}

.current-playing {
    padding: 12px;
    background: rgba(244, 208, 63, 0.2);
    border-radius: 8px;
    border-left: 4px solid #f4d03f;
    margin-bottom: 10px;
    font-weight: 500;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: all 0.3s ease;
}

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

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

.playlist-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

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

.remove-btn {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: rgba(231, 76, 60, 1);
}

/* 熱門排行 */
.popular-container {
    max-height: 500px;
    overflow-y: auto;
}

.popular-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.popular-item .rank {
    font-size: 18px;
    font-weight: 700;
    color: #f4d03f;
    margin-right: 15px;
    min-width: 25px;
}

.popular-item .song-name {
    flex: 1;
    font-weight: 500;
}

.popular-item .play-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(244, 208, 63, 0.6);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 208, 63, 0.8);
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "search player"
            "results popular";
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "search"
            "player"
            "results"
            "popular";
    }
    
    .player-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        flex-direction: column;
    }
}

/* 載入動畫 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.7);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(244, 208, 63, 0.3);
    border-top: 2px solid #f4d03f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

