/* css variables - custom properties for theming */
:root {
    /* colors — pink theme */
    --primary-color: #ffebf7;
    /* light pink text */
    --secondary-color: #ffffff;
    /* pure white */
    --app-background-color: #ffb6d5;
    /* light rosy pink */
    --background-color: #ff7ab8;
    /* vibrant medium pink */
    --foreground-color: #ff94c9;
    /* soft cotton-candy pink */
    --highlight-color: #ff2f92;
    /* hot pink accent */

    /* font sizes */
    --root-font-size: 16px;
    font-size: var(--root-font-size);

    /* font-families */
    --font-headline: "Roboto Mono", monospace;
    --font-family: "Lato", sans-serif;
}


/* Global reset and base styles */
*,
*::after,
*::before {
    box-sizing: border-box;
}

[aria-current="true"] {
    background-color: #ff4da6;
}

[aria-current="true"] p {
    color: #ffffff;
}


/* layout */
body {
    background-color: var(--app-background-color);
    color: var(--primary-color);
    font-family: var(--font-family);
}

h1 {
    font-size: 1rem;
    line-height: 1.6;
}

h2 {
    font-size: var(--root-font-size);
}

ul {
    margin: 0;
}

.container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    row-gap: 5px;
}

/* Player and playlist sections */
.player,
.playlist {
    width: 450px;
    background-color: var(--background-color);
    border: 3px solid var(--foreground-color);
}

.player {
    height: 260px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 10px;
}

.player-bar,
.playlist-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    width: 100%;
    height: 30px;
    background-color: var(--foreground-color);
}

.parallel-lines {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 0 5px;
}

.parallel-lines>div {
    height: 2px;
    width: 100%;
    min-width: 75px;
    background-color: #ff2f92;
}

.fcc-title,
.playlist-title {
    color: #ffffff;
    margin: 0 10px;
    font-family: var(--font-headline);
}

.player-content {
    display: flex;
    background-color: var(--foreground-color);
    width: 430px;
    height: 200px;
    column-gap: 13px;
    align-items: center;
    justify-content: center;
}

.player-content,
.player-display,
#playlist-songs {
    background-color: rgba(255, 148, 201, 0.55);
}


#player-album-art {
    background-color: var(--secondary-color);
    border: 6px solid var(--background-color);
}

#player-album-art img {
    width: 150px;
    display: block;
}

.player-display {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    padding: 10px;
    background-color: var(--background-color);
    height: 180px;
    width: 226px;
}

/* progress bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    flex-wrap: nowrap;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.3));
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--highlight-color), #ff5ba8);
    border-radius: 3px;
    width: 0%;
    box-shadow: 0 0 8px rgba(255, 47, 146, 0.4);
}

#progress-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0;
    z-index: 10;
}

#current-time,
#duration-time {
    font-size: 0.65rem;
    font-family: var(--font-headline);
    min-width: 28px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
}

.player-display-song-artist {
    height: auto;
    line-height: 1.2;
}

.player-buttons svg {
    fill: var(--primary-color);
}

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

.player-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

/* volume slider and icon */
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 8px;
    border-radius: 8px;
}

.volume-container label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.volume-container label svg {
    fill: var(--primary-color);
    width: 14px;
    height: 14px;
}

#volume-slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--highlight-color) 0%, var(--highlight-color) 70%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0.2) 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    width: 14px;
    height: 14px;
    box-shadow: 0 2px 6px rgba(255, 47, 146, 0.4);
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#volume-slider::-moz-range-thumb:hover {
    width: 14px;
    height: 14px;
    box-shadow: 0 2px 6px rgba(255, 47, 146, 0.4);
}

#progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background-color: var(--highlight-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 47, 146, 0.4);
    transition: all 0.2s ease;
}

#progress-slider::-webkit-slider-thumb:hover {
    width: 16px;
    height: 16px;
    box-shadow: 0 2px 8px rgba(255, 47, 146, 0.6);
}

#progress-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background-color: var(--highlight-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(255, 47, 146, 0.4);
    transition: all 0.2s ease;
}

#progress-slider::-moz-range-thumb:hover {
    width: 16px;
    height: 16px;
    box-shadow: 0 2px 8px rgba(255, 47, 146, 0.6);
}

