* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: transparent;
    background-size: 400% 400%;
    height: 100vh;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 95vw;
    height: 90vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: 1fr 80px;
    gap: 15px;
    transition: grid-template-columns 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.app-container.collapsed {
    grid-template-columns: 80px 1fr;
}

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.sidebar {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.menu-btn {
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
}

.menu-btn:hover {
    color: #1db954;
}

.sidebar ul {
    list-style: none;
    margin-top: 10px;
    flex-grow: 1; /* Pushes profile section to the very bottom */
}

.sidebar li {
    padding: 12px 0;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
}

.sidebar li:hover, .sidebar li.active {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.menu-text {
    transition: opacity 0.3s, transform 0.3s, max-width 0.3s;
    font-size: 1.1rem;
    max-width: 150px;
    overflow: hidden;
}

/* Profiles & Avatars */
.user-profile-section {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.app-container.collapsed .menu-btn { transform: translateX(6px); }
.app-container.collapsed .icon { transform: translateX(8px); }
.app-container.collapsed .user-avatar { transform: translateX(3px); }

.app-container.collapsed .menu-text,
.app-container.collapsed .user-name {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

.app-container.collapsed .login-btn {
    padding: 10px;
    font-size: 0.7rem;
    width: 100%;
}

.main-content {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    overflow-y: auto;
}

.player-bar {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 30px;
}

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

/* Custom Glass Inputs */
.glass-input {
    flex-grow: 1;
    max-width: 400px;
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}
.glass-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}
.glass-input::placeholder { color: rgba(255, 255, 255, 0.5); }

.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
}
.glass-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.glass-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}
.glass-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: 0.2s;
}
.glass-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }

/* Track list styling */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}
.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}
.search-thumbnail { width: 50px; height: 50px; border-radius: 5px; object-fit: cover; }
.search-info h4 { font-size: 1rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.search-info p { font-size: 0.8rem; opacity: 0.7; }


/* === Advanced Media Controls Styling === */
.media-controls {
    display: flex;
    align-items: center;
    gap: 15px; /* Tighter spacing for media buttons */
}

.icon-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Perfect circles */
}

.control-icon {
    width: 24px;
    height: 24px;
}

/* Make the center Play/Pause button stand out */
.main-play-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.main-play-btn .control-icon {
    width: 28px;
    height: 28px;
}

.main-play-btn:hover {
    background: white;
    color: #191414; /* Inverts color so icon turns dark */
    transform: scale(1.1);
}

/* === Queue System & Add Buttons === */
.queue-section {
    margin-top: 20px;
}

.queue-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.add-queue-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: auto; /* Pushes button to the far right */
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.add-queue-btn:hover {
    background: white;
    color: #191414;
    transform: scale(1.1);
}

/* === Queue Added Success State === */
.add-queue-btn.success {
    background: #1db954 !important;
    border-color: #1db954 !important;
    color: white !important;
    transform: scale(1.15);
}

/* === Progress / Seek Bar Styling === */
.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    max-width: 500px;
    margin: 0 40px;
}

.seek-bar {
    width: 100% !important;
}

#time-current, #time-total {
    font-size: 0.8rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: center;
}
/* === Sleep Timer Active State === */
#nav-timer.timer-active {
    color: #1db954;
}
#nav-timer.timer-active svg {
    color: #1db954;
}

/* === Ultimate Login Button Collapsed Fix === */
.collapsed #user-section {
    padding: 5px 0 !important; /* Gives it vertical breathing room */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: visible !important; /* NEW: Completely stops the edges from being cut off! */
}

.collapsed .login-btn {
    width: 34px !important; /* Scaled down slightly to fit perfectly */
    height: 34px !important;
    min-width: 34px !important; 
    min-height: 34px !important; 
    padding: 0 !important;
    margin: 0 auto !important; 
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
}

.collapsed .login-btn svg {
    margin: 0 !important;
    width: 18px !important; /* Scaled the inner SVG slightly to match the new circle */
    height: 18px !important;
}

.collapsed .login-btn .menu-text {
    display: none !important;
}
#modal-skip-btn:hover {
    opacity: 1 !important;
}
/* === Dynamic Blurred Background === */
#dynamic-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;  /* Made slightly larger to hide the blurred white edges */
    height: 120%;
    background-size: cover;
    background-position: center;
    background-color: #121212; /* Fallback dark color before a song plays */
    z-index: -1;  /* Forces it to the absolute bottom layer */
    
    /* Heavy blur and dimming so your white text stays readable */
    filter: blur(40px) brightness(0.4); 
    
    /* Smooth 1-second crossfade when the song changes */
    transition: background-image 1s ease-in-out; 
    pointer-events: none; 
}
/* Make Recently Played cards pop on hover */
.history-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}
/* Spotify-Style Smart Marquee */
.scroll-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    /* This creates the fade effect at the edge */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.scroll-text {
    display: inline-block;
    white-space: nowrap;
    /* 15s total: 2s pause + 13s scroll */
    animation: marquee 15s linear infinite;
    padding-left: 100%; /* Ensures it starts off-screen */
}

@keyframes marquee {
    0%, 15% { 
        /* The "Stop at Start" Phase (approx 1.5 seconds) */
        transform: translateX(0); 
    } 
    100% { 
        /* The "Continuous Scroll" Phase */
        transform: translateX(-100%); 
    } 
}