/* Base Styles using user request */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
}

/* Container */
.map-container {
    width: 100%;
    background-image: url('../assets/images/Frame 224.png');
    background-size: cover;
    background-position: center;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.map-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.map-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.map-breadcrumb a:hover {
    color: #7c3aed;
}

/* Main Content */
.map-main-content {
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 20px;
}

/* Map Section */
.map-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    height: 600px;
    position: relative;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
    position: relative;
}

.map-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #dc2626;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-marker::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.map-marker-1 {
    top: 20%;
    left: 45%;
}

.map-marker-2 {
    top: 45%;
    left: 30%;
}

.map-marker-3 {
    top: 48%;
    left: 35%;
}

.map-marker-4 {
    top: 50%;
    left: 38%;
}

.map-marker-5 {
    top: 55%;
    left: 60%;
}

.map-popup {
    position: absolute;
    top: 15%;
    left: 42%;
    background: #fff;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 340px;
    max-width: 400px;
    z-index: 10;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.map-popup::before {
    content: "×";
    position: absolute;
    top: 5px;
    right: 11px;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    font-weight: 300;
    line-height: 1;
    transition: color 0.2s;
}

.map-popup::before:hover {
    color: #7c3aed;
}

.map-popup-image {
    width: 140px;
    height: 120px;
    background: #ddd;
    border-radius: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.map-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-popup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 20px;
}

.map-popup-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #2d3436;
    line-height: 1.3;
}

.map-popup-type {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 400;
}

.map-popup-price {
    font-size: 24px;
    font-weight: 700;
    color: #7c3aed;
}

/* Search Section */
.map-search-section {
    padding: 0;
    background: transparent;
    height: 100vh;
    overflow-y: auto;
    padding-right: 10px;
}

.map-search-section::-webkit-scrollbar {
    display: none;
}

/* For Firefox */
.map-search-section {
    scrollbar-width: none;
}

/* For IE and Edge */
.map-search-section {
    -ms-overflow-style: none;
}

.map-search-card {
    background: #fff;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    display: flow-root;
}

.map-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.map-search-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.map-search-icon {
    width: 24px;
    height: 24px;
}

.map-search-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.map-search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.map-search-input:focus {
    border-color: #7c3aed;
}

.map-search-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    width: 20px;
    height: 20px;
}

.map-price-range {
    margin-bottom: 20px;
}

.map-price-range-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.map-price-range-value {
    font-size: 14px;
    color: #666;
    text-align: right;
}

.map-price-range-value .highlight {
    color: #7c3aed;
    font-weight: 600;
}

.map-price-slider {
    width: 100%;
    height: 6px;
    background: #8b5cf6;
    border-radius: 10px;
    margin-top: 15px;
    position: relative;
}

.map-price-slider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.map-price-slider::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.map-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.map-filter-wrapper {
    position: relative;
}

.map-filter-button {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #d1d5db;
    border-radius: 50px;
    font-size: 14px;
    background: #fafafa;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4b5563;
    font-weight: 400;
}

.map-filter-button:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.map-filter-button svg {
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.map-filter-button:hover svg {
    color: #7c3aed;
}

.map-filter-button.active svg {
    transform: rotate(180deg);
}

.map-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: none;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    min-width: 200px;
}

.map-dropdown-menu.active {
    display: block;
    animation: map-fadeIn 0.2s ease;
}

@keyframes map-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.map-dropdown-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #4b5563;
    border-radius: 8px;
    margin-bottom: 2px;
}

.map-dropdown-option:hover {
    background: #f3f4f6;
    color: #111827;
}

.map-dropdown-option.selected {
    background: #f3f4f6;
    color: #111827;
    font-weight: 500;
}

.map-dropdown-header {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: center;
    border-radius: 12px 12px 0 0;
}

.map-select-all-container {
    display: flex;
    align-items: center;
    border: 1px solid #7c3aed;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.map-select-all-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.map-select-all-btn:hover {
    background: #f9fafb;
    color: #7c3aed;
}

.map-select-divider {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
}

.map-dropdown-option.with-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-dropdown-option .location-badge {
    font-size: 12px;
    color: #9ca3af;
}

.map-dropdown-search {
    padding: 8px 12px;
    margin: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    width: calc(100% - 24px);
    outline: none;
}

.map-dropdown-search:focus {
    border-color: #7c3aed;
}

.map-search-button {
    width: auto;
    padding: 4px 4px 4px 20px;
    background: #ede9fe;
    color: #7c3aed;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    float: right;
    margin-left: auto;
}

.map-search-btn-icon {
    width: 44px;
    height: 44px;
    background: #7c3aed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.map-search-button:hover {
    background: #ddd6fe;
}

.map-results-count {
    font-size: 14px;
    color: #666;
    margin: 20px 0;
}

/* Property Cards */
.map-property-card {
    background: rgba(255, 255, 255, 0.355);
    border-radius: 24px;
    border: 2px solid rgba(119, 136, 153, 0.359);
    padding: 9px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 170px;
    margin-bottom: 5px;
}

.map-card-content {
    display: flex;
    gap: 24px;
    align-items: center;
}

.map-image-container {
    position: relative;
    flex-shrink: 0;
    width: 240px;
    height: 170px;
    border-radius: 16px;
    overflow: hidden;
}

.map-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.map-badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.map-badge-featured {
    color: #27ae60;
    background-color: #ffffffba;
}

.map-badge-for-sale {
    color: #e74c3c;
    background-color: #ffffffba;
}

.map-badge-for-rent {
    color: #3498db;
    background-color: #ffffffba;
}

.map-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #000;
    transition: all 0.2s;
    z-index: 10;
}

