﻿/* General reset and basic styling */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

/* Styling for the sidebar */
#sidebar {
    position: fixed;
    top: 120px; /* Manually adjusted top position */
    left: -700px;
    width: 630px; /* Manually adjusted width */
    height: 610px !important; /* Manually adjusted height */
    background-color: #fff;
    padding: 20px;
    box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: all 0.3s ease;
}

    /* Remove bullets and markers from all lists in the sidebar */
    #sidebar ul {
        list-style-type: none;
        padding-left: 0; /* Ensure no padding on the left */
    }

/* Button to open the sidebar */
#openSidebarBtn {
    position: fixed;
    top: 120px;
    left: 12px;
    z-index: 10000;
    padding: 10px 15px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

    #openSidebarBtn:hover {
        background-color: #0056b3;
    }

/* Style for the close button (X) in the top-right corner of the sidebar */
#closeSidebarBtn {
    position: absolute;
    top: 10px;
    right: 20px;
    background-color: #ff3b3b;
    color: white;
    border: none;
    font-size: 18px;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10000;
}

    #closeSidebarBtn:hover {
        background-color: #e60000;
    }

/* Styling for the region and city buttons */
button.toggle-region,
button.toggle-city {
    background: none;
    border: none;
    color: #007BFF;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding: 10px;
    padding-bottom: 0px;
    width: 100%;
    border-radius: 5px;
}

    /* Styling for the icon of the region and city buttons (+ or -) */
    button.toggle-region::before,
    button.toggle-city::before {
        content: '+'; /* Default icon */
        font-weight: bold;
        margin-right: 10px;
        width: 30px;
        height: 30px;
        background-color: white;
        color: #555;
        border: 1px solid #BCC4D1;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* When the icon is a minus */
    button.toggle-region.minus::before,
    button.toggle-city.minus::before {
        content: '-'; /* Change to minus */
        background-color: #007BFF;
        color: white;
    }

/* Styling for the regions and cities lists */
.nested, .nested-zipcode {
    display: none;
    list-style-type: none; /* This will remove bullets */
}

button.toggle-city {
    padding-left: 30px;
}

/* Styling for the filters container */
.filters-container {
    display: flex;
    justify-content: space-between;
}

.filters-left {
    width: 50%;
}

.filters-right {
    width: 45%;
    padding-left: 20px;
}

/* Styling for the filter inputs */
label, select {
    font-size: 16px;
    margin-bottom: 10px;
    display: block;
    width: 100%;
}

select {
    padding: 5px;
}

/* Class to hide the button */
.hidden {
    display: none;
}

/* Ensure map is scrollable with one finger on mobile */
#map {
    height: 100vh;
    width: 100%;
    border: none;
    position: relative;
    top: 0;
    left: 0;
    z-index: 1; /* Ensure map is above other elements */
    touch-action: manipulation;
    pointer-events: auto;
}

/* Make only the regions list scrollable */
#regions {
    max-height: 430px; /* Adjust the height as needed */
    overflow-y: auto; /* Enable vertical scrolling for the regions list */
    padding-right: 10px; /* Optional - adjusts padding to avoid overlap with scrollbar */
}

/* Ensure the rest of the lists (cities, zip codes) do not scroll */
.nested, .nested-zipcode {
    max-height: none; /* No scrolling for city and zip code lists */
    overflow-y: visible; /* Ensure city/zip code lists don't scroll */
}

/* Optional: Limit the sidebar height for a better fit */
.filters-container {
    max-height: 80vh; /* Restrict the height to 80% of the viewport */
    overflow-y: visible; /* Prevent scrolling for the entire sidebar */
}

/* Styling for the "Velja allt" button in city lists */
.check-all-options {
    background: none;
    border: none;
    color: #007BFF;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: block; /* Make the button take up the whole line */
    margin-bottom: 5px;
    text-decoration: underline;
    padding: 5px 0; /* Vertical padding for a cleaner look */
    margin-top: 5px; /* Reduces the space between the button and zip codes */
}

    .check-all-options:hover {
        color: #0056b3;
    }

