* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

body {
    line-height: 1.5;
    background-image: url('properties-background.jpg');
    background-size: cover;
    background-position: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Header Styles */
header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    padding-bottom: 80px;
    width: 100%;
    z-index: 1000;
}

.logo img {
    max-width: 400px;
    height: auto;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    z-index: 1000;
}

nav ul li a {
    color: #004080;
    padding: 15px;
    border-radius: 5px;
    transition: background-color 0.3s;
    text-decoration: none;
    font-size: 22px;
}

nav ul li a.current-page {
    color: #DC143C;
}

nav ul li a:hover {
    color: #DC143C;
}

/* Burger menu toggle button */
.menu-toggle {
    display: none; /* Hidden by default (only shows on smaller screens) */
    align-items: center;
    justify-content: flex-end;
    font-size: 18px; /* Adjusted size */
    color: #085eb4; /* Brand color or a more sophisticated tone */
    position: absolute;
    right: 20px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: bold; /* Make the label bold */
    text-transform: uppercase; /* Uppercase for a more professional feel */
    letter-spacing: 1px; /* Add slight letter spacing */
    padding: 5px 10px; /* Add some padding around the label and icon */
    background: none; /* No background */
    border: none; /* No border */
    outline: none; /* No focus outline */
    transition: color 0.3s ease, transform 0.3s ease; /* Smooth transition for effects */
}

.menu-toggle:hover,
.menu-toggle:focus {
    color: #DC143C; /* Darken color on hover for better contrast */
    transform: scale(1.05); /* Slightly enlarge on hover for emphasis */
}

/* Styling for the Menu Label */
.menu-toggle::before {
    content: "Menu";
    margin-right: 10px;
    font-size: 18px; /* Increase size of the "Menu" label */
    color: #085eb4; /* Matching the burger icon */
    color: inherit; /* Inherit color from parent (.menu-toggle) */
}

.menu-toggle:hover::before {
    color: #DC143C;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Hover effects for the icon */
.menu-toggle:hover::after {
    color: #DC143C; /* Darker color on hover */
}

/* Animation for sliding effect */
.show-menu {
    animation: slideDown 0.3s ease-out forwards;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-section h2 {
    text-align: center;
    color: #fff;
    font-size: 45px;
    margin-top: -40px;
    margin-bottom: 30px;
}

/* Main Content Styles */
main .search-filters {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 12px;
    border: none;
    margin: 0 auto;
    width: 50%; /* Responsive width */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Container holding the input and selected tags */
.location-input-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    margin-left: 10px;
}

/* Adjusts the input to appear integrated with the tags */
#location-input {
    width: calc(100% - 10px);
    padding-right: 10px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 10px;
}

/* Container for the dynamically added tags */
#location-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    padding-left: 0;
}

/* Style for individual selected tags */
#location-tags-container span {
    background-color: #007bff;
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Suggestion box that appears as user types */
#location-suggestions-container {
    position: absolute;
    top: 100%; /* Positions it right below the input */
    left: 0;
    width: 50%; /* Adjust width as necessary */
    background: white; /* Or any color that makes the suggestions visible */
    border: 1px solid #ccc; /* Optional, for better visibility */
    border-radius: 5px;
    z-index: 1000; /* Increased to ensure it's above other content */
    min-height: 20px; /* Ensure container has height even when empty */
    display: none; /* Initially hidden */
}

#location-suggestions-container .suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee; /* Optional, adds a separator between items */
}

#location-suggestions-container .suggestion-item:last-child {
    border-bottom: none; /* Removes the bottom border for the last item */
}

#location-suggestions-container .suggestion-item:hover {
    background-color: #BFE0E6; /* Highlights item on hover */
}

.filter-group select {
    background-color: #6495ED; /* Cornflower Blue */
    color: #ffffff; 
}

.filter-group select option {
    background-color: #ffffff; /* White background */
    color: #000000; /* Black text */
}

.filter-group select:hover {
    background-color: #7AA0E6; /* Lighter shade of blue */
    border-color: #5691C8; /* Slightly darker border to add depth */
}

/* Flex container for dropdowns to be inline */
.filter-group.select-property-type,
.filter-group.select-min-price,
.filter-group.select-max-price {
    flex: 1 1 calc(33.333% - 10px);
    padding: 5px;
    margin-bottom: 10px;
}

.filter-group.select-bedrooms,
.filter-group.select-bathrooms,
.filter-group.select-garages {
    flex: 1 1 calc(33.333% - 10px); 
    padding: 5px;
    margin-bottom: 20px;
 }

