:root {
    --bg-color: rgba(30, 30, 30, 1);
    --theme-color: #6a5acd;
    --text-color: #ffffff;
    --player-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: clip;
}

#main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar {
    background-color: var(--theme-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
    z-index: 100;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    font-size: 1.3rem;
    text-transform: uppercase;
}

.nav-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.account-space {
    width: 35px;
    height: 35px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

.category-section {
    margin-bottom: 3rem;
    width: 100%;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-show-all {
    background: none;
    border: none;
    color: var(--theme-color);
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-btn {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: background-color 0.2s;
}

.carousel-btn:hover {
    background-color: var(--theme-color);
}

.carousel-btn.left {
    left: -15px;
}

.carousel-btn.right {
    right: -15px;
}

.carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.album-card, .song-card {
    min-width: 180px;
    max-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.album-card {
    cursor: pointer;
}

.album-cover, .song-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #333;
    border-radius: 8px;
    transition: transform 0.2s;
    position: relative;
    cursor: pointer;
}

.song-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.song-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 8px;
}

.song-image-container:hover .song-play-overlay, .song-image-container.playing .song-play-overlay {
    opacity: 1;
}

.album-card:hover .album-cover, .song-card:hover .song-image-container {
    transform: translateY(-5px);
}

.create-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #222;
    font-size: 3rem;
    color: #555;
}

.album-card:hover .create-cover {
    background-color: #333;
    color: var(--theme-color);
}

.album-info, .song-info {
    display: flex;
    flex-direction: column;
}

.song-info {
    cursor: pointer;
}

.song-info:hover .song-name {
    color: var(--theme-color);
}

.album-name, .song-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.album-origin, .song-artists {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-message {
    text-align: center;
    font-size: 1.2rem;
    color: #aaa;
    padding: 3rem 0;
    width: 100%;
    font-style: italic;
}

.album-detail-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.album-header {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.album-header-cover {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.album-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.album-header-origin {
    color: var(--theme-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.title-with-action {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.album-header-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
}

.album-header-desc {
    color: #ccc;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.song-meta {
    margin-top: 1rem;
    color: #bbb;
    line-height: 1.6;
}

.song-meta p {
    margin-bottom: 0.3rem;
}

.song-meta strong {
    color: #fff;
}

.tracklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.track-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: transparent;
    transition: background-color 0.2s;
}

.track-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.track-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.track-image-container {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    cursor: pointer;
}

.track-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.track-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 4px;
}

.track-image-container:hover .track-play-overlay, .track-item.playing .track-play-overlay {
    opacity: 1;
}

.track-play-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    pointer-events: none;
}

.track-title {
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.track-title:hover {
    color: var(--theme-color);
}

.track-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: white;
}

.btn-icon.active {
    color: var(--theme-color);
}

#player-placeholder {
    position: sticky;
    bottom: 0;
    z-index: 1000;
    width: 100%;
    transition: height 0.3s ease;
    height: 0;
    overflow: hidden;
}

#player-placeholder.visible {
    height: var(--player-height);
}

.global-player {
    width: 100%;
    height: var(--player-height);
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-top: 1px solid #333;
}

.player-left {
    display: flex;
    align-items: center;
    width: 30%;
    gap: 1.5rem;
}

.player-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    gap: 0.4rem;
}

.player-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.player-btn:hover {
    color: var(--theme-color);
}

.player-btn.play-pause {
    font-size: 1.8rem;
}

.player-title-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.2rem;
}

.player-song-title {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.time-text {
    font-size: 0.75rem;
    color: #aaa;
    min-width: 35px;
}

.progress-area {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.progress-bar-bg {
    width: 100%;
    height: 3px;
    background-color: #444;
    border-radius: 2px;
    position: relative;
    pointer-events: none;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--theme-color);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}

.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    gap: 1.2rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #222;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.playlist-item {
    background-color: #333;
    padding: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.playlist-item:hover {
    background-color: #444;
}

.create-playlist-btn {
    background-color: var(--theme-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
}

.create-playlist-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.playlists-grid .album-card {
    min-width: 100%;
    max-width: 100%;
}

.playlist-actions-header {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--theme-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: var(--theme-color);
    color: white;
}

.hidden {
    display: none !important;
}

.footer {
    background-color: var(--theme-color);
    text-align: center;
    padding: 1.5rem;
}

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-center {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--theme-color);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    }
    
    .nav-center.active {
        display: flex;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 2rem;
        justify-content: center;
    }
    
    .carousel-btn {
        display: none;
    }

    .album-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .album-header-cover {
        width: 200px;
        height: 200px;
    }

    .title-with-action {
        justify-content: center;
    }
}

@media (max-width: 700px) {
    .player-left {
        width: 40%;
        gap: 0.5rem;
    }
    .player-image {
        display: none;
    }
    .player-center {
        width: 40%;
    }
    .player-right {
        width: 20%;
        gap: 0.5rem;
    }
    .player-btn.download-btn, .player-btn.album-btn {
        display: none;
    }
    .category-header {
        justify-content: center;
    }
}