/**
 * Styles for a music player app with a playlist feature.
 * This stylesheet defines the visual design of the player, playlist, 
 * and their elements such as buttons, titles, and song info.
 *
 * The design aims for a dark-themed layout with bright highlights, 
 * using flexbox for responsive layout and clean, modern typography.
 *
 * Colors:
 * - Primary Color: #dfdfe2 (light gray)
 * - Secondary Color: #ffffff (white)
 * - App Background Color: #4d4d62 (dark gray-blue)
 * - Background Color: #1b1b32 (deep dark background for player)
 * - Foreground Color: #3b3b4f (dark grayish color for borders, etc.)
 * - Highlight Color: #f1be32 (bright yellow for highlights)
 * 
 * Fonts:
 * - Headline font: "Roboto Mono", monospace
 * - Body font: "Lato", sans-serif
 */

/* General Reset */
*,
*::after,
*::before {
    box-sizing: border-box;
    /* Ensures consistent box sizing across elements */
}

/* Root Styles */
:root {
    /* Colors */
    --primary-color: #dfdfe2;
    --secondary-color: #ffffff;
    --app-background-color: #4d4d62;
    --background-color: #1b1b32;
    --foreground-color: #3b3b4f;
    --highlight-color: #f1be32;

    /* Font Sizes */
    --root-font-size: 16px;
    /* Base font size for the application */
    font-size: var(--root-font-size);

    /* Font-Families */
    --font-headline: "Roboto Mono", monospace;
    /* Used for headings */
    --font-family: "Lato", sans-serif;
    /* Used for body text */
}

/* Body Styles */
body {
    background-color: var(--app-background-color);
    /* Dark background for the app */
    color: var(--primary-color);
    /* Light text color for readability */
    font-family: var(--font-family);
    /* Use the Lato font for body text */
}

/* Headings */
h1 {
    font-size: 1.125rem;
    /* Slightly larger font for primary headings */
    line-height: 1.6;
    /* Provides proper spacing between lines of text */
}

h2 {
    font-size: var(--root-font-size);
    /* Uses the root font size for secondary headings */
}

ul {
    margin: 0;
    /* Removes default margin from unordered lists */
}

/* Main container for flexbox layout */
.container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    row-gap: 5px;
    /* Adds space between elements */
}

/* Player and Playlist Styles */
.player,
.playlist {
    width: 450px;
    /* Fixed width for both player and playlist */
    background-color: var(--background-color);
    /* Dark background for both elements */
    border: 3px solid var(--foreground-color);
    /* Dark border around the player and playlist */
}

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

/* Bars at the top of the player and playlist */
.player-bar,
.playlist-bar {
    display: flex;
    justify-content: space-between;
    /* Space out the items inside the bar */
    align-items: center;
    /* Vertically center items */
    padding: 0 5px;
    width: 100%;
    height: 30px;
    /* Set the height of the bar */
    background-color: var(--foreground-color);
    /* Dark background for the bar */
}

/* Styling for parallel lines inside the player */
.parallel-lines {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 0 5px;
}

.parallel-lines>div {
    height: 2px;
    width: 100%;
    min-width: 75px;
    /* Minimum width of 75px for each line */
    background-color: var(--highlight-color);
    /* Highlight color for the lines */
}

/* Title styles for FCC and Playlist */
.fcc-title,
.playlist-title {
    color: var(--secondary-color);
    /* White color for the titles */
    margin: 0 10px;
    font-family: var(--font-headline);
    /* Use monospaced font for titles */
}

/* Player Content (where song details are shown) */
.player-content {
    display: flex;
    background-color: var(--foreground-color);
    /* Dark background for the content area */
    width: 430px;
    height: 200px;
    column-gap: 13px;
    align-items: center;
    justify-content: center;
}

/* Album Art Styling */
#player-album-art {
    background-color: var(--secondary-color);
    /* White background for the album art */
    border: 6px solid var(--background-color);
    /* Border matching background color */
}