/* Ensuring input and select elements take up full width of their parent container */
.filter-group select, .filter-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.filter-group.checkbox-sea-view,
.filter-group.checkbox-swimming-pool,
.filter-group.checkbox-flat,
.filter-group.checkbox-pet-friendly,
.filter-group.checkbox-no-stairs {
    display: inline-block; /* Display checkboxes inline */
    margin-right: 25px; /* Add horizontal spacing */
    margin-bottom: 10px; /* Add vertical spacing if they wrap */
    margin-left: 10px;
}

/* Search Button */
#search-button {
    background-color: #DC143C;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    align-self: center; /* Align button in the center vertically */
    margin-top: 10px; /* Space from the last filter item */
    margin-left: auto; /* Push the button to the right */
}

#search-button:hover {
    background-color: #B3102A;
}

/* Search Results Styles */

.search-results h3 {
    margin-top: 40px;
    font-size: 40px;
    text-align: center;
    color: #fff;
    border: 1px;
}

.search-results .property-listings {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin-top: 50px;
}

.property-item {
    flex-basis: calc(33.333% - 40px); /* Adjust based on the gap and number of items per row */
    border: 15px solid #fff;
    border-radius: 10px;
    overflow: hidden; /* Keeps child elements contained within the border-radius */
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.property-item:hover {
    background-color: #DBF1FF; 
    border-color: #DBF1FF;
}

.property-item .thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* This creates a 16:9 aspect ratio (9 / 16 * 100) */
    position: relative;
    overflow: hidden;
}

.property-item .thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-banner {
    position: absolute;
    top: 0; 
    left: 0; 
    background-color: #FFA500;
    color: white;
    padding: 5px 10px;
    z-index: 10;
    font-weight: bold;
}

.status-banner.sold {
    background-color: #FF0000;
}

.thumbnail {
    position: relative; 
}


.property-details h4 {
    color: #000; 
    font-size: 18px;
    font-weight: normal;
    margin: 10px 0;
}

.property-details .price {
    font-size: 24px;
    font-weight: bold;
    color: #004080;
    margin-bottom: 15px;
}

.property-details .location {
    font-size: 18px;
    margin-bottom: 5px;
    color: #000; /* Set location text color to black */
    font-weight: normal; /* Set font weight to normal */
}

.features {
    list-style-type: none;
    padding: 0;
    margin-bottom: 5px;
}

.features li {
    display: inline-block; /* Display features side by side */
    margin-right: 20px; /* Add spacing between features */
}

.features .icon {
    margin-right: 5px; /* Add spacing between icon and text */
}

.pagination {
    margin-top: 50px;
    text-align: center;
    color: #fff;
    font-size: 18px;
}

.pagination button {
    background-color: #007bff;
    color: #fff;
    font-size: 18px;
    border: none;
    border-radius: 4px;
    padding: 10px 18px;
    cursor: pointer;
    margin: 0 5px;
}

