/* Base Styles */
:root {
    --main-color: #A6A6A6;
    --highlight-color: #940000;
    --text-color: #000000;
    --gray-light: #e0e0e0;
    --gray-dark: #757575;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --body-font: 'Inter', Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--body-font);
    color: var(--text-color);
    line-height: 1.6;
}

/* Player Container */
.player-container {
    position: relative;
    padding-bottom: 3vh;
}

.player-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background-color: var(--primary-color);
}

/* Mobile-first design (base styles for < 576px) */
.player {
    display: flex;
    flex-direction: column;
    max-width: 95%;
    margin: 1rem auto;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 7px solid #940000;
    outline: 5px solid #000000;
    height: auto;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--main-color);
    overflow-y: auto;
    height: auto;
    max-height: 180px;
    margin: 0;
    padding: 1rem;
    flex: 1;
}

.sidebar h3 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    text-align: center;
    border-bottom: 2px solid var(--highlight-color);
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.album-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.album-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.album-item:hover,
.album-item.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.album-item.active {
    border-left: 3px solid var(--highlight-color);
}

.album-item-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 0.5rem;
    object-fit: cover;
}

.album-item-info {
    overflow-wrap: break-word;
}

.album-item-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.8rem;
}

.album-item-artist {
    font-size: 0.7rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* Featured album styling */
.featured-album {
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

#defaultAlbumLink {
    display: block;
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
    background-color: transparent;
    font-size: 0;
    line-height: 0;
}

#defaultAlbumLink img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#albumCover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
}

/* Player Content Styles */
.player-content {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    padding: 1rem;
    height: auto;
    overflow: hidden;
}

.current-album {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

#currentTrack {
    font-weight: bold;
    font-size: 1rem;
}

.album-cover {
    width: 120px;
    height: 120px;
    margin: 0.75rem auto;
    box-shadow: 0 4px 8px var(--shadow-color);
    border-radius: 4px;
    overflow: hidden;
    display: block;
    background-color: transparent;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-info h3 {
    margin-bottom: 0.5rem;
}

/* Song List Styles */
.placeholder-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    pointer-events: none;
}

.song-list {
    flex: 1;
    overflow-y: auto;
    background-color: var(--gray-light);
    border-radius: 0.25rem;
    padding: 0.5rem;
    /* min-height: 200px; */
}

.song-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.song-item:hover,
.song-item.active {
    background-color: rgba(255, 255, 255, 0.5);
}

.song-item.active {
    background-color: var(--highlight-color);
    color: var(--background-color);
}

.song-number {
    width: 25px;
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
    font-size: 0.8rem;
}

.song-details {
    flex: 1;
    margin-left: 0.5rem;
    color: var(--text-color);
}

.song-title {
    font-weight: bold;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.song-duration {
    margin-left: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Player Controls Styles */
.player-controls {
    background-color: var(--main-color);
    padding: 0.75rem;
    border-radius: 0.25rem;
    flex: 1;
}

.song-info {
    text-align: center;
    margin-bottom: 1rem;
    height: 20px;
    font-size: 0.8rem;
}

.progress-container {
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 6px;
    background-color: var(--gray-dark);
    border-radius: 3px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background-color: var(--highlight-color);
    border-radius: 3px;
    width: 0;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#playBtn {
    background-color: var(--highlight-color);
    color: var(--background-color);
    font-size: 1.2rem;
    width: auto;
    aspect-ratio: 1;
}

#playBtn:hover {
    background-color: #7a0000;
}

.volume-container {
    display: none; /* Hidden on mobile */
}

.volume-slider-container {
    width: 60px;
    margin-left: 0.5rem;
}

.volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-dark);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--highlight-color);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--highlight-color);
    cursor: pointer;
    border: none;
}

/* Small screens and up (576px+) */
@media screen and (min-width: 576px) {
    .player {
        max-width: 90%;
        margin: 1.5rem auto;
    }
    
    .sidebar {
        padding: 1.25rem;
        max-height: 200px;
    }
    
    .sidebar h3 {
        font-size: 1rem;
    }
    
    .album-item {
        padding: 0.65rem;
    }
    
    .album-item-cover {
        width: 45px;
        height: 45px;
        margin-right: 0.65rem;
    }
    
    .album-item-title {
        font-size: 0.85rem;
    }
    
    .album-item-artist {
        font-size: 0.75rem;
    }
    
    .player-content {
        padding: 1.25rem;
    }
    
    .album-cover {
        width: 140px;
        height: 140px;
        margin-bottom: 1rem;
    }
    
    #currentTrack {
        font-size: 1.1rem;
    }
    
    .song-list {
        min-height: 250px;
    }
    
    .song-item {
        padding: 0.65rem;
    }
    
    .song-number {
        width: 28px;
        font-size: 0.85rem;
    }
    
    .song-title {
        font-size: 0.85rem;
    }
    
    .song-duration {
        font-size: 0.75rem;
        margin-left: 0.75rem;
    }
    
    .player-controls {
        padding: 1rem;
    }
    
    .song-info {
        height: 22px;
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .progress-bar {
        height: 7px;
    }
    
    .time-display {
        font-size: 0.75rem;
    }
    
    .controls {
        gap: 0.75rem;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    #playBtn {
        font-size: 1.3rem;
    }
    
    .volume-container {
        display: flex;
        align-items: center;
    }
}

