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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    height: 100vh;
}

header {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

main {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 3rem; /* Default bottom padding */
}

/* When music player is visible, add extra bottom padding */
body:has(#musicPlayer:not(.hidden)) main,
body.music-player-visible main {
    padding-bottom: 140px; /* Space for music player */
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view .view-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    color: #ffffff;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(78, 205, 196, 0.15));
    padding: 1.5rem 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.view .view-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.8s ease;
}

.view .view-title:hover::before {
    left: 100%;
}

/* Artists Grid - Fewer, larger cards */
#artistsList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Albums Grid */
#albumsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Songs Grid */
#songsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Section titles (Albums, Songs) */
#albumsList .section-title, #songsList .section-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    padding: 1rem 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#albumsList .section-title::before, #songsList .section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
}

#albumsList .section-title:hover::before, #songsList .section-title:hover::before {
    left: 100%;
}

.artist-card, .album-card, .song-card {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.artist-card::before, .album-card::before, .song-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.artist-card:hover, .album-card:hover, .song-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.artist-card:hover::before, .album-card:hover::before, .song-card:hover::before {
    opacity: 1;
}

/* Square images */
.artist-card img, .album-card img, .song-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.artist-card:hover img, .album-card:hover img, .song-card:hover img {
    transform: scale(1.05);
}

.artist-card h3, .album-card h3, .song-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.2rem;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.artist-card p, .album-card p, .song-card p {
    color: #b0b0b0;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Artist Detail */
#artistInfo, #albumInfo {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: flex-start;
    background: rgba(30, 30, 30, 0.5);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#artistImage, #albumImage {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#artistDetails, #albumDetails {
    flex: 1;
}

#artistName, #albumName {
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
}

#artistDescription, #albumDescription {
    color: #b0b0b0;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Back buttons */
button[id^="back"] {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    margin-bottom: 2rem;
    cursor: pointer;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

button[id^="back"]:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

/* Music Player */
#musicPlayer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}

#musicPlayer.hidden {
    display: none;
}

#playerInfo {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
}

#currentSongImage {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#currentSongTitle {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
}

#currentArtistName {
    font-size: 0.85rem;
    color: #b0b0b0;
}

#playerControls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#playerControls button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 0.8rem 1.1rem 0.8rem;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#playPauseBtn {
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
}

#playerControls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#playPauseBtn:hover {
    background: linear-gradient(45deg, #ff5252, #26a69a);
    transform: scale(1.1);
}

#playerProgress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 1rem;
}

#currentTime, #totalTime {
    font-size: 0.85rem;
    color: #b0b0b0;
    min-width: 40px;
}

#progressBar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

#progressBar::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#progressBar::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Volume Control */
#volumeControl {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

#volumeIcon {
    font-size: 1.2rem;
    cursor: pointer;
}

#volumeSlider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#volumeSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    main {
        max-width: 1600px;
    }
    
    #artistsList {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 3rem;
    }
    
    .view .view-title {
        font-size: 3rem;
    }
}

