/* AutoCode generated CSS for Chopin Waltz Audio Player */

/* Base styles and resets */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-bg: hsl(220, 15%, 95%); /* Soft light grey-blue */
    --secondary-bg: hsl(0, 0%, 100%); /* White */
    --text-color: hsl(220, 10%, 20%); /* Dark grey-blue */
    --accent-color: hsl(200, 70%, 50%); /* Soft blue */
    --accent-color-hover: hsl(200, 70%, 40%);
    --accent-color-rgb: 77, 182, 255; /* RGB value for hsl(200, 70%, 50%) */
    --border-color: hsl(220, 10%, 85%);
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.12);
    --font-sans: 'Roboto', 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--primary-bg);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Audio Player Container */
.audio-player { /* Updated from .audio-player-container to match index.html */
    background-color: var(--secondary-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    padding: 30px;
    width: 100%;
    max-width: 400px; /* Max width for a clean, minimalist player */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 25px;
    transform: translateY(0); /* For subtle animation later */
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.audio-player:hover {
    box-shadow: var(--shadow-light);
    transform: translateY(-3px);
}

/* Player Info - Track Information */
.player-info { /* Updated from .player-header to match index.html */
    margin-bottom: 15px;
}

.track-title {
    font-family: var(--font-serif);
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
    line-height: 1.3;
}

.track-artist {
    font-family: var(--font-sans);
    font-size: 1em;
    color: var(--text-color);
    opacity: 0.7;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.play-pause-btn {
    background-color: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    outline: none;
    position: relative;
    overflow: hidden; /* To contain pseudo-elements for icon */
}

.play-pause-btn:hover {
    background-color: var(--accent-color-hover);
    transform: scale(1.05);
}

.play-pause-btn:active {
    transform: scale(0.98);
}

/* Play/Pause Icon - Based on .play and .pause classes from script.js */
.play-pause-btn::before {
    content: '';
    display: block;
    position: absolute;
    transition: all 0.2s ease; /* Smooth transition for icon change */
}

/* Play Icon (when button has 'play' class) */
.play-pause-btn.play::before {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 18px solid var(--secondary-bg); /* White triangle for play */
    left: 55%; /* Adjust for visual centering */
    transform: translateX(-50%);
}

/* Pause Icon (when button has 'pause' class) */
.play-pause-btn.pause::before {
    width: 16px; /* Two vertical bars */
    height: 20px;
    background: var(--secondary-bg); /* White color */
    mask: linear-gradient(90deg, #fff 40%, transparent 40%, transparent 60%, #fff 60%);
    -webkit-mask: linear-gradient(90deg, #fff 40%, transparent 40%, transparent 60%, #fff 60%);
    left: 50%;
    transform: translateX(-50%);
}

/* Volume Control Wrapper */
.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    /* gap: 10px; Add if volume icon is present */
}

/* Volume Slider */
#volumeSlider { /* Targeted by ID as in index.html */
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
    outline: none;
    transition: background 0.2s ease;
    cursor: grab;
    margin: 0; /* Override default margin for input type range */
}

#volumeSlider:hover {
    background: var(--accent-color);
}

/* Slider thumb for Webkit (Chrome, Safari, Opera) */
#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
    margin-top: -6px; /* Adjust to vertically center the thumb */
}

#volumeSlider::-webkit-slider-thumb:hover {
    background: var(--accent-color-hover);
    transform: scale(1.1);
}

#volumeSlider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Slider thumb for Firefox */
#volumeSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
    border: none; /* Remove default border */
}

#volumeSlider::-moz-range-thumb:hover {
    background: var(--accent-color-hover);
    transform: scale(1.1);
}

#volumeSlider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Slider track for Firefox */
#volumeSlider::-moz-range-track {
    background: var(--border-color);
    border-radius: 5px;
    height: 8px;
    border: none; /* Remove default border */
}

/* Progress Container */
.progress-container {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    overflow: hidden; /* Ensure progress bar stays within bounds */
    display: flex; /* To position time display */
    align-items: center;
    margin-top: 10px; /* Space from controls */
}

/* Progress Bar (the filled part) */
#progressBar {
    height: 100%;
    width: 0%; /* Initial width, controlled by JS */
    background-color: var(--accent-color);
    border-radius: 5px; /* Match container */
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.1s linear; /* Smooth fill */
    z-index: 1; /* Below time display */
}

/* Time Display */
.time-display {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px; /* Padding for text inside progress bar area */
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.8;
    z-index: 2; /* Above progress bar */
    pointer-events: none; /* Allow clicks to pass through to container */
}

.time-display span {
    /* Specific styling for current time and total duration if needed */
    font-variant-numeric: tabular-nums; /* Ensures numbers align vertically */
}

/* Focus states for accessibility */
button:focus-visible,
input[type="range"]:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 5px; /* Match button/slider shape */
}

/* Responsiveness */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }

    .audio-player {
        padding: 20px;
        gap: 20px;
    }

    .track-title {
        font-size: 1.5em;
    }

    .play-pause-btn {
        width: 50px;
        height: 50px;
    }

    .play-pause-btn.play::before {
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 15px solid var(--secondary-bg);
    }

    .play-pause-btn.pause::before {
        width: 14px;
        height: 18px;
    }

    #volumeSlider {
        width: 100px;
        height: 6px;
    }

    #volumeSlider::-webkit-slider-thumb,
    #volumeSlider::-moz-range-thumb {
        width: 18px;
        height: 18px;
        margin-top: -6px;
    }

    .progress-container {
        height: 8px;
    }
}

@media (max-width: 400px) {
    .player-controls {
        flex-direction: column;
        gap: 15px;
    }

    .volume-control {
        width: 100%;
        justify-content: center;
    }

    #volumeSlider {
        width: 100%;
        max-width: 200px;
    }

    .time-display {
        font-size: 0.8em;
    }
}