/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 1.6;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.item {
    font-family: Verdana, sans-serif;
    font-size: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    text-decoration: none;
    transition: color 0.3s ease;
}

.item:hover {
    color: blue;
}

.item img {
    max-width: 100%;
    height: auto;
}

/* Main Section */
main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

.container {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 4fr 2fr 2fr 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    gap: 30px;
    align-items: center;
    justify-items: center;
    padding: 0 20px;
}

/* Container 2 (Hero Section) */
.container2 {
    background-image: url("../images/house5.jpg");
    background-size: cover;
    background-position: center;
    height: 400px;
    width: 100%;
    font-size: 70px;
    font-family: Georgia, "Gotham", "Helvetica Neue", Helvetica, Arial, "sans-serif";
    letter-spacing: -1px;
    color: #FFFFFF;
    text-align: center;
    vertical-align: top;
    font-weight: 900;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
}

/* Location of header inside background */
.item1_header {
    grid-column-start: 3;
    grid-column-end: 7;
    grid-row-start: 2;
    grid-row-end: 3;
}

/* Location of search box inside background */
.item2_searchbox {
    grid-column-start: 3;
    grid-column-end: 7;
    grid-row-start: 3;
    grid-row-end: 4;
    display: flex;
    justify-content: flex-start; /* Centers the search box */
}

/* Search Box */
.item2_searchbox form {
    display: flex;
    align-items: center;
}

.item2_searchbox input {
    padding: 14px 18px; /* Reduce padding slightly */
    font-size: 16px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    width: 400px;
    height: 50px;
    box-shadow: none; /* Remove box-shadow to align with button */
    outline: none;
    box-sizing: border-box;
}

.item2_searchbox input::placeholder {
    color: #999;
}

/* Search Button */
.item2_searchbox button {
    padding: 0;
    font-size: 18px;
    background-color: #FFFFFF;
    color: #000000;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    height: 50px;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.item2_searchbox button:hover {
    background-color: #908E8E;
}

