/* Define color palette based on the logo - Adapted for Light Theme */
:root {
    /* Logo Colors */
    --primary-color: #007791; /* Teal/Blue */
    --secondary-color: #9DCB3B; /* Lime Green/Yellow */
    --gradient-start: var(--secondary-color);
    --gradient-end: var(--primary-color);

    /* Theme Colors */
    --background-color: #f4f7f9; /* Light Grey/Off-white background */
    --card-background: #ffffff;   /* White card background */
    --text-primary: #0A2F3A;     /* Dark Blue/Grey from logo text - Good contrast */
    --text-secondary: #587a85;   /* Muted Teal/Grey - Adjusted for readability */
    --shadow-color: rgba(60, 90, 110, 0.15); /* Softer, slightly blue shadow */
    --control-icon-color: #667f88; /* Mid-tone grey/teal for icons */
    --control-icon-hover: var(--primary-color); /* Use primary logo color on hover */
    --progress-bar-bg: #e0e7ec; /* Light grey for progress track */
    --progress-bar-fill: linear-gradient(90deg, var(--gradient-start), var(--gradient-end)); /* Keep logo gradient */
    --button-hover-bg: rgba(0, 119, 145, 0.08); /* Faint primary color background on hover */
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-secondary); /* Default text color */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 30px 20px; /* Added more top/bottom padding */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Smoother fonts on WebKit */
    -moz-osx-font-smoothing: grayscale; /* Smoother fonts on Firefox */
}

.container {
    width: 100%;
    max-width: 480px; /* Slightly smaller max-width for focus */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    margin-bottom: 40px; /* Increased space */
    text-align: center;
}

.logo {
    max-width: 220px; /* Slightly smaller logo */
    height: auto;
}

.player-card {
    background-color: var(--card-background);
    border-radius: 25px; /* Slightly more pronounced rounding */
    padding: 35px;
    box-shadow: 0 8px 25px var(--shadow-color), 0 1px 3px rgba(0,0,0,0.05); /* Refined shadow */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.thumbnail {
    width: 150px; /* Adjusted size */
    height: 150px;
    object-fit: cover;
    border-radius: 18px; /* Match card rounding style */
    margin-bottom: 25px;
    /* Optional: subtle border */
    /* border: 1px solid #eee; */
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Softer shadow for thumbnail */
}

.audio-info {
    margin-bottom: 30px; /* Increased space */
}

.audio-title {
    font-size: 1.5em; /* Slightly larger */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px; /* Increased space */
    line-height: 1.3;
}

.audio-artist {
    font-size: 0.95em; /* Slightly larger */
    color: var(--text-secondary);
}

/* Hide default audio player */
#audio-player {
    display: none;
}

.controls {
    width: 100%;
    margin-top: 10px; /* Reduced space above controls */
}

.progress-container {
    width: 100%;
    margin-bottom: 20px; /* Increased space below progress */
    position: relative;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em; /* Slightly larger time */
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding: 0 5px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px; /* Slightly thicker bar */
    background-color: var(--progress-bar-bg);
    border-radius: 4px;
    position: absolute;
    top: calc(50% + 15px); /* Adjusted positioning */
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: var(--progress-bar-fill);
    border-radius: 4px;
    transition: width 0.1s linear;
}

#progress-bar {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
    margin-top: 22px; /* Adjusted positioning */
}

/* Thumb (handle) Styles - Using secondary color */
#progress-bar::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; /* Slightly larger thumb */
    height: 18px;
    background-color: var(--secondary-color); /* Use green for progress thumb */
    border-radius: 50%;
    border: 3px solid var(--card-background); /* White border to stand out */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    margin-top: -5px; /* Center thumb vertically */
    transition: background-color 0.2s ease, transform 0.1s ease;
}
#progress-bar::-webkit-slider-thumb:hover {
     transform: scale(1.1);
}

#progress-bar::-moz-range-thumb {
    width: 12px; /* Firefox renders border differently */
    height: 12px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    border: 3px solid var(--card-background);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