.map-nav-button:hover {
    background: rgba(255, 255, 255, 0.6);
}

.map-nav-button-prev {
    left: 10px;
}

.map-nav-button-next {
    right: 10px;
}

.map-image-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    z-index: 10;
}

.map-divider {
    height: 1px;
    background-color: #cecfd1f0;
    margin: 4px 0;
    width: 100%;
}

.map-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.map-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3436;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #636e7293;
    font-size: 16px;
    min-width: 0;
}

.map-location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    color: #636e72ed;
}

.map-location-icon {
    width: 20px;
    height: 20px;
    color: #6c5ce7;
}

.map-features {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.map-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #636e727e;
    font-size: 15px;
}

.map-feature svg {
    width: 20px;
    height: 20px;
    color: #6c5ce7;
}

/* Card footer */
.map-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-price {
    font-size: 20px;
    font-weight: 700;
    color: #6c5ce7;
}

.map-view-detail-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: none;
    color: #2d3436;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.map-arrow-icon {
    width: 36px;
    height: 36px;
    background: #6c5ce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transform: rotate(-40deg);
}

/* Pagination */
.map-pagination {
    margin-top: 30px;
    padding-bottom: 20px;
}

.custom-pagination-wrapper {
    width: 100%;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pagination-info span {
    font-weight: 600;
    color: #111;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 8px;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #7c3aed;
}

.pagination-btn.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}

.pagination-btn.arrow {
    padding: 0;
    width: 36px;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.pagination-dots {
    color: #9ca3af;
    padding: 0 4px;
}

@media (max-width: 640px) {
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }

    .pagination-info {
        order: 2;
    }

    .pagination-nav {
        order: 1;
        justify-content: center;
    }
}

.map-results-count {
    margin: 20px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    text-align: left;
    padding-left: 5px;
}

/* Ensure no oversized icons in pagination */
.map-pagination svg,
.map-pagination [role="navigation"] svg,
.map-pagination nav svg {
    max-width: 20px !important;
    max-height: 20px !important;
}

/* Responsive Breakpoints */

/* Large Tablets and Small Desktops - 1024px */
@media (max-width: 1024px) {
    .map-main-content {
        grid-template-columns: 1fr 500px;
        gap: 15px;
    }

    .map-container {
        padding: 15px;
    }

    .map-search-card {
        padding: 20px;
    }

    .map-filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets - 968px */
@media (max-width: 968px) {
    .map-main-content {
        grid-template-columns: 1fr;
    }

    .map-section {
        height: 400px;
        order: 2;
    }

    .map-search-section {
        order: 1;
        height: auto;
        max-height: 80vh;
    }
}

/* Mobile Landscape and Small Tablets - 768px */
@media (max-width: 768px) {
    .map-popup {
        left: 50%;
        transform: translateX(-50%);
        top: 10%;
        min-width: auto;
        width: calc(100% - 40px);
        max-width: 340px;
        padding: 16px;
        gap: 12px;
    }

    .map-container {
        padding: 10px;
    }

    .map-breadcrumb {
        font-size: 12px;
    }

    .map-search-card {
        padding: 20px 15px;
        border-radius: 20px;
    }

    .map-search-input {
        font-size: 13px;
    }

    .map-filter-button {
        font-size: 12px;
        padding: 10px 15px;
    }

    .map-filters-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .map-property-card {
        min-height: auto;
    }

    .map-card-content {
        flex-direction: column;
        gap: 16px;
    }

    .map-image-container {
        width: 100%;
        height: 200px;
    }

    .map-details {
        gap: 12px;
    }

    .map-footer {
        flex-direction: row;
        gap: 12px;
    }

    .map-pagination {
        padding: 15px 0;
    }

    .pagination-btn {
        min-width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .pagination-btn.arrow {
        font-size: 20px;
    }
}

/* Mobile - 640px */
@media (max-width: 640px) {
    .map-search-header h2 {
        font-size: 18px;
    }

    .map-search-button {
        padding: 3px 3px 3px 15px;
        font-size: 14px;
    }

    .map-search-btn-icon {
        width: 38px;
        height: 38px;
    }

    .map-section {
        height: 300px;
    }

    .map-popup {
        min-width: 15px;
        padding: 10px;
    }

    .map-badges {
        left: 10px;
        top: 10px;
    }

    .map-badge {
        font-size: 9px;
        padding: 3px 5px;
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    .map-container {
        padding: 8px;
    }

    .map-search-card {
        padding: 15px;
    }

    .map-property-card {
        padding: 12px;
    }

    .map-title {
        font-size: 16px;
    }

    .map-location {
        font-size: 14px;
    }

    .map-features {
        gap: 12px;
    }

    .map-feature {
        font-size: 13px;
    }

    .map-price {
        font-size: 18px;
    }

    .map-view-detail-btn {
        font-size: 12px;
    }

    .map-arrow-icon {
        width: 30px;
        height: 30px;
    }

    .map-pagination {
        padding: 12px 0;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .pagination-btn.arrow {
        font-size: 18px;
        min-width: 32px;
        height: 32px;
    }

    .map-filter-button {
        font-size: 11px;
        padding: 8px 12px;
    }
}

/* Extra Small Mobile - 360px */
@media (max-width: 360px) {
    .map-search-header h2 {
        font-size: 16px;
    }

    .map-search-card {
        padding: 12px;
    }

    .map-title {
        font-size: 14px;
    }

    .map-price {
        font-size: 16px;
    }

    .map-pagination {
        padding: 10px 0;
    }

    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .pagination-btn.arrow {
        min-width: 28px;
        height: 28px;
        font-size: 16px;
    }
}