.middlebody {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

/* Footer */
footer {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

footer p {
    margin: 0;
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1;
}

/* Dropdown Heading */
.dropdown-content h4 {
    padding: 10px 15px;
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #ddd;
}

/* Dropdown Links */
.dropdown-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-content ul li {
    padding: 10px 15px;
}

.dropdown-content ul li a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    display: block;
    transition: background-color 0.3s ease;
}

.dropdown-content ul li a:hover {
    background-color: #f8f9fa;
}

/* Show Dropdown on Hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Updated Controls Styling */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-arrow {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.nav-arrow:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.controls span {
    font-size: 16px;
}

/* Updated Grid Classes */
.trending-grid, .prev-viewed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Property Card */
.property-card {
    width: 100%;
    max-width: 290px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Image Container */
.property-card .image-container {
    width: 100% !important;
    height: 200px !important;
    overflow: hidden !important;
    position: relative !important;
}

.property-card .image-container a {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Image inside the container */
.property-card .image-container img {
    width: 100% !important;
    height: 200px !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
}

/* Ensure no scaling from parent */
.property-card, .property-card .image-container, .property-card .image-container img {
    max-width: none;
    min-width: 0;
}

/* Combined link styles with higher specificity */
.trending-homes .property-card a,
.trending-homes .property-card a:link,
.trending-homes .property-card a:visited,
.trending-homes .property-card a:hover,
.trending-homes .property-card a:active,
.previously-viewed .property-card a,
.previously-viewed .property-card a:link,
.previously-viewed .property-card a:visited,
.previously-viewed .property-card a:hover,
.previously-viewed .property-card a:active {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

/* Details */
.property-details {
    padding: 10px;
    text-align: left;
}

/* Responsive */
@media (max-width: 1260px) {
    .trending-homes, .previously-viewed {
        width: 100%;
        padding: 10px;
    }
    .trending-grid, .prev-viewed-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        max-width: 100%;
        padding: 0 10px;
    }
}

/* Text Styling */
.property-details h3 {
    font-size: 20px;
    margin: 0 0 5px;
    color: #333;
}

.price-with-openhouse {
    font-size: 20px;
    margin: 0 0 10px;
    display: flex;
    align-items: baseline;
    color: #333;
}

.price-with-openhouse .openhouse-text {
    font-size: 14px;
    color: red;
    font-weight: normal;
    margin-left: 5px;
    white-space: nowrap;
}

.property-details p {
    font-size: 14px;
    margin: 3px 0;
    color: #555;
}

.property-details p.small-text {
    font-size: 7px;
    line-height: 1.1;
    margin: 0;
}

/* Services Grid (3 Cards per row) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Service Card */
.service-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.service-card h3 {
    font-size: 24px;
    margin: 15px 0 10px;
}

.service-card p {
    font-size: 16px;
    color: #555;
    padding: 0 15px;
    margin: 0 0 15px;
}

.service-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background-color: #007bff;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.service-button:hover {
    background-color: #0056b3;
}

/* Services Header */
.services-header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

.services-header h2 {
    grid-column: 1 / 4;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Search Container */
.search-container {
    position: relative;
    display: inline-block;
}

/* Input Styles */
.item2_searchbox .search-container input[type="text"] {
    padding: 14px 40px 14px 18px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    width: 430px;
    height: 50px;
    box-shadow: none;
    outline: none;
    box-sizing: border-box;
    background-color: #fff;
    position: relative;
    z-index: 1;
}

/* Remove this redundant rule since it’s overridden above */
.search-container input[type="text"] {
    flex: 1;
    border-right: none;
    height: 50px;
    box-sizing: border-box;
}

/* Clear Button */
.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #888;
    cursor: pointer;
    display: none;
    z-index: 10;
}

.clear-search:hover {
    color: #000;
}

.item2_searchbox .search-container input[type="text"]::placeholder {
    color: #999;
}

/* Search Button */
.item2_searchbox .search-container button {
    position: absolute;
    right: -60px;
    top: 0;
    transform: none;
    padding: 0;
    font-size: 18px;
    background-color: #fff;
    color: #000000;
    border: 1px solid #dddddd;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    height: 50px;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    z-index: 2;
}

.item2_searchbox .search-container button:hover {
    background-color: #908E8E;
}

.result-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    text-decoration: none;
    color: #000000;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.result-item:nth-child(odd) {
    background-color: #ffffff;
}

.result-item:nth-child(even) {
    background-color: #f5f5f5;
}

.image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 320px;
    flex-shrink: 0;
}

.result-item .image-container {
    position: relative;
    width: 300px !important;
    height: 200px !important;
    overflow: hidden;
}

.result-item .image-container img {
    width: 300px !important;
    height: 200px !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.result-item .photo-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.result-item .photo-nav i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    pointer-events: auto;
}

.result-item .photo-nav i:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.result-item .photo-nav .fa-chevron-left {
    left: 5px;
}

.result-item .photo-nav .fa-chevron-right {
    right: 5px;
}

.result-item .photo-nav .hidden {
    display: none;
}

.result-item .photo-info {
    font-size: 12px;
    color: #555;
    text-align: center;
    margin-top: 5px;
    width: 300px;
}

.result-item .photo-info i {
    margin-right: 5px;
}

.result-details {
    flex-grow: 1;
    font-size: 10px;
    margin-left: 5px;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1px;
    position: relative;
    top: -10px;
    width: 100%;
}

.result-details .property-grid {
    display: grid;
    grid-template-columns: 400px 150px 100px 100px 100px;
    grid-template-rows: auto auto;
    row-gap: 7px;
    column-gap: 5px;
    flex: 0 0 auto;
    width: 100%;
    max-width: 900px;
    overflow: visible;
}

.result-details .property-grid .grid-item {
    margin: 0;
}

.result-details .property-grid .grid-item p {
    margin: 0;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Specific positioning */
.result-details .property-grid .grid-item:nth-child(1) {
    grid-column: 1 / 2; /* Price */
    grid-row: 1 / 2;
}
.result-details .property-grid .grid-item:nth-child(2) {
    grid-column: 2 / 3; /* Status */
    grid-row: 1 / 2;
}
.result-details .property-grid .grid-item:nth-child(3) {
    grid-column: 5 / 6; /* DOM */
    grid-row: 1 / 2;
}
.result-details .property-grid .grid-item:nth-child(4) {
    grid-column: 1 / 2; /* Address */
    grid-row: 2 / 3;
}
.result-details .property-grid .grid-item:nth-child(5) {
    grid-column: 2 / 3; /* Taxes */
    grid-row: 2 / 3;
}
.result-details .property-grid .grid-item:nth-child(6) {
    grid-column: 5 / 6; /* HOA */
    grid-row: 2 / 3;
}

/* Allow Status and Address to wrap if needed */
.result-details .property-grid .grid-item:nth-child(2) p,
.result-details .property-grid .grid-item:nth-child(4) p {
    white-space: normal;
    overflow: visible;
}

/* Address Link Styling */
.result-details .property-grid .grid-item a {
    color: #2574bb;
    text-decoration: none;
}

.result-details .property-grid .grid-item a:hover {
    text-decoration: underline;
}

/* Middle Section */
.result-details .middle-section {
    flex: 0 0 90px;
    overflow: hidden;
}

.result-details .middle-row {
    display: grid;
    grid-template-columns: 120px 120px 120px 120px 120px;
    column-gap: 5px;
    margin: 0;
}

.result-details .middle-row:first-child {
    grid-template-columns: auto;
}

.result-details .middle-row .label {
    display: inline-block;
    white-space: nowrap;
    font-size: 10px;
    line-height: 2;
}

/* Bottom Section */
.result-details > p {
    flex: 1 1 70px;
    overflow: hidden;
    margin: 0;
    font-size: 10px;
    line-height: 1.1;
}

/* Adjust HR for minimal height */
.result-details hr {
    margin: 0;
    border: none;
    height: 1px;
    background-color: #ddd;
    flex: 0 0 1px;
}

/* Header Container */
.header-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.header-container h1 {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #555;
    display: inline;
}

.property-checkbox {
    margin-right: 10px;
    margin-top: 5px;
}

.select-all-checkbox {
    margin-right: 5px;
    vertical-align: middle;
}

/* Header Buttons */
.header-buttons {
    display: inline-flex;
    gap: 10px;
    margin-left: 20px;
}

.header-buttons button {
    padding: 5px 10px;
    font-size: 12px;
    background-color: #2574bb;
    color: #ffffff;
    border: 1px solid #2574bb;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.header-buttons button:hover {
    background-color: #21619B;
}

/* Favorite Heart Icon */
.favorite-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    fill: rgba(0, 0, 0, 0.6);
    stroke: white;
    stroke-width: 2px;
    cursor: pointer;
    transition: transform 0.2s ease, fill 0.3s ease;
}

.favorite-heart:hover {
    transform: scale(1.2);
    fill: rgba(0, 0, 0, 0.8);
}

/* Open House Box */
.open-house-box {
    position: absolute;
    top: 10px;
    left: 30px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 8px;
}

.pagination a {
    text-decoration: none;
    color: black;
    font-size: 16px;
    font-weight: bold;
    padding: 0 5px;
}

.pagination .current-page {
    font-size: 16px;
    font-weight: bold;
    padding: 0 5px;
    color: black;
    text-decoration: underline;
}

/* Disabled Arrow Styling */
.pagination .disabled {
    color: #ccc;
    pointer-events: none;
    cursor: default;
}

/* Options Section */
.options-section {
    width: 100%;
    background-color: #f8f8f8;
    padding: 20px 0;
    margin: 20px 0;
}

.options-section .options-container {
    display: flex;
    width: 1260px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    gap: 50px;
    box-sizing: border-box;
}

.option-box {
    text-align: center;
    width: 372px;
    padding: 30px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.3s;
    box-sizing: border-box;
    min-height: 150px;
}

.option-box:hover {
    background-color: #e0e0e0;
}

.option-link {
    text-decoration: none;
    color: #333;
}

.option-box h3 {
    margin: 0 0 15px;
    font-size: 1.8em;
}

.option-box p {
    margin: 0;
    font-size: 1.2em;
}

/* Responsive */
@media (max-width: 1260px) {
    .options-section .options-container {
        width: 100%;
        padding: 0 20px;
        gap: 20px;
    }
    .option-box {
        width: calc((100% - 40px) / 3);
        padding: 20px;
        min-height: 120px;
    }
}

/* Tooltip Styles */
.property-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.property-card .image-container .tooltip-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: red; /* Bright red to confirm visibility */
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
    pointer-events: none;
    display: block;
}

