/* Universal Styles */
:root {
    --primary-bg: #000000;
    --secondary-bg: #1e1e1e;
    --dark-bg: #000000;
    --text-color: #fff;
    --sub-text-color: #b3b3b3;
    --green: #1db954;
    --green-dark: #1aa34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

html, body {
    height: 100%;
    background-color: var(--primary-bg);
    color: var(--text-color);
}

.page-container {
    display: none;
    height: 100vh;
    width: 100%;
    transition: opacity 0.5s ease-in-out;
}

.page-container.visible {
    display: block;
    opacity: 1;
}

.page-container.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

/* Landing & Login Page */
#landing-page {
    background-color: var(--dark-bg);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--secondary-bg);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo i {
    color: var(--green);
    margin-right: 0.5rem;
}

.nav-links a {
    color: var(--sub-text-color);
    text-decoration: none;
    margin-left: 1.5rem;
}

.nav-links a:hover {
    color: var(--text-color);
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.login-form-container {
    background-color: var(--secondary-bg);
    padding: 2.5rem;
    border-radius: 8px;
    width: 350px;
    text-align: center;
    margin-bottom: 2rem;
}

.login-form-container h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

input {
    width: 100%;
    padding: 0.8rem;
    border: none;
    background-color: var(--primary-bg);
    color: var(--text-color);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.continue-btn {
    background-color: var(--green);
    color: var(--dark-bg);
}

.continue-btn:hover {
    background-color: var(--green-dark);
}

.or-divider {
    color: var(--sub-text-color);
    margin: 1.5rem 0;
}

.social-btn {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border: 1px solid var(--sub-text-color);
    color: var(--text-color);
    text-align: left;
    padding: 0.8rem 1.5rem;
}

.social-btn i {
    margin-right: 1rem;
}

.album-grid {
    width: 100%;
    padding: 0 2rem;
}

.album-grid h2 {
    margin-bottom: 1rem;
}

.album-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.album-card {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
}

.album-card img {
    max-width: 300px ;
    height: 380px;
    border-radius: 8px;
}

.play-button-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: var(--green);
    border-radius: 50%;
    padding: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.album-card:hover .play-button-overlay {
    opacity: 1;
    transform: translateY(-5px);
}

.play-button-overlay i {
    color: var(--dark-bg);
}

/* Music Player Page */
#player-page {
    display: grid;
    grid-template-areas:
        "sidebar main-content"
        "music-bar music-bar";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 1fr 90px;
    height: 100vh;
}

.sidebar {
    grid-area: sidebar;
    background-color: var(--dark-bg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.library, .settings {
    margin-top: 1.5rem;
}

.library h3 {
    margin-bottom: 1rem;
}

.sidebar button {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

.main-content {
    grid-area: main-content;
    background-color: var(--primary-bg);
    padding: 1rem 2rem;
    overflow-y: auto;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    gap: 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--secondary-bg);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    width: 300px;
}

.search-bar input {
    margin-bottom: 0;
    background-color: transparent;
    border: none;
    color: var(--text-color);
    width: 100%;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-actions a, .user-actions button, #user-email {
    color: var(--sub-text-color);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.user-actions a:hover, .user-actions button:hover, #user-email:hover {
    color: var(--text-color);
}

#user-email {
    font-weight: bold;
}

.divider {
    color: var(--sub-text-color);
}

.content-sections h2 {
    margin-bottom: 1rem;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* New style for active song card */
.music-card.active {
    background-color: #282828;
    border: 2px solid var(--green);
}

.music-card {
    background-color: var(--secondary-bg);
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    position: relative;
    text-align: center;
}

.music-card:hover {
    background-color: #791414;
}

.music-card img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

.music-card h4 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-card span {
    color: var(--sub-text-color);
    font-size: 0.8rem;
}

.music-card .play-button {
    position: absolute;
    bottom: 55px;
    right: 15px;
    background-color: var(--green);
    color: var(--dark-bg);
    border-radius: 50%;
    padding: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.music-card:hover .play-button {
    opacity: 1;
    transform: translateY(-5px);
}

.play-button-overlay i {
    color: var(--dark-bg);
}

.artist-grid {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.artist-card {
    text-align: center;
}

.artist-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

/* Music Player Bar */

.music-player-bar {
    grid-area: music-bar;
    background-color: var(--secondary-bg);
    display: flex;
    justify-content: space-between; /* Spreads components to opposite ends */
    align-items: center;
    padding: 0 2rem;
    border-top: 1px solid #282828;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 180px; /* A consistent width for the left side */
}

.song-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.song-info .details h4 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info .details span {
    color: var(--sub-text-color);
    font-size: 0.8rem;
}

/* NEW: The container for the progress bar and controls */
.playback-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1; /* This container takes all the extra space */
}

.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.controls button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.controls button:hover {
    color: var(--green);
    transform: scale(1.1);
}

.controls button#play-pause-btn {
    font-size: 1.8rem;
    color: var(--green);
}
/* Progress Bar Styles */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 400px;
    margin: 0 2rem;
}

#progress-bar {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #27c346;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
    transition: background 0.2s ease;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s ease;
}

#progress-bar:hover::-webkit-slider-thumb {
    transform: scale(1);
}

.progress-bar-container span {
    font-size: 0.8rem;
    color: var(--sub-text-color);
}

/* Volume Bar Styles */
.volume-container {
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
    margin-left: auto;
}

#volume-bar {
  -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #10e462;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

#volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background:rgb(255, 255, 255);
    border-radius: 50%;
}

.volume-container i {
    color: var(--sub-text-color);
    font-size: 1.1rem;
}

/* Toast Message Styles */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #28a745;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index: 5000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* Animated Background for Landing Page */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: var(--dark-bg); 
    background-image: 
        url('images/guitar.gif'),
        url('images/piano.gif'),
        url('images/drums.gif'),
        url('images/saxophone.gif');
    background-size: 
        300px, 
        250px, 
        350px, 
        280px; 
    background-position: 
        10% 20%, 
        70% 50%, 
        30% 80%, 
        85% 15%; 
    background-repeat: no-repeat;
    filter: blur(5px);
    opacity: 4px;
    transition: opacity 0.5s ease-in-out;
}

#landing-page .navbar, 
#landing-page .content-wrapper {
    position: relative;
    z-index: 1;
}

#landing-page main.content-wrapper {
    flex-grow: 1;
    justify-content: center;
}

.login-form-container {
    background-color: var(--secondary-bg);
    padding: 2.5rem;
    border-radius: 8px;
    width: 350px;
    text-align: center;
    margin-bottom: 2rem;
    z-index: 2;
    position: relative;
}

/* Footer */
footer {
    padding: 26px;
    text-align: center;
    background: #000000;
    color:green;
    border-top: 1px solid #282828;
    box-shadow: 0 -6px 24px rgba(250, 250, 250, 0.04);
    font-weight:300;
    letter-spacing: .08em;
}