.player,
.playlist,
.player-content,
#playlist-songs,
.playlist-song,
.player-display,
#player-album-art {
    border-radius: 18px;
}

button,
.playlist-song-delete {
    border-radius: 10px;
}

#player-album-art img {
    border-radius: 12px;
}


button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: var(--root-font-size);
    outline-color: var(--highlight-color);
    text-align: center;
}

.playlist-song {
    outline-color: var(--highlight-color);
}

.playlist li:not(:last-child) {
    border-bottom: 1px solid var(--background-color);
}

button:focus,
.playlist-song:focus {
    outline-style: dashed;
    outline-width: 2px;
    outline-offset: 4px;
}

.shuffle-container {
    position: relative;
    display: inline-block;
    ;
}

.shuffle-container:hover .sort-controls {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.sort-controls {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--foreground-color);
    border: 2px solid var(--highlight-color);
    padding: 8px 10px;
    border-radius: 10px;
    display: none;
    opacity: 0;
    box-shadow: 0 10px 10px rgba(0, 0, 0.1);
    transition: opacity 0.2s ease;
    white-space: nowrap;
    z-index: 2000;
}

.sort-controls::after {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--foreground-color) transparent transparent transparent;
}

.shuffle-container:hover .sort-controls,
.sort-controls:hover {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Playlist */
.playlist {
    height: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 10px;
}

#playlist-songs {
    width: 430px;
    height: 100%;
    background-color: var(--foreground-color);
    display: flex;
    flex-direction: column;
    row-gap: 8px;
    padding: 8px 9px;
    visibility: visible;
    justify-content: start;
    list-style: none;
}

.playlist-song {
    display: flex;
    height: 55px;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
}

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

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

.playlist-song-info {
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    column-gap: 7px;
    padding: 5px 0;
    font-family: var(--font-family);
}

#player-song-title,
#player-song-artist {
    margin: 0;
}

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

#player-song-title {
    font-size: 1.125rem;
}

.playlist-song-title {
    font-size: 0.85rem;
    width: 241px;
    text-align: left;
}

.playlist-song-artist {
    font-size: 0.725rem;
    width: 80px;
}

.playlist-song-duration {
    font-size: 0.725rem;
    margin: auto;
    font-family: var(--font-headline);
    width: 30px;
}

.playlist-song-delete {
    padding: 0;
    width: 20px;
    height: 20px;
}

.playlist-song-delete,
.playlist-song-delete {
    fill: var(--foreground-color);
}

.playlist-song-delete:hover circle,
.playlist-song-delete:focus circle {
    fill: #ff0000;
}

/* responsive design */
@media (max-width: 700px) {

    .player,
    .playlist {
        width: 300px;
    }

    .player {
        height: 340px;
    }

    #playlist-songs {
        height: 280px;
        padding: 5px 6px;
        overflow-y: scroll;
        overflow-x: hidden;
        scrollbar-color: var(--background-color) var(--secondary-color);
        scrollbar-width: thin;
    }

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

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

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

    h1 {
        font-size: 0.813rem;
    }

    h2 {
        font-size: 0.75rem;
    }

    .player-bar,
    .playlist-bar,
    .player-content,
    #playlist-songs {
        width: 280px;
    }

    .playlist-song {
        justify-content: space-between;
    }

    .playlist-song-title {
        width: 140px;
    }

    .playlist-song-artist {
        width: 40px;
    }

    .playlist-song-duration>button {
        padding: 0;
    }

    .player-content {
        display: inline;
        position: relative;
        justify-items: center;
        height: 100%;
    }

    #player-album-art {
        z-index: -100;
        height: 280px;
        box-shadow: none;
        background: #000;
    }

    #player-album-art img {
        width: 100%;
        opacity: 0.6;
    }

    .player-display-song-artist {
        padding: 0 10px;
    }

    .player-display-song-artist>p {
        white-space: pre-wrap;
    }

    .player-display {
        position: absolute;
        width: 100%;
        z-index: 1000;
        background-color: transparent;
        top: 0;
        height: 280px;
        justify-content: space-between;
        text-align: center;
    }
}