/* Medium screens and up (768px+) */
@media screen and (min-width: 768px) {
    .player {
        flex-direction: column;
        height: 50rem;
        max-width: 85%;
        margin: 2rem auto;
    }
    
    .sidebar {
        width: 100%;
        height: 12rem;
        padding: 1.5rem;
        margin: 0 0 1rem 0;
    }
    
    .sidebar h3 {
        margin-bottom: 1rem;
        font-size: 1.1rem;
    }
    
    .album-list {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .album-item {
        flex: 0 0 auto;
        min-width: 140px;
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .album-item-cover {
        width: 60px;
        height: 60px;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .album-item-title {
        font-size: 0.8rem;
        white-space: normal;
    }
    
    .album-item-artist {
        font-size: 0.7rem;
    }
    
    .player-content {
        flex: 1;
        flex-direction: row;
        padding: 1.5rem;
        min-height: 0;
    }
    
    .current-album {
        flex-direction: column;
        align-items: center;
        margin-bottom: 0;
        margin-right: 1.5rem;
        min-width: 200px;
    }
    
    .album-cover {
        width: 180px;
        height: 180px;
        margin-bottom: 1rem;
    }
    
    #currentTrack {
        font-size: 1.2rem;
    }
    
    .song-list {
        flex: 1;
        min-height: 0;
        margin-bottom: 0;
        margin-right: 1rem;
    }
    
    .song-item {
        padding: 0.75rem;
    }
    
    .song-number {
        width: 30px;
        font-size: 0.9rem;
    }
    
    .song-title {
        font-size: 0.9rem;
    }
    
    .song-duration {
        font-size: 0.8rem;
        margin-left: 1rem;
    }
    
    .player-controls {
        min-width: 200px;
        padding: 1rem;
    }
    
    .song-info {
        height: 24px;
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .time-display {
        font-size: 0.8rem;
    }
    
    .controls {
        gap: 1rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    #playBtn {
        font-size: 1.5rem;
    }
    
    .volume-slider-container {
        width: 80px;
    }
    
    .volume-slider {
        height: 5px;
    }
    
    .volume-slider::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
    }
    
    .volume-slider::-moz-range-thumb {
        width: 12px;
        height: 12px;
    }
}

/* Large screens and up (992px+) */
@media screen and (min-width: 992px) {
    .player {
        flex-direction: row;
        height: 25rem;
        max-width: 90%;
    }
    
    .sidebar {
        width: 250px;
        height: 100%;
        margin: 0 1rem 0 0;
        padding: 1.5rem;
        max-height: initial;
    }
    
    .sidebar h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .album-list {
        flex-direction: column;
        gap: 1rem;
    }
    
    .album-item {
        flex-direction: row;
        min-width: auto;
        padding: 0.75rem;
        text-align: left;
    }
    
    .album-item-cover {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
        margin-bottom: 0;
    }
    
    .album-item-title {
        font-size: 0.9rem;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    
    .album-item-artist {
        font-size: 0.8rem;
    }
    
    .player-content {
        flex: 1;
        height: 100%;
        overflow: hidden;
    }
    
    .current-album {
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .album-cover {
        width: 150px;
        height: 150px;
        margin-bottom: 0;
    }
    
    #currentTrack {
        font-size: 1.3rem;
    }
    
    .song-list {
        margin-right: 0;
    }
    
    .song-number {
        width: 30px;
        font-size: 0.9rem;
    }
    
    .song-title {
        font-size: 0.9rem;
    }
    
    .song-duration {
        margin-left: 1rem;
        font-size: 0.85rem;
    }
    
    .player-controls {
        min-width: 220px;
    }

    .controls {
        transform: scale(0.85); /* Shrink to 85% at 992px */
        transition: transform 0.2s ease; /* Smooth transition */
    }
    .song-info {
        margin-bottom: 3rem;
        font-size: 1rem;
    }
}