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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    transition: background 1s ease;
    display: flex;
}

/* History Sidebar */
.history-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 100;
}

.history-title {
    color: white;
    font-size: 1.25rem;
    /* font-weight: 600; */
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;


    /* font-size: 3.5rem; */
    font-weight: 700;
    /* margin-bottom: 1rem; */
    /* line-height: 1.2; */
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.history-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    /* Same as .album-cover: dark fallback surface so the SVG placeholder
       stays visible regardless of the page background. */
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.7);
}

.history-item-info {
    flex: 1;
    min-width: 0;
    position: relative;
}

.history-item-title-wrapper,
.history-item-artist-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.history-item-title,
.history-item-artist {
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.history-item-title {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.history-item-artist {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    flex: 1;
}

/* Animated gradient background */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color, #1a1a1a), var(--secondary-color, #333333));
    z-index: -1;
    transition: all 1s ease;
}

.album-cover-wrapper {
    position: relative;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease;
}

.album-cover {
    width: 400px;
    height: 400px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: cover;
    /* When the cover is the SVG placeholder (no image_url from Last.fm),
       make sure it has a visible dark surface rather than inheriting the
       page background. The SVG itself paints in currentColor. */
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.65);
}

.track-info {
    text-align: center;
    color: white;
    max-width: 800px;
    animation: slideUp 0.8s ease;
}

.now-playing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.now-playing-badge.visible {
    opacity: 1;
}

.playing-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
}

.bar {
    width: 3px;
    background: white;
    border-radius: 2px;
    animation-duration: 0.8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
}

.bar1 {
    height: 40%;
    animation-name: bounce1;
}

.bar2 {
    height: 70%;
    animation-name: bounce2;
    animation-delay: 0.2s;
}

.bar3 {
    height: 50%;
    animation-name: bounce3;
    animation-delay: 0.4s;
}

@keyframes bounce1 {
    0%, 100% { height: 30%; }
    50% { height: 90%; }
}

@keyframes bounce2 {
    0%, 100% { height: 60%; }
    50% { height: 100%; }
}

@keyframes bounce3 {
    0%, 100% { height: 40%; }
    50% { height: 80%; }
}

.track-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.track-artist {
    font-size: 2rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.track-album {
    font-size: 1.25rem;
    opacity: 0.7;
    font-style: italic;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Responsive design */
@media (max-width: 1024px) {
    .history-sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .history-sidebar {
        display: none;
    }

    .album-cover {
        width: 300px;
        height: 300px;
    }

    .track-title {
        font-size: 2.5rem;
    }

    .track-artist {
        font-size: 1.5rem;
    }

    .track-album {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .album-cover {
        width: 250px;
        height: 250px;
    }

    .track-title {
        font-size: 1.75rem;
    }

    .track-artist {
        font-size: 1.25rem;
    }

    .track-album {
        font-size: 0.9rem;
    }
}