/* Desktop (1024px - 1399px) */
@media (max-width: 1399px) {
    main {
        max-width: 1200px;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    header {
        padding: 1rem 1.5rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 2rem 1.5rem;
        max-width: 100%;
        padding-bottom: 2rem;
    }
    
    /* Tablet music player spacing */
    body:has(#musicPlayer:not(.hidden)) main,
    body.music-player-visible main {
        padding-bottom: 120px;
    }
    
    .view .view-title {
        font-size: 2rem;
        padding: 1.2rem 1.5rem;
    }
    
    #artistsList {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    #albumsGrid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.2rem;
    }
    
    #songsGrid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.2rem;
    }
    
    /* Artist/Album Detail */
    #artistInfo, #albumInfo {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    #artistImage, #albumImage {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    /* Music Player - Tablet */
    #musicPlayer {
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }
    
    #playerInfo {
        min-width: 200px;
    }
    
    #currentSongImage {
        width: 50px;
        height: 50px;
    }
    
    #volumeControl {
        min-width: 100px;
    }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) {
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 1.5rem 1rem;
        padding-bottom: 1.5rem;
    }
    
    /* Mobile music player spacing */
    body:has(#musicPlayer:not(.hidden)) main,
    body.music-player-visible main {
        padding-bottom: 180px; /* Extra space for stacked mobile player */
    }
    
    .view .view-title {
        font-size: 1.8rem;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    #albumsList .section-title, #songsList .section-title {
        font-size: 1.5rem;
        padding: 0.8rem 1rem;
    }
    
    #artistsList {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    #albumsGrid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    #songsGrid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    
    .artist-card, .album-card, .song-card {
        padding: 1.2rem;
    }
    
    .artist-card h3, .album-card h3, .song-card h3 {
        font-size: 1.1rem;
    }
    
    /* Artist/Album Detail */
    #artistInfo, #albumInfo {
        padding: 1.5rem;
        gap: 1.2rem;
    }
    
    #artistImage, #albumImage {
        width: 150px;
        height: 150px;
    }
    
    #artistName, #albumName {
        font-size: 1.5rem;
    }
    
    #artistDescription, #albumDescription {
        font-size: 1rem;
    }
    
    /* Music Player - Mobile */
    #musicPlayer {
        padding: 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Top row: Song info and volume */
    #musicPlayer > div:first-child,
    #volumeControl {
        display: flex;
        align-items: center;
    }
    
    #playerInfo {
        flex: 1;
        min-width: 0;
    }
    
    #currentSongImage {
        width: 45px;
        height: 45px;
        flex-shrink: 0;
    }
    
    #currentSongTitle {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #currentArtistName {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #volumeControl {
        min-width: 100px;
        flex-shrink: 0;
        margin-left: 1rem;
    }
    
    /* Progress bar - full width */
    #playerProgress {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    /* Controls - centered */
    #playerControls {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }
    
    #playerControls button {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    #playPauseBtn {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    header {
        padding: 0.8rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    main {
        padding: 1rem 0.8rem;
        padding-bottom: 1rem;
    }
    
    /* Small mobile music player spacing */
    body:has(#musicPlayer:not(.hidden)) main,
    body.music-player-visible main {
        padding-bottom: 160px;
    }
    
    .view .view-title {
        font-size: 1.5rem;
        padding: 0.8rem;
    }
    
    #albumsList .section-title, #songsList .section-title {
        font-size: 1.3rem;
        padding: 0.6rem 0.8rem;
    }
    
    #albumsGrid, #songsGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
    .artist-card, .album-card, .song-card {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .artist-card img, .album-card img, .song-card img {
        border-radius: 12px;
    }
    
    .artist-card h3, .album-card h3, .song-card h3 {
        font-size: 1rem;
    }
    
    .artist-card p, .album-card p, .song-card p {
        font-size: 0.8rem;
    }
    
    /* Artist/Album Detail */
    #artistInfo, #albumInfo {
        padding: 1rem;
        border-radius: 16px;
    }
    
    #artistImage, #albumImage {
        width: 120px;
        height: 120px;
        border-radius: 16px;
    }
    
    #artistName, #albumName {
        font-size: 1.3rem;
    }
    
    #artistDescription, #albumDescription {
        font-size: 0.9rem;
    }
    
    button[id^="back"] {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* Music Player - Small Mobile */
    #musicPlayer {
        padding: 0.8rem;
        gap: 0.8rem;
        flex-direction: column;
    }
    
    /* Compact top row */
    #playerInfo {
        flex: 1;
        min-width: 0;
    }
    
    #currentSongImage {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    #currentSongTitle {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #currentArtistName {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #volumeControl {
        min-width: 80px;
        margin-left: 1rem;
    }
    
    #volumeIcon {
        font-size: 1rem;
    }
    
    /* Compact controls */
    #playerControls {
        justify-content: center;
        gap: 0.8rem;
    }
    
    #playerControls button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    #playPauseBtn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    /* Compact progress */
    #currentTime, #totalTime {
        font-size: 0.75rem;
        min-width: 35px;
    }
    
    #progressBar {
        height: 4px;
    }
    
    #progressBar::-webkit-slider-thumb {
        width: 14px;
        height: 14px;
    }
    
    #progressBar::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }
}

/* Extra Small Mobile (below 320px) */
@media (max-width: 319px) {
    header h1 {
        font-size: 1.1rem;
    }
    
    .view .view-title {
        font-size: 1.3rem;
    }
    
    #albumsGrid, #songsGrid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    #artistImage, #albumImage {
        width: 100px;
        height: 100px;
    }
    
    #musicPlayer {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #playerInfo {
        min-width: 0;
        flex: 1;
    }
    
    #currentSongImage {
        width: 35px;
        height: 35px;
    }
    
    #volumeControl {
        min-width: 60px;
        margin-left: 0.5rem;
    }
    
    #playerControls button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    #playPauseBtn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        padding: 0.8rem 1rem;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    main {
        padding: 1rem;
        padding-bottom: 1rem;
    }
    
    /* Landscape mobile music player spacing */
    body:has(#musicPlayer:not(.hidden)) main,
    body.music-player-visible main {
        padding-bottom: 100px; /* Less space needed for horizontal layout */
    }
    
    .view .view-title {
        font-size: 1.6rem;
        padding: 0.8rem 1rem;
        margin-bottom: 1rem;
    }
    
    #artistInfo, #albumInfo {
        flex-direction: row;
        gap: 2rem;
    }
    
    #artistImage, #albumImage {
        width: 120px;
        height: 120px;
    }
    
    #musicPlayer {
        padding: 0.8rem 1rem;
        gap: 1rem;
        flex-direction: row;
        align-items: center;
    }
    
    #playerInfo {
        min-width: 150px;
        flex-shrink: 0;
    }
    
    #playerControls {
        flex-shrink: 0;
        width: auto;
        gap: 0.5rem;
    }
    
    #playerControls button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    #playPauseBtn {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    
    #playerProgress {
        flex: 1;
        margin: 0 1rem;
    }
    
    #volumeControl {
        min-width: 80px;
        flex-shrink: 0;
        margin-left: 0;
    }
}

