/* --- 1. GLOBAL RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #F0EDE8;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    color: #1e293b;
}

#site-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#map {
    position: relative;
    flex-grow: 1;
    height: 100%;
    width: 100%;
}

/* --- 2. LEFT SIDEBAR (Property List/Detail) --- */
#sidebar {
    width: 0;
    height: 100%;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 0px solid #E8E4DE;
    z-index: 10;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-right-width 0.35s;
    overflow: hidden;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
}

#sidebar.active {
    width: 600px;
    border-right-width: 1px;
}

#sidebar.expanded {
    width: 1200px;
    border-right-width: 1px;
}

#sidebar-content-wrapper {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

#sidebar.expanded #sidebar-content-wrapper {
    transform: translateX(-50%);
}

.sidebar-page {
    width: 50%;
    height: 100%;
    overflow-y: auto;
}

/* --- 3. BACK BUTTON --- */
.back-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #F7F5F2;
    border: none;
    border-bottom: 1px solid #E8E4DE;
    color: #0d9488;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.back-btn:hover {
    background: #EEF9F8;
}

/* --- 4. MOBILE OVERRIDES --- */
@media (max-width: 767px) {
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 0;
        z-index: 2000;
        background: #FFFFFF;
        transition: height 0.35s ease;
        border-right: none !important;
    }

    #sidebar.active,
    #sidebar.expanded {
        height: 50vh !important;
        width: 100vw !important;
    }

    #sidebar-content-wrapper {
        display: flex !important;
        width: 200% !important;
    }

    .sidebar-page {
        width: 50% !important;
        padding: 0 !important;
    }

    #property-list {
        width: 100% !important;
    }

    .house-card {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-shrink: 0 !important;
        margin: 0 0 1px 0 !important;
        padding: 15px !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    .house-info {
        flex: 1 !important;
        min-width: 0;
    }
}

/* --- 5. UI COMPONENTS --- */
.house-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #FAFAF8;
    border-radius: 10px;
    border: 1px solid #E8E4DE;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.house-card:hover {
    border-color: #0d9488;
    background: #F0FDF9;
    box-shadow: 0 2px 8px rgba(13,148,136,0.12);
}

.house-address {
    color: #1e293b;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.house-price {
    color: #0d9488;
    font-weight: 800;
    font-size: 19px;
}

.house-attribution {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 8px;
}

.house-card img {
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #E8E4DE;
}


/* --- 7. SKELETON LOADING --- */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #EDE9E3 25%, #E0DBD4 50%, #EDE9E3 75%);
    background-size: 1200px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}

/* --- 7a. METHODOLOGY LINK (trust surface, always visible) --- */
#methodology-link {
    position: absolute;
    bottom: 24px;
    right: 16px;
    z-index: 100;
    font-size: 11px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #E8E4DE;
    border-radius: 8px;
    padding: 5px 10px;
    text-decoration: none;
}
#methodology-link:hover { color: #0d9488; }

/* --- 7b. SEARCH BOX (dual-intent: address or area) --- */
#search-box {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 110;
    width: min(360px, calc(100vw - 32px));
}

/* --- 8. FILTER BAR --- */
#filter-bar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.filter-group {
    position: relative;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #FFFFFF;
    border: 1.5px solid #E8E4DE;
    border-radius: 24px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.filter-pill:hover {
    border-color: #1e293b;
}

.filter-pill.active {
    background: #0d9488;
    border-color: #0d9488;
    color: #FFFFFF;
}

.filter-pill.active .pill-chevron {
    color: rgba(255,255,255,0.8);
}

.filter-pill.open {
    border-color: #1e293b;
}

#pill-price {
    min-width: 155px;
    justify-content: space-between;
}

.pill-chevron {
    font-size: 10px;
    color: #94a3b8;
    line-height: 1;
}

.filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #FFFFFF;
    border: 1px solid #E8E4DE;
    border-radius: 16px;
    padding: 20px;
    min-width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 200;
}

.filter-dropdown.open {
    display: block;
}

.dropdown-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 14px;
}

/* Price histogram + slider */
#dropdown-price {
    min-width: 300px;
}

#price-histogram {
    display: block;
    width: 100%;
    height: 56px;
    margin-bottom: 4px;
}

.price-slider-wrap {
    position: relative;
    height: 28px;
    margin: 0 0 6px;
}

.price-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    height: 3px;
    background: #E0DBD4;
    border-radius: 2px;
    pointer-events: none;
}

.price-track-fill {
    position: absolute;
    height: 100%;
    background: #1e293b;
    border-radius: 2px;
}

input[type="range"].price-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
    outline: none;
}

