/* 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 {
    display: flex;
    max-width: 90%;
    margin: 2rem auto;
    background-color: var(--gray-light);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 7px solid #940000;
    outline: 5px solid #000000;
    height: 25rem;
}

/* Sidebar Styles */
.sidebar {
    /* width: 250px; */
    background-color: var(--main-color);
    padding: 1.15rem;
    overflow-y: auto;
    height: 100%;
}

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

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

.album-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    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: 50px;
    height: 50px;
    border-radius: 4px;
    margin-right: 0.75rem;
    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;
}

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

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

.featured-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(148, 0, 0, 0.8); 
    color: #ffffff;
    text-align: center;
    padding: 5px 0;
    font-weight: bold;
    z-index: 5;
}

#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;
    background-color: #fff;
    padding: 1.5rem;
    height: 100%;
    overflow: hidden;
}

.current-album {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

#currentTrack {
    font-weight: bold;
    font-size: larger;
}

.album-cover {
    width: 150px;
    height: 150px;
    margin-right: 1.5rem;
    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 {
    color: var(--text-color);
    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; /* Makes it unclickable */
}

.song-list {
    /* flex: 1; */
    overflow-y: auto;
    margin-bottom: 1.5rem;
    background-color: var(--gray-light);
    border-radius: 0.25rem;
    padding: 0.5rem;
    min-height: 0;
}
.song-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    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: 30px;
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
}

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

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

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

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

.song-info {
    text-align: center;
    margin-bottom: 3rem;
    height: 24px;
}

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

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

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

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

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

.control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    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.5rem;
}

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

.volume-container {
    display: flex;
    align-items: center;
}

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

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

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

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

/* Responsive Styles */

/*For mobile-first design*/
@media screen and (min-width: 768px) {
    .current-album {
        flex-direction: row; /* This changes it to side-by-side on larger screens */
        flex:  1;
    }
}

/*For smaller screens*/
@media screen and (max-width: 768px) {
    .player-container {
        flex-direction: column;
        margin: 2rem;
        height: auto;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
        height: auto;
    }

    .sidebar, .player-content {
    flex: 1; /* Each takes equal vertical space */
    }
    
    .current-album {
        display: flex;
        align-items: center;
        margin-bottom: 1.5rem;
        flex-direction: column; /* Added this for mobile/stacked layout */
    }

    .album-cover {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .controls {
        gap: 0.5rem;
    }

    .volume-slider-container {
        width: 60px;
    }
}

/* Medium screens (tablets) - column layout but all visible */
@media screen and (min-width: 769px) and (max-width: 1194px) {
    .player-container {
        flex-direction: column; /* Keep column layout */
        height: 55rem; /* Maintain height constraint */
        max-width: 90%; /* Allow more width usage */
    }

    .sidebar {
        width: 100%;
        height: 10rem; 
        padding: 1rem;
        max-height: none;
    }

    .sidebar h3 {
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }

    .album-list {
        display: flex;
        flex-direction: row; /* Horizontal album list */
        justify-content: center;
        gap: 1rem;
        overflow-x: auto;
    }

    .album-item {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 0.5rem;
    }

    .album-item-cover {
        width: 40px;
        height: 40px;
    }

    .album-item-title {
        font-size: 0.8rem;
    }

    .album-item-artist {
        font-size: 0.7rem;
    }

    .player-content {
        flex: 1;
        padding-top: 1rem;
        padding-right: 1rem;
        padding-bottom: 3.5rem;
        padding-left: 1rem;
        min-height: 0; /* Remove fixed height constraint */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .current-album {
        flex-direction: row;
        align-items: center;
        margin-bottom: 1rem;
        flex-shrink: 0;
        justify-content: center;
    }
}

    .album-cover {
        width: 100px;
        height: 100px;
        margin-right: 0;
        margin-bottom: 0.5rem;
        f;
        ex;:;
        f;
        ex;: 1;
    }
    
    .song-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    
    .player-controls {
        flex: 1;
        padding: 0.75rem;
    }


}

/* For large screens - existing layout but with height control */
@media screen and (min-width: 1195px) {
    .player-container {
        flex-direction: row; /* Side-by-side layout */
        height: 20rem; /* Maintain height constraint */
    }

    .sidebar {
        width: 250px;
        height: 100%;
        padding: 1.5rem;
    }

    .current-album {
        flex-direction: column; 
        align-items: center; /* Center everything */
        text-align: center;
    }
    
    .album-cover {
        width: 200px; /* Or whatever full width you want */
        height: 200px;
        margin-right: 0; 
        margin-bottom: 1rem; 
    }
    
    .album-info {
        width: 100%;
    }
}
/* For very small screens */
@media screen and (max-width: 480px) {
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    #playBtn {
        font-size: 1.2rem;
    }

    .song-item {
        padding: 0.5rem;
    }

    .volume-slider-container {
        display: none;
    }
}