#player-album-art img {
    width: 150px;
    display: block;
    /* Ensures the image is displayed as a block-level element */
}

/* Player Display (showing song details) */
.player-display {
    display: flex;
    flex-direction: column;
    row-gap: 20px;
    padding: 14px;
    background-color: var(--background-color);
    /* Dark background for song details */
    height: 153px;
    width: 226px;
}

/* Player Buttons */
.player-buttons svg {
    fill: var(--primary-color);
    /* Light color for button icons */
}

.playing>svg {
    fill: var(--highlight-color);
    /* Highlight the current song with a different color */
}

.player-buttons {
    display: flex;
    justify-content: space-around;
    /* Space buttons out evenly */
}

/* Buttons styling */
button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    /* Light text color for buttons */
    cursor: pointer;
    font-size: var(--root-font-size);
    /* Standard font size for buttons */
    outline-color: var(--highlight-color);
    /* Color for focus outline */
    text-align: center;
}

.playlist-song {
    outline-color: var(--highlight-color);
    /* Highlight focused playlist items */
}

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

button:focus,
.playlist-song:focus {
    outline-style: dashed;
    /* Dashed outline when button or item is focused */
    outline-width: 2px;
}

/* Playlist Styles */
.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);
    /* Background color for playlist */
    display: flex;
    flex-direction: column;
    row-gap: 8px;
    padding: 8px 9px;
    visibility: visible;
    justify-content: start;
    list-style: none;
    /* Removes default bullet points from the list */
}

/* Individual song styles in playlist */
.playlist-song {
    display: flex;
    height: 55px;
    justify-content: space-between;
    /* Space out the song info */
    align-items: center;
    /* Vertically center content */
    padding: 5px;
}

[aria-current="true"] {
    background-color: var(--background-color);
    /* Highlight the current song */
}

[aria-current="true"] p {
    color: var(--highlight-color);
    /* Color change for current song title */
}

/* Song Info Styles */
.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);
    /* Use Lato for playlist text */
}

/* Song Title and Artist Styles */
#player-song-title,
#player-song-artist {
    margin: 0;
}

#player-song-artist {
    color: var(--highlight-color);
    /* Highlight the artist's name */
    font-size: 0.75rem;
}

#player-song-title {
    font-size: 1.125rem;
    /* Larger font for the song title */
}

/* Playlist Song Details */
.playlist-song-title {
    font-size: 0.85rem;
    width: 241px;
    text-align: left;
    /* Align the song title to the left */
}

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

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

/* Delete Button */
.playlist-song-delete {
    padding: 0;
    width: 20px;
    height: 20px;
}

.playlist-song-delete,
.playlist-song-delete {
    fill: var(--foreground-color);
    /* Dark color for delete button */
}

.playlist-song-delete:hover circle,
.playlist-song-delete:focus circle {
    fill: #ff0000;
    /* Red color for delete button when hovered or focused */
}

/* Media Queries for responsiveness */
@media (max-width: 700px) {

    .player,
    .playlist {
        width: 300px;
        /* Smaller width for mobile screens */
    }

    .player {
        height: 340px;
        /* Adjust player height for mobile */
    }

    #playlist-songs {
        height: 280px;
        padding: 5px 6px;
        overflow-y: scroll;
        /* Allow vertical scrolling for the playlist */
        overflow-x: hidden;
        /* Hide horizontal scrolling */
        scrollbar-color: var(--background-color) var(--secondary-color);
        /* Customize scrollbar colors */
        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;
        /* Smaller font size for mobile headers */
    }

    h2 {
        font-size: 0.75rem;
    }

    .player-bar,
    .playlist-bar,
    .player-content,
    #playlist-songs {
        width: 280px;
        /* Adjust widths for smaller screens */
    }

    .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;
        /* Adjust album art for mobile */
    }

    #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;
    }
}