/* FONT & BODY STYLES */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #121212;
    background-image: url('/imgs/background.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #E0E0E0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
html {
    scroll-behavior: smooth;
}
/* Prevent background scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* --- UNCHANGED STYLES AS REQUESTED --- */
.fuser-customs-title {
    font-family: 'Readex Pro', 'Inter', 'Roboto', system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6, #EC4899, #F97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.track-card { 
    mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' rx='12' ry='12'/%3e%3c/svg%3e"); 
    position: relative; display: flex; justify-content: center; align-items: center; 
    aspect-ratio: 1 / 1; background-color: rgb(29, 1, 71); overflow: hidden; 
    transform: translateZ(0); backface-visibility: hidden; transform-style: preserve-3d; 
    flex-shrink: 0; width: 220px;
}
.track-card:hover { z-index: 10; }
.album-art-image { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background-size: cover; background-position: center; 
    transition: transform 0.3s ease; z-index: 0; 
}
.track-card:hover .album-art-image { transform: scale(1.05); }
.track-card::after { 
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(to top, rgba(0, 0, 0, 1), transparent 70%); z-index: 1; 
}
.album-art-placeholder { 
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; 
    color: rgba(139, 92, 246, 0.5); font-size: 48px; 
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(168, 139, 250, 0.1) 100%); 
}
.text-overlay { 
    position: absolute; bottom: 0; left: 0; right: 0; 
    padding: 1rem; z-index: 2; text-align: center; 
}
.track-title { 
    color: #ffffff; font-weight: 700; font-size: 1.125rem; line-height: 1.3; 
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; 
}
.track-artist, .track-creator { 
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; 
}
.track-artist { 
    color: #e5e7eb; font-weight: 500; font-size: 1rem; 
    line-height: 1.4; margin-top: 0.125rem; 
}
.track-creator { 
    color: #d1d5db; font-size: 0.875rem; font-weight: 400; margin-top: 0.25rem; 
}
.track-meta-hover { 
    position: absolute; bottom: 1rem; left: 1rem; right: 1rem; color: #d1d5db; 
    font-size: 0.875rem; font-weight: 400; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); 
    margin-top: 0.25rem; text-align: center; 
}
.instrument-icons-container { 
    display: flex; justify-content: center; align-items: center; 
    gap: 0.5rem; margin-top: 0.5rem; height: 1.125rem; 
}
.instrument-icons-container img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.instrument-icons-container span { 
    font-size: 1.5rem; line-height: 1; color: rgba(209, 213, 219, 0.7); padding-bottom: 2px; 
}
.card-actions-container { 
    position: absolute; top: 0.75rem; right: 0.75rem; z-index: 5; display: flex; 
    gap: 0.5rem; align-items: center; 
}
.card-download-button, .more-info-icon { 
    width: 2.25rem; height: 2.25rem; border-radius: 9999px; 
    background-color: rgba(18, 14, 38, 0.7); backdrop-filter: blur(4px); 
    display: flex; align-items: center; justify-content: center; 
    color: #e5e7eb; transition: background-color 0.2s; border: none; padding: 0; cursor: pointer; 
}
.card-download-button:hover, .more-info-icon:hover { background-color: #8b5cf6; color: #ffffff; }
.complete-icon { 
    position: absolute; top: 0.75rem; left: 0.75rem; z-index: 5; width: 2.25rem; 
    height: 2.25rem; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 1)) drop-shadow(0 0 2px rgba(0, 0, 0, 1)) drop-shadow(0 0 6px rgba(0, 0, 0, 1)); 
}
.so-icon {
    position: absolute;
    top: 0.9rem;
    left: 0.75rem; /* Default position */
    z-index: 5;
    width: 2rem;
    height: 2rem;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 1)) drop-shadow(0 0 2px rgba(0, 0, 0, 1)) drop-shadow(0 0 6px rgba(0, 0, 0, 1));
}
.complete-icon + .so-icon {
    left: 3.5rem;
}
/* --- END OF UNCHANGED STYLES --- */

