:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --text: #1f2937;
    --muted: #5f6b7a;
    --border: #dde4ef;
    --primary: #0b63f3;
    --secondary: #0f172a;
    --success: #22a35a;
    --danger: #dc3f4f;
    --shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

:root.dark {
    --bg: #0b1220;
    --surface: #0f172a;
    --surface-soft: #182235;
    --text: #e5ecf7;
    --muted: #9ca8bc;
    --border: #273349;
    --primary: #4993ff;
    --secondary: #dce8ff;
    --success: #36c977;
    --danger: #f26270;
    --shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1140px, calc(100% - 2rem));
    margin: 0 auto;
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.site-header {
    margin: 1.5rem auto 1.25rem;
    border-radius: 20px;
    color: #ffffff;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.25));
}

.header-inner {
    position: relative;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.profile-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

.office-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.4rem;
}

.profile-text h1 {
    margin: 0;
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    line-height: 1.2;
}

.profile-text p {
    margin: 0.5rem 0 0;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.92);
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.btn {
    border: none;
    background: var(--primary);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.94rem;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.section-heading {
    margin: 1rem 0 0.8rem;
    font-size: 1.35rem;
    color: var(--secondary);
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.property-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.property-card:hover {
    transform: translateY(-3px);
}

.property-cover {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--surface-soft);
}

.property-content {
    padding: 1rem;
    display: grid;
    gap: 0.65rem;
    flex: 1;
}

.property-title {
    margin: 0;
    font-size: 1.06rem;
    color: var(--secondary);
    line-height: 1.35;
}

.property-summary {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.property-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.price-pill {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.88rem;
}


.location-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.listing-type-pill {
    background: color-mix(in srgb, var(--secondary) 12%, transparent);
    color: var(--secondary);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.85rem;
}
.property-card .btn {
    width: 100%;
    margin-top: 0.35rem;
}

.empty-card {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 1.1rem;
    color: var(--muted);
}

.footer-main {
    background: #d6dbe5;
    color: #1a2436;
    border-radius: 18px 18px 0 0;
    margin-top: 1.25rem;
}

.footer-main.dark-soft {
    background: #172236;
    color: #dfe7f7;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.3rem;
}

.contact-list,
.social-list {
    display: grid;
    gap: 0.6rem;
}

.contact-item,
.social-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    color: inherit;
    opacity: 0.95;
}

.social-links-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.social-item {
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    font-size: 0.9rem;
    transition: 0.2s ease;
}

.social-item:hover {
    background: rgba(255, 255, 255, 0.45);
}

.bottom-footer {
    background: #8e97a7;
    color: #ffffff;
    padding: 0.8rem 1.2rem;
    border-radius: 0 0 18px 18px;
    font-size: 0.9rem;
}

.bottom-footer a {
    color: #ffffff;
    text-decoration: underline;
}

.page-wrap {
    padding-bottom: 2.2rem;
}

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.2rem;
    background: var(--secondary);
    color: #ffffff;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 250;
}

.toast.show {
    opacity: 1;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(2, 6, 23, 0.68);
    z-index: 300;
    padding: 1rem;
}

.modal.active {
    display: grid;
}

.modal-card {
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    width: min(96vw, 520px);
    border: 1px solid var(--border);
    padding: 1rem;
    position: relative;
}

.modal-card.wide {
    width: min(95vw, 980px);
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    position: absolute;
    right: 0.75rem;
    top: 0.55rem;
    cursor: pointer;
}

.qr-image {
    width: 240px;
    height: 240px;
    margin: 1rem auto;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    object-fit: contain;
}

/* Property detail page */
.detail-hero {
    margin: 1rem auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-hero-inner {
    background: var(--primary);
    color: #ffffff;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.2rem;
}

.detail-hero-main h1 {
    margin: 0.55rem 0 0;
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    line-height: 1.3;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    font-size: 0.93rem;
}

.detail-agent {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-align: right;
}

.detail-agent img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.gallery {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: var(--shadow);
}

.gallery-main {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--surface-soft);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.gallery-arrow.left {
    left: 0.6rem;
}

.gallery-arrow.right {
    right: 0.6rem;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.gallery-thumbs button {
    border: 2px solid transparent;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: transparent;
    aspect-ratio: 4 / 3;
}

.gallery-thumbs button.active {
    border-color: var(--primary);
}

.gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.info-panel {
    display: grid;
    gap: 0.8rem;
}

.info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: var(--shadow);
}

.info-box h3 {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    color: var(--muted);
}


.info-box p {
    margin: 0;
    white-space: pre-wrap;
}

.meta-list {
    display: grid;
    gap: 0.7rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.55rem;
}

.meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meta-row span {
    color: var(--muted);
    font-size: 0.92rem;
}

.meta-row strong {
    text-align: right;
}
.info-box .big-price {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
}

.eids-box {
    margin-top: 1rem;
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent);
    border-radius: 14px;
    padding: 1rem;
}

.eids-box h2 {
    margin: 0 0 0.7rem;
    font-size: 1.15rem;
}

.eids-meta {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}

.small-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.alert {
    background: color-mix(in srgb, var(--success) 13%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
    border-radius: 10px;
    padding: 0.75rem;
    color: var(--text);
}

@media (max-width: 900px) {
    .header-inner,
    .detail-hero-inner,
    .detail-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .detail-agent {
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(1140px, calc(100% - 1rem));
    }

    .site-header,
    .detail-hero {
        border-radius: 14px;
    }

    .header-inner {
        padding: 1.1rem;
    }

    .profile-wrap {
        flex-wrap: wrap;
    }

    .profile-photo {
        width: 74px;
        height: 74px;
    }

    .office-logo {
        width: 68px;
        height: 68px;
    }

    .section-heading {
        font-size: 1.15rem;
    }

    .bottom-footer {
        font-size: 0.84rem;
    }
}




