/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    line-height: 1.6;
    font-size: clamp(14px, 4vw, 16px); /* Scales between 14px and 16px based on viewport width */
}

/* Header */
header {
    background-color: #5A189A;
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

header h1 {
    font-size: 1.75rem;
    margin: 0;
}

.auth-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-section button {
    background-color: #9B59B6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-section button:hover {
    background-color: #8E44AD;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background-color: #9B59B6;
    border-radius: 50px; /* Capsule shape */
    padding: 0.5rem 1rem;
    width: 300px; /* Adjust as needed */
}

.search-bar input {
    border: none;
    background: transparent;
    color: white;
    flex: 1;
    outline: none;
    font-size: 1rem;
}


.search-bar .search-icon {
    color: white;
    font-size: 1rem;
    cursor: pointer;
    background: transparent; /* No background shape */
}

.search-bar input::placeholder {
    color: white;
    opacity: 1; /* Optional: Makes it fully visible if needed */
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem;
    background-color: #f1f1f1;
}

.tab-button {
    background-color: #5A189A;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 150px;
    text-align: center;
}

.tab-button:hover {
    background-color: #451475;
}

.tab-button.active {
    background-color: #9B59B6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(0, 900px) minmax(160px, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Ad Boxes */
.ad-box {
    height: auto;
    min-height: 300px;
    max-height: 520px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    overflow: hidden;
}

.ad-content {
    text-align: center;
    padding: 1rem;
}

.ad-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 1rem;
    object-fit: contain; /* Ensure the image fits properly */
}

.ad-content h3 {
    font-size: 1.25rem;
    color: #333;
    margin: 0 0 0.5rem;
}

.ad-content p {
    font-size: 0.9375rem;
    color: #666;
    margin: 0 0 1rem;
}

.ad-cta {
    display: inline-block;
    background-color: #5A189A;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.ad-cta:hover {
    background-color: #451475;
}

/* Listings */
.listing-content {
    width: 100%;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.filters select,
.filters button {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 150px;
}

.filters button {
    background-color: #5A189A;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filters button:hover {
    background-color: #451475;
}

/* Branded Homes */
.branded-homes h2 {
    margin: 0 0 1rem;
    text-align: center;
}

.brand-box {
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.625rem;
}

/* Brand Buttons */
.brand-button {
    height: 100px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: white;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
}

.brand-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.brand-button img {
    width: 80px;
    max-height: 80px;
    object-fit: contain;
}

/* Listings Section */
#listings-new-projects,
#listings-sale,
#listings-rent,
#my-listings-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.9375rem;
}

/* Container for Dynamic Listings */
.listing-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* Individual Listing Box */
.listing-box {
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: white;
    padding: 0.9375rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 100%;
    overflow: hidden;
}

/* Image Container */
.listing-image-container {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
}

.listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure the image covers the container */
    border-radius: 5px;
}

/* Description Section */
.listing-description {
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
}

.listing-description h3 {
    margin: 0;
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: #333;
}

.listing-description p {
    margin: 0;
    color: #666;
    font-size: 0.9375rem;
    font-family: Arial, sans-serif;
    letter-spacing: normal;
    font-weight: normal;
}

/* Button Container */
.button-container {
    display: flex;
    gap: 0.625rem;
    margin-top: 0.625rem;
}

/* Contact Button */
.contact-button {
    background-color: #5A189A;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: default;
    transition: background-color 0.3s ease;
}

.contact-button:hover {
    background-color: #451475;
}

/* More Info Button */
.moreinfo-button {
    background-color: #9B59B6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.moreinfo-button:hover {
    background-color: #8E44AD;
}

/* Delete Button in My Listings */
.delete-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.625rem;
}

.delete-button:hover {
    background-color: #c0392b;
}

.edit-button {
    background-color: #9B59B6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.625rem;
}

.edit-button:hover {
    background-color: #8E44AD;
}

/* List Property Form */
#listPropertyForm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

#listPropertyForm label {
    font-weight: bold;
    color: #333;
}

#listPropertyForm input,
#listPropertyForm select,
#listPropertyForm textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

#listPropertyForm textarea {
    height: 100px;
    resize: vertical;
}

#listPropertyForm button {
    background-color: #5A189A;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#listPropertyForm button:hover {
    background-color: #451475;
}

/* About Us */
#about-us {
    text-align: center;
}

#about-us .founder-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

#about-us .founder-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
}