.pagination button:hover {
    background-color: #0056b3;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* On smaller screens, adjust the flex-basis */
@media (max-width: 1200px) {
    .property-item {
        flex-basis: 45%;
    }
}

@media (max-width: 768px) {
    .property-item {
        flex-basis: 90%; /* Full width on smaller screens */
    }
}

/* Footer Styles */
footer {
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    padding-top: 100px;
    padding-bottom: 20px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
}

.left-section,
.center-section,
.right-section {
    display: flex;
    align-items: center; 
    justify-content: center; 
}

.left-section {
    align-items: center;
    display: flex;
    padding-left: 20px;
}

.links-container {
    display: flex;
    margin-left: 20px; 
}

.left-section ul {
    display: flex;
    list-style-type: none;
}

.left-section ul li {
    margin-right: 20px;
}

.center-section {
    flex-grow: 0;
    flex-shrink: 1;
    flex-basis: auto;
    text-align: center;
    color: #004080;
    font-size: 12px;
    font-family: Arial, sans-serif;
    align-self: flex-end;
    margin-left: 10px;
}

.right-section {
    justify-content: flex-end;
    padding-right: 20px;

}

footer a {
    color: #004080;
    transition: color 0.3s;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    color: #DC143C; 
}

.right-section a {
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    margin-right: 20px; 
}

.right-section a:last-child {
    margin-right: 0; 
}

.right-section p {
    margin-right: 20px;
}

.social-media-links a:hover {
    color: #DC143C;
}

.fa-facebook-f, .fa-youtube, .fa-instagram {
    font-size: 32px; 
}

@media (max-width: 1200px) and (min-width: 768px) {
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .logo {
        margin-bottom: 20px; /* Add some space between the logo and nav */
    }

    nav ul {
        display: flex;
        justify-content: center;
        width: 100%; /* Ensure nav takes full width */
    }

    nav ul li {
        margin-bottom: 10px; /* Add space between each menu item */
    }

    nav ul li a {
        font-size: 18px; /* Adjust the font size */
    }

    .search-filters {
        width: 85%;
    }

    main .search-filters {
        width: 70%; /* Take up more width as screen size decreases */
    }

    footer {
        flex-wrap: wrap; /* Allow sections to wrap onto new lines */
    }

    .right-section {
        order: 1; /* Show the right section first */
    }

    .center-section {
        order: 2; /* Show the center section after the right section */
        margin-left: 0; /* Remove the left margin */
        margin-bottom: 20px;
    }

    .left-section {
        order: 0; /* Left section stays first */
    }

    /* Move the center-section to a new line */
    .center-section {
        width: 100%; /* Take full width */
        text-align: center; /* Center the text */
        margin-top: 20px; /* Add some space above the center section */
    }
}

/* For screens 768px - 500px */
@media (max-width: 768px) and (min-width: 500px) {
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        margin-left: 0; /* Ensure logo aligns to the left */
        max-width: 300px;
        height: auto;
    }

        /* Show the burger menu and hide the navigation list */
        .menu-toggle {
            display: flex; /* Show the burger menu button */
            background: none; /* Remove any background color */
            border: none; /* Remove any borders */
            outline: none; /* Remove any focus outline */
            padding: 0; /* Remove any default padding */
            box-shadow: none; /* Remove any box shadow */
        }

        .menu-toggle::before {
            content: "Menu";
            margin-right: 10px;
        }
    
        /* Hide the nav list by default on smaller screens */
        nav ul {
            display: none; /* Hidden initially */
        }
    
        /* Show the nav list when the burger menu is clicked */
        .show-menu {
            display: flex; /* Display the dropdown when .show-menu is active */
            flex-direction: column;
            position: absolute;
            top: 100px; /* Ensure it's below the header */
            right: 0;
            background-color: white;
            width: 100%; /* Full width dropdown */
            text-align: right;
            padding: 10px 0;
        }
    
        nav ul li {
            margin: 10px 20px;
        }
    

    /* Stack the filter groups vertically */
    .filter-group.select-property-type,
    .filter-group.select-min-price,
    .filter-group.select-max-price,
    .filter-group.select-bedrooms,
    .filter-group.select-bathrooms,
    .filter-group.select-garages {
        flex-basis: 100%;
        margin-right: 0;
    }

    .search-filters {
        width: 95%;
    }

    main .search-filters {
        width: 80%; /* Almost full width on smaller screens */
    }

    /* Adjustments for checkbox group */
    .checkbox-group {
        justify-content: space-between;
    }

        /* Stack footer sections vertically */
        footer {
            flex-direction: column;
            text-align: center;
            align-items: center; /* Ensure everything is centered */
            padding: 20px 0; /* Add some vertical padding for consistency */
        }
    
        .left-section,
        .center-section,
        .right-section {
            justify-content: center; /* Center align each section */
            align-items: center; /* Vertically center items within each section */
            width: 100%; /* Make each section take full width to center contents */
            margin-bottom: 20px; /* Consistent spacing between sections */
            padding: 0; /* Remove any extra padding */
        }
    
        .right-section {
            order: 1; /* Show the right section first */
        }
    
        .center-section {
            order: 2; /* Show the center section after the right section */
            margin-left: 0; /* Remove the left margin */
            margin-bottom: 20px;
        }
    
        .left-section {
            order: 0; /* Left section stays first */
        }
    
        .right-section p {
            display: none; /* Hide "Follow us on social media" */
        }
    
        .links-container {
            justify-content: center;
            margin-left: 0;
        }
    
        .right-section a {
            margin-right: 15px;
        }
}


