:root {
    --primary-color: #121212;
    --secondary-color: #ffffff;
    --app-background-color: #fdfdfd;
    --background-color: #ffffff;
    --foreground-color: #dee1e6;
    --highlight-color: #2563eb;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --root-font-size: 16px;
    font-size: var(--root-font-size);
    --font-headline: "Roboto Mono", monospace;
    --font-family: "Lato", sans-serif;
    --spacing-unit: 8px;
}

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

body {
    background: var(--app-background-color);
    color: var(--primary-color);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: calc(var(--spacing-unit) * 2);
}

.container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: calc(var(--spacing-unit) * 2);
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.player,
.playlist {
    width: 100%;
    background: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 4px 16px var(--shadow-color);
    border: 1px solid var(--foreground-color);
    overflow: hidden;
    min-height: 120px;
}

.player-bar,
.playlist-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
    background: linear-gradient(90deg, #e8f0fe, #f0f2f5);
    border-bottom: 1px solid #d6dae1;
}

.parallel-lines {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 var(--spacing-unit);
}

.parallel-lines > div {
    height: 3px;
    width: 80px;
    background: linear-gradient(90deg, var(--highlight-color), var(--accent-color));
    border-radius: 2px;
}

.fcc-title,
.playlist-title {
    color: var(--primary-color);
    font-family: var(--font-headline);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.player-content {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: calc(var(--spacing-unit) * 2);
    background: #f8f9fb;
    border-radius: 12px;
    margin: var(--spacing-unit);
}

#player-album-art {
    border-radius: 12px;
    border: 3px solid var(--foreground-color);
    box-shadow: 0 4px 10px var(--shadow-color);
}

#player-album-art img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    display: block;
}

#player-album-art:hover {
    transform: scale(1.03);
    transition: transform 0.3s ease;
}

.player-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    padding: var(--spacing-unit);
    background: #f0f2f5;
    border-radius: 8px;
}

.player-display-song-artist {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

#player-song-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

#player-song-artist {
    font-size: 0.875rem;
    color: var(--accent-color);
}

.player-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-unit);
}

button {
    background: #e0e7ff;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;

    svg {
        margin-top: 2px;
    }
}

button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.player-buttons svg {
    fill: var(--primary-color);
    width: 24px;
    height: 24px;
}

button:hover svg {
    fill: white;
}

.playing > svg {
    fill: var(--accent-color);
}

.playlist {
    padding: var(--spacing-unit);
}

#playlist-songs {
    background: #f8f9fb;
    border-radius: 8px;
    padding: var(--spacing-unit);
    list-style: none;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

.playlist-song {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-unit);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.playlist-song:hover {
    background: rgba(37, 99, 235, 0.05);
}

[aria-current="true"] {
    background: rgba(37, 99, 235, 0.1);
}

[aria-current="true"] p {
    color: var(--highlight-color);
}

.playlist-song-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    min-width: 0;
}

.playlist-song-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-song-artist {
    font-size: 0.75rem;
    color: var(--accent-color);
}

.playlist-song-duration {
    font-size: 0.75rem;
    font-family: var(--font-headline);
    color: var(--primary-color);
    white-space: nowrap;
}

button.playlist-song-delete {
    background: transparent;
    border: none;
    cursor: pointer;
}

.playlist-song-delete {
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.playlist-song-delete:hover circle,
.playlist-song-delete:focus circle {
    fill: var(--danger-color);
}

@media (max-width: 700px) {
    .container {
        max-width: 320px;
    }

    #player-album-art img {
        width: 120px;
        height: 120px;
    }

    .player-content {
        flex-direction: column;
        gap: var(--spacing-unit);
    }

    .player-display {
        width: 100%;
    }

    #playlist-songs {
        max-height: 240px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--highlight-color) var(--background-color);
    }

    #playlist-songs::-webkit-scrollbar {
        width: 6px;
    }

    #playlist-songs::-webkit-scrollbar-track {
        background: var(--background-color);
    }

    #playlist-songs::-webkit-scrollbar-thumb {
        background: var(--highlight-color);
        border-radius: 3px;
    }

    .playlist-song-title {
        font-size: 0.75rem;
    }

    .playlist-song-artist,
    .playlist-song-duration {
        font-size: 0.675rem;
    }
}