#progress-bar::-moz-range-thumb:hover {
     transform: scale(1.1);
}


.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px; /* Increased gap */
    margin-bottom: 25px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px; /* Slightly more padding */
    color: var(--control-icon-color);
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content for consistent look */
    gap: 5px;
    font-size: 0.85em;
    border-radius: 50%; /* Make side buttons circular on hover */
    width: 44px; /* Give fixed size */
    height: 44px;
}

.control-btn svg {
    display: block;
     transition: fill 0.2s ease;
     fill: currentColor;
     width: 22px; /* Explicit icon size */
     height: 22px;
}
/* Specific size for rewind/forward icons */
#rewind-btn svg, #forward-btn svg {
    width: 20px;
    height: 20px;
}

.control-btn span {
    font-weight: 600; /* Make +/- text bolder */
}

.control-btn:hover {
    color: var(--control-icon-hover);
    background-color: var(--button-hover-bg); /* Subtle background on hover */
}
.control-btn:active {
    transform: scale(0.94);
}

/* Play/Pause button - Emphasis with gradient */
.play-btn {
    background: var(--progress-bar-fill); /* Use gradient for main button */
    border-radius: 50%;
    width: 65px; /* Larger main button */
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white; /* Icon color on gradient */
    box-shadow: 0 5px 15px var(--shadow-color); /* Use theme shadow */
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    padding: 0; /* Override default padding */
}
.play-btn:hover {
    opacity: 0.9; /* Slight fade on hover */
    box-shadow: 0 8px 20px var(--shadow-color);
    background: var(--progress-bar-fill); /* Keep background on hover */
    color: white;
}
.play-btn:active {
    transform: scale(0.93);
}
.play-btn svg {
     width: 32px; /* Adjust icon size within button */
     height: 32px;
     fill: white; /* Ensure icon is white */
}


.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
}

.volume-btn {
    /* Inherit styles from .control-btn */
    width: 40px; /* Slightly smaller volume button */
    height: 40px;
    flex-shrink: 0; /* Prevent shrinking */
}
.volume-btn svg {
    width: 20px;
    height: 20px;
}

#volume-slider {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background-color: var(--progress-bar-bg);
    border-radius: 3px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease;
}

/* Volume Thumb - Use Primary Color */
#volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color); /* Use blue for volume */
    border-radius: 50%;
     border: 3px solid var(--card-background); /* Match progress bar thumb style */
     box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    margin-top: -5px; /* Center thumb */
    transition: background-color 0.2s ease, transform 0.1s ease;
}
#volume-slider::-webkit-slider-thumb:hover {
     transform: scale(1.1);
}

#volume-slider::-moz-range-thumb {
     width: 10px;
     height: 10px;
     background-color: var(--primary-color);
     border-radius: 50%;
     border: 3px solid var(--card-background);
     box-shadow: 0 1px 3px rgba(0,0,0,0.2);
     cursor: pointer;
     transition: background-color 0.2s ease, transform 0.1s ease;
}
#volume-slider::-moz-range-thumb:hover {
     transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    body {
        padding: 20px 15px;
    }
    .player-card {
        padding: 25px 20px; /* Adjust padding */
        border-radius: 20px;
    }
    .thumbnail {
        width: 120px;
        height: 120px;
    }
    .audio-title {
        font-size: 1.3em;
    }
    .buttons {
        gap: 18px; /* Reduce gap */
    }
    .play-btn {
        width: 60px;
        height: 60px;
    }
    .play-btn svg {
        width: 28px;
        height: 28px;
    }
    .control-btn {
        width: 40px;
        height: 40px;
        padding: 6px;
    }
     .control-btn svg {
         width: 18px;
         height: 18px;
    }
    #rewind-btn svg, #forward-btn svg {
        width: 16px;
        height: 16px;
    }
    .control-btn span {
         font-size: 0.8em;
    }
    .volume-control {
        max-width: 190px;
    }
    .volume-btn {
        width: 36px;
        height: 36px;
    }
    .volume-btn svg {
        width: 18px;
        height: 18px;
    }
}