#about-us p {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .ad-box {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr minmax(0, 700px) 1fr;
    }
    .tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    .tab-button {
        min-width: 120px;
        padding: 0.4rem 0.8rem;
    }
    .listing-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .modal-content {
        width: 70%;
        max-height: 85vh;
    }
    .modal-images {
        height: auto;
        min-height: 200px;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .brand-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    .brand-button {
        height: 70px;
    }
    .brand-button img {
        width: 50px;
        max-height: 50px;
    }
    .tabs {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .tab-button {
        padding: 0.3rem 0.6rem;
        min-width: 100px;
        font-size: 0.9rem;
    }
    .filters {
        flex-direction: column;
    }
    .filters select, .filters button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    #listPropertyForm {
        max-width: 100%;
    }
    #listPropertyForm input, #listPropertyForm select, #listPropertyForm textarea {
        width: 100%;
    }
    .listing-box {
        min-width: 0;
    }
    .modal-content {
        width: 85%;
        max-height: 75vh;
    }
    .modal-images img {
        max-height: 250px;
    }
}

/* Modal Styles (for all modals, including access login) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Keep the semi-transparent overlay */
    backdrop-filter: blur(5px); /* Blurs the background behind the modal */
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden; /* Prevent scrolling within the modal container */
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    width: 800px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    filter: none; /* Just in case, but not needed with backdrop-filter */
    /* Custom scrollbar styling */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #5A189A transparent; /* For Firefox */
}

/* Custom scrollbar for WebKit browsers (Chrome, Safari) */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #5A189A;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #451475;
}

.modal-content h2 {
    margin-top: 0;
    color: #5A189A;
}

.modal-content p {
    margin: 0.5rem 0;
}

.modal-content label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

/* Adjusted styles for Access Login Modal inputs and button */
#accessLoginModal .modal-content input[type="text"],
#accessLoginModal .modal-content input[type="password"],
#accessLoginModal .modal-content button[type="submit"] {
    width: 200px; /* Match button width */
    height: 40px; /* Match button height */
    padding: 8px 12px; /* Consistent padding */
    margin: 5px 0; /* Vertical spacing */
    border: 1px solid #ccc; /* Match input border */
    border-radius: 4px; /* Match button rounding */
    font-size: 16px; /* Ensure text size is consistent */
    box-sizing: border-box; /* Include padding and border in width/height */
}

/* Ensure button styling matches */
#accessLoginModal .modal-content button[type="submit"] {
    background-color: #5A189A;
    color: white;
    border: none;
    cursor: pointer;
    width: 200px; /* Explicitly set to match inputs */
    height: 40px; /* Explicitly set to match inputs */
}

.modal-content button:hover {
    background-color: #451475;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.modal-images {
    position: relative;
    text-align: center;
    margin: 20px 0; /* Increased margin for better spacing */
    height: auto;
    min-height: 300px; /* Slightly increased min-height */
    max-height: 500px; /* Increased for larger images */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: transparent !important;
}

.modal-images img {
    max-width: 100%;
    max-height: 100%; /* Ensure the image fits within the max-height */
    width: auto;
    height: auto;
    object-fit: contain; /* Maintain aspect ratio without cropping */
    border-radius: 5px;
    position: absolute; /* Allow images to stack for carousel */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the image */
}

.modal-images .nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent !important; /* Force no background */
    color: #5A189A !important; /* Arrow color */
    border: none;
    padding: 0; /* Remove padding */
    width: 40px; /* Fixed width */
    height: 40px; /* Fixed height */
    line-height: 40px; /* Center the arrow vertically */
    text-align: center; /* Center the arrow horizontally */
    cursor: pointer;
    font-size: 24px; /* Arrow size */
    border-radius: 50%; /* Circular button */
    z-index: 10; /* Ensure the button is above the image */
}

.modal-images .nav-button.prev {
    left: 5px; /* Position close to the left edge */
}

.modal-images .nav-button.next {
    right: 5px; /* Position close to the right edge */
}

.modal-images .nav-button {
    background-color: rgba(90, 24, 154, 0.2) !important; /* Subtle purple background on hover */
}

/* Specific styles for smaller modals (contact, login, access login) */
#contactModal .modal-content,
#loginModal .modal-content,
#accessLoginModal .modal-content,
#forgotPasswordModal .modal-content {
    width: 400px;
    max-width: 90%;
}

#contactLeadForm,
#loginForm,
#accessLoginForm,
#forgotPasswordForm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#contactLeadForm label,
#loginForm label,
#accessLoginForm label,
#forgotPasswordForm label {
    font-weight: bold;
    color: #333;
}

#contactLeadForm input[type="text"],
#loginForm input,
#accessLoginForm input,
#forgotPasswordForm input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