/* Make sure the list doesn't overflow and add spacing */
.nested-zipcode {
    padding-left: 60px !important; /* Increase the padding to shift it to the right */
}

/* Ensure the "Check all options" button is aligned properly */
.check-all-options {
    margin-top: 10px; /* Optional: Adds space between the button and zip codes */
}

/* Ensure it's distinct from regular zip code options */
.nested-zipcode .check-all-options {
    margin-left: 0px; /* Remove any indentation */
    background-color: transparent; /* Make it look like a button */
    border: none; /* Make sure it doesn't look like a regular list item */
}

/* Style the dropdown container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Style the dropdown button */
.dropbtn {
    background-color: #007BFF;
    color: white;
    padding: 10px 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    width: 245px;
    margin-bottom: 10px; /* Add some space between the dropdown and next button */
}

/* Dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    z-index: 1;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    padding: 10px;
}

    /* Style the checkboxes inside the dropdown */
    .dropdown-content label {
        display: block;
        padding: 8px;
        cursor: pointer;
    }

    .dropdown-content input[type="checkbox"] {
        margin-right: 10px;
    }

/* Apply Filters Button */
.apply-filters-btn {
    background-color: #007BFF;
    color: white;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px; /* Adjusted to add a bit more space between buttons */
    
}

    .apply-filters-btn:hover {
        background-color: #0056b3;
    }

/* Apply border-box to all elements */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Hide the close button on screens larger than 768px */
@media screen and (min-width: 768px) {
    .gm-ui-hover-effect {
        display: none !important;
    }
}
.gm-style-iw {
    z-index: 10000 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Make the sidebar horizontally scrollable on mobile */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        white-space: nowrap;
        overflow-x: auto; /* Enable horizontal scrolling */
        overflow-y: hidden; /* Disable vertical scrolling */
        height: 100%; /* Ensure the sidebar takes full height */
        padding-bottom: 60px; /* Add padding to the bottom to ensure button visibility */
    }

    .dropdown-content {
        bottom: -70%; /* Make the dropdown show upwards */
        right: 100%; /* Padding from the left edge */
    }

    .apply-filters-btn {
        position: absolute; /* Fix the button position within the sidebar */
        bottom: 10px; /* Place it near the bottom */
        left: 20px; /* Padding from the left edge */
        right: 20px; /* Padding from the right edge */
        z-index: 1000; /* Ensure it stays above other content */
    }

    .clear-filters-btn {
        position: absolute; /* Fix the button position within the sidebar */
        bottom: 60px; /* Place it near the bottom */
        left: 20px; /* Padding from the left edge */
        right: 20px; /* Padding from the right edge */
        z-index: 1000; /* Ensure it stays above other content */
    }

    .sidebar-content {
        display: inline-block;
        min-width: 700px; /* Allow scrolling wider than the sidebar width */
    }

    .filters-container {
        display: inline-flex;
        flex-direction: row; /* Ensure filters are side-by-side */
        padding-bottom: 100px; /* Extra padding to avoid overlap with the button */
    }

    .filters-left, .filters-right {
        width: auto; /* Let the sections expand as needed */
        min-width: 300px; /* Prevent them from collapsing */
    }
    .scroll-spacer {
        display: inline-block;
        width: 200px; /* Adjust this width as needed */
        height: 1px;
        padding-bottom: 20px; /* Extra padding to avoid overlap with the button */
    }
    #map {
        /*height: calc(100vh - 50px);*/ /* Adjust height dynamically */
        height: 100vh; /* Full height even on mobile */
    }
    .info-window {
        z-index: 10000; /* Ensure it stays above other content */
    }
}

.overlay-element {
    pointer-events: none; /* Allows touch events to pass through overlays */
}

/* Apply Filters Button */
.clear-filters-btn {
    background-color: #ff0000e8;
    color: white;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px; /* Adjusted to add a bit more space between buttons */
}