/* --- NEW REDESIGN STYLES --- */

/* WELCOME HERO SECTION */
#welcome-hero {
    width: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}
#welcome-hero .fuser-customs-title {
    font-size: 4.5rem;
    line-height: 1.1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.welcome-creators {
    color: #c0c0c0;
    font-size: 1rem;
    font-weight: 400;
    margin-top: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}
.welcome-subtitle {
    color: #E0E0E0;
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}


/* HEADER / MENU BAR */
#top-menu-bar {
    position: sticky;
    top: 1rem;
    z-index: 100;
    margin: 1rem 1rem 0 1rem;
    background-color: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #282828;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    transition: top 0.3s;
}
.menu-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.menu-left .fuser-customs-title {
    font-size: 1.75rem;
    line-height: 1;
}
.menu-right {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}
.main-nav {
    display: flex;
    gap: 0.5rem;
}
.main-nav a, .header-button {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    color: #B3B3B3;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
    border: none;
    background-color: transparent;
    cursor: pointer;
}
.main-nav a:hover, .main-nav a.active, .header-button:hover {
    color: #FFFFFF;
    background-color: #333333;
}

/* SEARCH BAR IN MENU */
#searchInput {
    background-color: #282828;
    border: 1px solid transparent;
    color: #FFFFFF;
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    width: 100%;
    max-width: 400px;
    transition: border-color 0.2s, background-color 0.2s;
}
#searchInput:focus {
    background-color: #1a1a1a;
    border-color: #3B82F6;
    outline: none;
}
#searchInput::placeholder {
    color: #B3B3B3;
}

/* MAIN CONTENT AREA */
main {
    padding: 0 0 5rem 0;
}

#browserViewContainer {
    margin-top: 2rem;
}

/* --- NEW CONTAINER-BASED STYLES --- */
#homePageContainer,
#browserViewContainer {
    background-color: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.content-panel {
    padding: 1.5rem 3rem;
    margin-bottom: 0;
}

#homePageContainer {
    display: none; /* Hide by default until content is loaded */
    margin-top: 2rem;
}

#filterControlsHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 3rem;
    margin-bottom: 0;
}
/* --- END OF NEW CONTAINER STYLES --- */


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFFFFF;
}
.browse-all-button {
    background-color: transparent;
    border: 1px solid #535353;
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.browse-all-button:hover {
    background-color: #282828;
    border-color: #FFFFFF;
}

/* SLIDERS */
.slider-wrapper { position: relative; margin: 0 -0.5rem; }
.track-slider, .category-slider {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    margin: -1rem 0;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.track-slider::-webkit-scrollbar, .category-slider::-webkit-scrollbar { display: none; }
.slider-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, 0.7);
    border: 1px solid #282828; color: white; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease; opacity: 0; pointer-events: none;
}
.slider-wrapper:hover .slider-nav { opacity: 1; pointer-events: auto; }
.slider-nav:hover { background: #3B82F6; border-color: #3B82F6; }
.left-nav { left: 0.5rem; } .right-nav { right: 0.5rem; }

.category-button { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.25rem; letter-spacing: 0.5px; color: #ffffff; text-shadow: 0 1px 4px rgba(0,0,0,0.5); padding: 1.5rem 2.5rem; border-radius: 0; flex-shrink: 0; cursor: pointer; transition: all 0.3s ease; border-radius: 15px; }
.category-button:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.color-1 { background-image: linear-gradient(to top, #3b82f6, #0d1a36); } .color-2 { background-image: linear-gradient(to top, #8b5cf6, #2a0e5f); } .color-3 { background-image: linear-gradient(to top, #ec4899, #4f0725); } .color-4 { background-image: linear-gradient(to top, #f97316, #421806); } .color-5 { background-image: linear-gradient(to top, #10b981, #022c21); } .color-6 { background-image: linear-gradient(to top, #6366f1, #1a184a); } .color-7 { background-image: linear-gradient(to top, #f59e0b, #3f1c05); }

/* BROWSER VIEW & FILTERS */
.browser-view { display: none; }
#playlistHeader {
    display: none;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #282828;
}

.filter-input {
    background: #282828;
    border: 1px solid #535353;
    color: #ffffff;
    border-radius: 8px;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}
.filter-input:focus {
    outline: none;
    border-color: #3B82F6;
    background: #333333;
}
.filter-input > span {
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
     display: block;
}

#status-display {
    color: #B3B3B3;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* NEW MULTI-SELECT FILTER STYLES */
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: #282828;
    border: 1px solid #535353;
    border-radius: 8px;
    margin-top: 4px;
    padding: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}
.filter-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    color: #e0e0e0;
}
.filter-dropdown-item:hover .custom-checkbox {
    border-color: #a7a7a7;
}
.filter-dropdown-item:hover {
    background-color: #3a3a3a;
}

/* CUSTOM CHECKBOX STYLES */
.filter-dropdown-item input[type="checkbox"] {
    display: none; /* Hide the original checkbox */
}
.custom-checkbox {
    width: 18px;
    height: 18px;
    background-color: #333;
    border: 1px solid #777;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
}
.custom-checkbox::after {
    content: '';
    position: absolute;
    display: none; /* Hidden by default */
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.filter-dropdown-item input[type="checkbox"]:checked ~ .custom-checkbox {
    background-color: #3B82F6;
    border-color: #3B82F6;
}
.filter-dropdown-item input[type="checkbox"]:checked ~ .custom-checkbox::after {
    display: block;
}


/* GRID & LOADING/ERROR STATES */
#song-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
#grid-load-trigger { height: 50px; }
#noResults, #loading, #error {
    display: none;
    min-height: 400px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #B3B3B3;
}
#loading .spinner {
    width: 48px; height: 48px; border-radius: 50%;
    border: 4px solid #535353; border-top-color: #3B82F6;
    animation: spin 1s linear infinite; margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* MODAL STYLES */
.modal-overlay {
    position: fixed; inset: 0; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
    z-index: 200; display: none; align-items: center; justify-content: center;
}
.modal-content {
    background-color: #1a1a1a; border: 1px solid #333; border-radius: 16px;
    padding: 2rem; width: 100%; max-width: 500px; color: #e0e0e0;
}
.modal-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }
.modal-label { display: block; font-size: 0.875rem; font-weight: 500; color: #b3b3b3; margin-bottom: 0.5rem; }
.modal-input {
    width: 100%; background-color: #282828; border: 1px solid #535353; color: #fff;
    border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem;
}
.modal-input:focus { outline: none; border-color: #3b82f6; }
.modal-button {
    padding: 0.6rem 1.25rem; font-weight: 600; border-radius: 50px; transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer; border: 1px solid transparent;
}
.modal-button-primary { background-color: #3B82F6; color: #fff; }
.modal-button-primary:hover { background-color: #2563eb; }
.modal-button-primary:disabled { background-color: #535353; color: #b3b3b3; border-color: transparent; cursor: not-allowed; }
.modal-button-secondary {
    background-color: transparent;
    color: #e0e0e0;
    border-color: #535353;
}
.modal-button-secondary:hover {
    background-color: #333;
    border-color: #777;
}
#correctionSearchResults { max-height: 200px; overflow-y: auto; background: #282828; border-radius: 8px; margin-bottom: 1rem; }
.search-result-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background-color: #3b82f6; }
.search-result-item p { margin: 0; }
#selectedSongInfo { background: #282828; border-radius: 8px; padding: 0.75rem; margin-bottom: 1rem; }

/* MISC & TOOLTIP FIX */
.global-tooltip {
    position: absolute; /* MODIFIED: Changed from fixed to absolute */
    background-color: #282828; 
    border: 1px solid #535353;
    border-radius: 8px; 
    padding: 0.75rem; 
    width: 280px; 
    z-index: 1000;
    pointer-events: none; 
    backdrop-filter: none;
}
.global-tooltip h4 { 
    font-weight: 600; color: #FFFFFF; margin-bottom: 0.5rem; padding-bottom: 0.5rem; 
    border-bottom: 1px solid #535353; font-size: 0.95rem; 
}
.global-tooltip ul { list-style: none; padding: 0; margin: 0; font-size: 0.875rem; }
.global-tooltip li { display: flex; justify-content: space-between; padding: 0.25rem 0; gap: 8px; }
.global-tooltip .label { color: #B3B3B3; margin-right: 0.5rem; flex-shrink: 0; }
.global-tooltip .value { 
    color: #FFFFFF; font-weight: 500; text-align: right; 
    white-space: normal; word-break: break-word;
}
.global-tooltip .value.yes { color: #4ade80; } .global-tooltip .value.no { color: #f87171; }


/* --- MOBILE MENU & RESPONSIVENESS --- */

/* Overlay for when the menu is open */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
body.mobile-menu-open #menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* The Hamburger Button itself */
.hamburger-btn {
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: space-around;
    width: 2.25rem;
    height: 2.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
}
.hamburger-btn span {
    width: 1.75rem;
    height: 3px;
    background: #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* The Slide-in Menu Panel */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background-color: #181818;
    z-index: 200;
    border-left: 1px solid #282828;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
body.mobile-menu-open .mobile-menu-panel {
    transform: translateX(0);
}
.mobile-menu-header {
    display: flex;
    justify-content: flex-end; /* Pushes the close button to the far right */
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #282828;
}
.close-menu-btn {
    background: none;
    border: none;
    color: #e5e7eb;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}
.mobile-menu-content {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
}
.mobile-menu-content .mobile-nav-link,
.mobile-menu-content .mobile-nav-button {
    color: #E0E0E0;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: left;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.mobile-menu-content .mobile-nav-link:hover,
.mobile-menu-content .mobile-nav-button:hover {
    background-color: #333;
}


/* Media query for tablets */
@media (max-width: 1024px) {
    .content-panel,
    #filterControlsHeader {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}


/* Media query for mobile phones */
@media (max-width: 768px) {
    /* General Layout */
    .content-panel,
    #filterControlsHeader {
        padding: 1.5rem 1rem;
    }

    /* --- Header Modifications --- */
    #top-menu-bar {
        position: static;
        margin: 0; 
        padding: 1rem;
        display: flex;
        flex-wrap: wrap; 
        align-items: center;
        gap: 1rem;
        border-radius: 0; 
    }
    .menu-left {
        flex-grow: 1;
        gap: 1rem;
    }
    .menu-left .fuser-customs-title {
        font-size: 2rem;
    }
    .hamburger-btn {
        display: flex;
    }
    .menu-right {
        flex-basis: 100%;
        order: 3;
        flex-grow: 0;
    }
    #searchInput {
        max-width: none;
        width: 100%;
    }
    .main-nav, .header-button {
        display: none;
    }

    /* Welcome Hero */
    #welcome-hero {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }

    /* Section Headers */
    .section-title {
        font-size: 1.5rem;
    }

    /* --- Filter Controls --- */
    #filterControlsHeader {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    #filterControlsHeader .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    #status-display {
        text-align: center;
        padding-top: 0.5rem;
    }

    /* Playlist Header */
    #playlistHeader {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    #playlistHeader h2 {
        font-size: 2.25rem;
    }

    /* Song Grid */
    #song-grid {
        gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    /* ADDED: This makes grid cards responsive and prevents overlap */
    #song-grid .track-card {
        width: auto;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    #correctionModalFooter {
        flex-direction: column;
        gap: 0.75rem;
    }
    #correctionModalFooter .modal-button {
        width: 100%;
        text-align: center;
    }
}