input[type="range"].price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 22px;
    height: 22px;
    background: #FFFFFF;
    border: 2px solid #1e293b;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 1px 5px rgba(0,0,0,0.18);
    transition: border-color 0.12s, transform 0.1s;
}

input[type="range"].price-range::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
    border-color: #0d9488;
}

input[type="range"].price-range::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    background: #FFFFFF;
    border: 2px solid #1e293b;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 1px 5px rgba(0,0,0,0.18);
    box-sizing: border-box;
}

.price-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

/* Type checkboxes */
.type-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    transition: background 0.12s;
}

.type-option:hover {
    background: #F7F5F2;
}

.type-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0d9488;
    cursor: pointer;
    flex-shrink: 0;
}

/* Step buttons (beds/baths) */
.step-options {
    display: flex;
    gap: 6px;
}

.step-btn {
    flex: 1;
    padding: 9px 4px;
    background: #FFFFFF;
    border: 1.5px solid #E8E4DE;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    white-space: nowrap;
}

.step-btn:hover {
    border-color: #1e293b;
}

.step-btn.active {
    background: #1e293b;
    border-color: #1e293b;
    color: #FFFFFF;
}

/* Dropdown footer */
.dropdown-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #F0EDE8;
}

.dropdown-clear {
    background: none;
    border: none;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dropdown-clear:hover {
    color: #1e293b;
}

.dropdown-apply {
    padding: 9px 20px;
    background: #1e293b;
    border: none;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-apply:hover {
    background: #0d9488;
}

/* --- 9. AUTH WIDGET --- */
#auth-widget {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
}

.auth-signin-btn {
    padding: 10px 18px;
    background: #FFFFFF;
    border: 1.5px solid #E8E4DE;
    border-radius: 24px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: border-color 0.15s;
}

.auth-signin-btn:hover {
    border-color: #1e293b;
}

.auth-avatar-wrap {
    position: relative;
}

.auth-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    padding: 0;
    cursor: pointer;
    background: #E8E4DE;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-avatar-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.auth-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-avatar-initials {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.auth-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E8E4DE;
    border-radius: 14px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 200;
}

.auth-dropdown.open {
    display: block;
}

.auth-dropdown-info {
    padding: 10px 12px 8px;
    border-bottom: 1px solid #F0EDE8;
    margin-bottom: 4px;
}

.auth-dropdown-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-dropdown-email {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-dropdown-btn {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.auth-dropdown-btn:hover {
    background: #F7F5F2;
}

.auth-dropdown-btn.danger {
    color: #e74c3c;
}

.auth-dropdown-btn.danger:hover {
    background: #FEF2F2;
}

/* --- 10. GATED SECTION --- */
.gated-section {
    position: relative;
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E8E4DE;
}

.gated-blurred {
    filter: blur(3px);
    user-select: none;
    pointer-events: none;
    opacity: 0.55;
    padding: 14px;
}

.gated-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.75) 35%,
        rgba(255,255,255,0.98) 100%
    );
}

.gated-prompt {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* When showing the gate with no blurred preview underneath */
.gated-section.no-preview .gated-prompt {
    position: relative;
    bottom: auto;
    padding: 28px 24px 32px;
}

.gated-lock {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 2px;
}

.gated-prompt h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.gated-prompt p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    max-width: 220px;
}

.gated-prompt-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.gated-cta-primary {
    padding: 10px 18px;
    background: #1e293b;
    border: none;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.15s;
}

.gated-cta-primary:hover {
    background: #0d9488;
}

.gated-cta-secondary {
    padding: 10px 18px;
    background: #FFFFFF;
    border: 1.5px solid #E8E4DE;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.15s;
}

.gated-cta-secondary:hover {
    border-color: #1e293b;
}

/* --- 11. DISCLOSURE CARDS --- */
.disc-card {
    background: #fff;
    border: 1px solid #E8E4DE;
    border-radius: 10px;
    margin: 0 0 8px 0;
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.disc-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.disc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}
.disc-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.disc-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.disc-badge {
    color: #fff;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.disc-score {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}
.disc-summary {
    font-size: 12px;
    color: #94a3b8;
}
.disc-chevron {
    font-size: 11px;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: transform 0.2s;
    line-height: 1;
}
.disc-card.open .disc-chevron {
    transform: rotate(180deg);
}
.disc-body {
    display: none;
    border-top: 1px solid #F0EDE8;
    padding: 12px 14px;
}
.disc-card.open .disc-body {
    display: block;
}
.disc-map-hint {
    font-size: 11px;
    color: #0d9488;
    margin-top: 8px;
    font-weight: 500;
}

/* --- 12. SIDEBAR HEADER --- */
.sidebar-header {
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid #E8E4DE;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    background: #FFFFFF;
}