@media (max-width: 500px) {

    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        margin-left: 0; /* Ensure logo aligns to the left */
        max-width: 200px;
        height: auto;
    }

    /* Hide the nav by default and use the burger menu */
    /* Show the burger menu and hide the navigation list */
    .menu-toggle {
        display: flex; /* Show the burger menu button */
    }

    .menu-toggle::before {
        content: "Menu";
        margin-right: 10px;
    }

    /* Hide the nav list by default on smaller screens */
    nav ul {
        display: none; /* Hidden initially */
    }

    /* Show the nav list when the burger menu is clicked */
    .show-menu {
        display: flex; /* Display the dropdown when .show-menu is active */
        flex-direction: column;
        position: absolute;
        top: 60px; /* Ensure it's below the header */
        right: 0;
        background-color: white;
        width: 100%; /* Full width dropdown */
        text-align: right;
        padding: 10px 0;
    }

    nav ul li {
        margin: 10px 20px;
    }


    .search-section h2 {
        font-size: 35px;
    }

    .featured-properties h3 {
        font-size: 35px;
    }

        /* Stack the filter groups vertically */
        .filter-group.select-property-type,
        .filter-group.select-min-price,
        .filter-group.select-max-price,
        .filter-group.select-bedrooms,
        .filter-group.select-bathrooms,
        .filter-group.select-garages {
            flex-basis: 100%;
            margin-right: 0;
        }
    
        .search-filters {
            width: 95%;
        }
    
        main .search-filters {
            width: 80%; /* Almost full width on smaller screens */
        }
    
        /* Adjustments for checkbox group */
        .checkbox-group {
            justify-content: space-between;
        }

    footer {
        flex-direction: column;
        text-align: center;
        align-items: center; /* Ensure everything is centered */
        padding: 20px 0; /* Add some vertical padding for consistency */
    }

    .left-section,
    .center-section,
    .right-section {
        justify-content: center; /* Center align each section */
        align-items: center; /* Vertically center items within each section */
        width: 100%; /* Make each section take full width to center contents */
        margin-bottom: 20px; /* Consistent spacing between sections */
        padding: 0; /* Remove any extra padding */
    }

    .right-section {
        order: 1; /* Show the right section first */
    }

    .center-section {
        order: 2; /* Show the center section after the right section */
        margin-left: 0; /* Remove the left margin */
        margin-bottom: 20px;
    }

    .left-section {
        order: 0; /* Left section stays first */
    }

    .right-section p {
        display: none; /* Hide "Follow us on social media" */
    }

    .links-container {
        justify-content: center;
        margin-left: 0;
    }

    .right-section a {
        margin-right: 15px;
    }
}

@media (max-width: 350px) {
    /* Shrink the logo gradually */
    .logo img {
        max-width: 150px; /* Limit the maximum width for very small screens */
        height: auto;
    }

    /* Show the burger menu and hide the navigation list */
    .menu-toggle {
        display: flex; /* Show the burger menu button */
    }

    .menu-toggle::before {
        display: none; /* Hide the "Menu" label */
    }

    /* Hide the nav list by default on smaller screens */
    nav ul {
        display: none; /* Hidden initially */
    }

    /* Show the nav list when the burger menu is clicked */
    .show-menu {
        display: flex; /* Display the dropdown when .show-menu is active */
        flex-direction: column;
        position: absolute;
        top: 60px; /* Ensure it's below the header */
        right: 0;
        background-color: white;
        width: 100%; /* Full width dropdown */
        text-align: right;
        padding: 10px 0;
    }

    nav ul li {
        margin: 10px 20px;
    }


        /* Stack the filter groups vertically */
        .filter-group.select-property-type,
        .filter-group.select-min-price,
        .filter-group.select-max-price,
        .filter-group.select-bedrooms,
        .filter-group.select-bathrooms,
        .filter-group.select-garages {
            flex-basis: 100%;
            margin-right: 0;
        }
    
        .search-filters {
            width: 95%;
        }
    
        main .search-filters {
            width: 80%; /* Almost full width on smaller screens */
        }
    
        /* Adjustments for checkbox group */
        .checkbox-group {
            justify-content: space-between;
        }

    footer {
        flex-direction: column;
        text-align: center;
        align-items: center; /* Ensure everything is centered */
        padding: 20px 0; /* Add some vertical padding for consistency */
    }

    .left-section,
    .center-section,
    .right-section {
        justify-content: center; /* Center align each section */
        align-items: center; /* Vertically center items within each section */
        width: 100%; /* Make each section take full width to center contents */
        margin-bottom: 20px; /* Consistent spacing between sections */
        padding: 0; /* Remove any extra padding */
    }

    .right-section {
        order: 1; /* Show the right section first */
    }

    .center-section {
        order: 2; /* Show the center section after the right section */
        margin-left: 0; /* Remove the left margin */
        margin-bottom: 20px;
    }

    .left-section {
        order: 0; /* Left section stays first */
    }

    .left-section img {
        display: none;
    }

    .right-section p {
        display: none; /* Hide "Follow us on social media" */
    }

    .links-container {
        justify-content: center;
        margin-left: 0;
    }

    .right-section a {
        margin-right: 15px;
    }
}