/* CSS Fixes */

/* Add styles for browse mode */
body.browse-mode .container {
    padding-top: calc(20vh + 10px) !important;
}

/* Fixed header for multi-search title */
#multi-search-title {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    z-index: 9999 !important;
    background: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    padding: 20px !important;
    padding-top: 25px !important;
    border-bottom: 2px solid #e0e0e0 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    text-align: center !important;
    margin: 0 !important;
    margin-left: 0 !important;
    border-radius: 0 !important;
}

/* Fix positioning of edit/delete controls */
.filter-controls {
    position: relative !important;
    float: right !important;
    display: inline-block !important;
    margin-left: 10px !important;
    padding: 2px 6px !important;
    background: white !important;
    border-radius: 4px !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
}

/* Ensure proper spacing for content below fixed header */
body.multi-search-mode .container,
body.browse-mode-with-filters .container {
    padding-top: 150px !important; /* Space for header on all devices */
}

/* Desktop-specific styles to prevent buttons from being hidden */
@media (min-width: 769px) {
    /* Prevent buttons from being hidden on initial load */
    #saved-filters-container {
        margin-top: 0 !important; /* Don't add extra margin on top of container padding */
        position: static !important; /* Ensure it's not sticky itself */
        z-index: 1 !important; /* Lower than header */
    }
    
    /* Make circle menu button always visible on desktop */
    #mobile-menu-btn {
        display: flex !important;
        bottom: 164px !important; /* Position above the quick-save button */
        z-index: 9998 !important; /* High z-index to ensure visibility */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ensure toggle button is visible */
    #toggle-view-btn {
        z-index: 9998 !important;
    }
    
    /* Exit multi-search button */
    #exit-multi-search-btn {
        position: fixed !important;
        bottom: 234px !important; /* Position above the menu button */
        right: 24px !important;
        z-index: 9998 !important;
        background: #e74c3c !important;
        color: #fff !important;
        border: none !important;
        border-radius: 50% !important;
        width: 56px !important;
        height: 56px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        font-size: 1.7rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

@media (max-width: 768px) {
    #multi-search-title {
        height: 20vh !important;
        max-height: 20vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        padding: 10px 15px !important;
        padding-top: 20px !important;
    }
    
    body.browse-mode .container,
    body.browse-mode-with-filters .container,
    body.multi-search-mode .container {
        padding-top: calc(20vh + 10px) !important;
    }
    
    /* Make saved filter buttons go under the header */
    #saved-filters-container {
        margin-top: 0 !important;
        z-index: 1 !important;
        position: relative !important;
    }
    
    /* Exit multi-search button */
    #exit-multi-search-btn {
        position: fixed !important;
        bottom: 234px !important; /* Position above the menu button */
        right: 24px !important;
        z-index: 9998 !important;
        background: #e74c3c !important;
        color: #fff !important;
        border: none !important;
        border-radius: 50% !important;
        width: 56px !important;
        height: 56px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        font-size: 1.7rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }
}