/* Override with specific sizing for access login inputs */
#accessLoginForm input[type="text"],
#accessLoginForm input[type="password"] {
    width: 200px; /* Match button width */
    height: 40px; /* Match button height */
    padding: 8px 12px; /* Consistent padding */
    margin: 5px 0; /* Vertical spacing */
    border: 1px solid #ccc; /* Match input border */
    border-radius: 4px; /* Match button rounding */
    font-size: 16px; /* Ensure text size is consistent */
    box-sizing: border-box; /* Include padding and border in width/height */
}

#contactLeadForm button,
#loginForm button,
#accessLoginForm button,
#forgotPasswordForm button {
    background-color: #5A189A;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

#contactLeadForm button:hover,
#loginForm button:hover,
#accessLoginForm button:hover,
#forgotPasswordForm button:hover {
    background-color: #451475;
}

#accessLoginError {
    margin-top: 10px;
    font-size: 0.9em;
    color: red;
}

/* Blur Effect for Access Login Modal */
body.modal-active {
    overflow: hidden;
}


#accessLoginModal,
#accessLoginModal .modal-content,
.modal,
.modal-content {
    
    z-index: 1001; /* Keep it on top */
}

#accessLoginModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#accessLoginModal .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

/* Footer */
footer {
    background-color: #5A189A;
    color: white;
    padding: 1.25rem;
    text-align: center;
    margin-top: 2rem;
}

footer p {
    margin: 0;
}

/* Enhanced Responsiveness */
body { font-size: clamp(12px, 3vw, 16px); } /* Adjusted for smaller devices */

.header-content { flex-direction: row; flex-wrap: wrap; justify-content: center; }
@media (max-width: 768px) { .header-content { flex-direction: column; } .auth-section { position: static; margin-top: 10px; } }

.tabs { flex-wrap: wrap; gap: 0.5rem; }
.tab-button { flex: 1 1 100px; min-width: 0; font-size: clamp(0.8rem, 2.5vw, 1rem); }

.main-content { grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 769px) { .main-content { grid-template-columns: minmax(120px, 1fr) minmax(0, 70%) minmax(120px, 1fr); } }
@media (min-width: 1025px) { .main-content { grid-template-columns: minmax(160px, 1fr) minmax(0, 900px) minmax(160px, 1fr); } }

.ad-box { display: none; } /* Hide on mobile by default */
@media (min-width: 769px) { .ad-box { display: flex; } } /* Show on tablet+ */

.listing-container { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 768px) { .listing-container { grid-template-columns: 1fr; } }

.modal-content { width: 90%; max-width: 90vw; max-height: 80vh; }
@media (min-width: 769px) { .modal-content { width: 70%; max-width: 800px; } }

.listing-box { transition: transform 0.2s ease; }
.listing-box:hover { transform: scale(1.02); }

.property-details {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.property-details li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee; /* Subtle separator line */
    font-size: 1rem;
    color: #333;
}

.property-details li strong {
    color: #5A189A; /* Matches your site's purple theme */
}

.property-details a {
    color: #9B59B6; /* Link color to match theme */
    text-decoration: underline;
}

.property-details a:hover {
    color: #451475;
}

#cookie-consent {
    background: #5A189A !important; /* Purple background */
    color: #fff !important;
}

#cookie-consent button {
    background: #9B59B6;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#cookie-consent button:hover {
    background: #8E44AD;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.contact-us {
    margin-top: 20px;
    text-align: center;
}

.contact-us .contact-button {
    background-color: #5A189A;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.625rem 1.25rem;
    cursor: default;
    transition: background-color 0.3s ease;
    font-size: 1rem;
}

.contact-us .contact-button:hover {
    background-color: #451475;
}

.contact-us p {
    margin: 10px 0 0;
    color: #333;
}

.contact-us a {
    color: #9B59B6;
    text-decoration: none;
}

.contact-us a:hover {
    color: #451475;
    text-decoration: underline;
}

/* Footer Link Styles */
footer a {
    color: white; /* Makes the link white to match the text */
    text-decoration: none; /* No underline by default for a clean look */
}

footer a:hover {
    text-decoration: underline; /* Underline on hover for better interaction */
    color: #E0BBE4; /* A light purple shade for hover—feels premium and matches your theme */
}

/* Hide New Residential Projects tab button and content */
.tab-button[onclick="showTab('new-projects')"] {
    display: none;
}
#new-projects {
    display: none;
}

/* Hide duplicate Sale button */
.tab-button[onclick="showTab('sale')"]:nth-child(2) {
    display: none;
}