.property-card .image-container a:hover::after {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 3px !important;
    top: -30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    white-space: nowrap !important;
    z-index: 1001 !important;
    font-size: 12px !important;
    pointer-events: none !important;
    display: block !important;
}
/*Start custom tooltip with the modified URL:*/
.property-card .image-container .tooltip-link {
    position: relative !important;
    display: block !important;
}
.property-card .image-container .tooltip-link:hover .custom-tooltip {
    display: block !important;
}
.custom-tooltip {
    display: none !important;
    position: absolute !important;
    top: -40px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: red !important; /* Bright red to confirm */
    color: #fff !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    z-index: 9999 !important; /* High z-index */
}
/*End custom tooltip with the modified URL:*/
.trending-homes,
.previously-viewed {
    width: 1260px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Align controls with the first property card */
.trending-homes .controls.trending-controls,
.previously-viewed .controls.prev-viewed-controls {
    justify-content: flex-start; /* Align left instead of center */
    max-width: 1200px; /* Match grid width */
    width: 100%; /* Ensure full width within section */
    margin: 0 auto 20px auto; /* Center within 1260px section, keep bottom margin */
    padding-left: 0; /* Remove any padding offset */
}

/* Grid adjustments for consistency */
.trending-grid,
.prev-viewed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    justify-content: start; /* Ensure grid starts at left */
}

/* Align headers with arrows and first property card */
.trending-homes h2,
.previously-viewed h2 {
    font-size: 28px;
    margin-bottom: 20px;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    text-align: left;
}

.trending-homes .controls.trending-controls,
.previously-viewed .controls.prev-viewed-controls {
    justify-content: flex-start;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.trending-grid,
.prev-viewed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
/* Explore Cities section */
.explore-cities {
    width: 1260px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.explore-cities h2 {
    font-size: 28px;
    margin-bottom: 20px;
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    text-align: left;
}

.explore-cities .controls.explore-controls {
    justify-content: flex-start;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Responsive */
@media (max-width: 1260px) {
    .explore-cities {
        width: 100%;
        padding: 10px;
    }
    .explore-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        max-width: 100%;
        padding: 0 10px;
    }
}