* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    overflow: hidden
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #0f172a;
    background: #f7fafc
}

.viewer {
    padding: 0
}

.map-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem
}

.map-container img#planImg {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .5rem
}

.map-container svg#mapSvg {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 1rem;
    bottom: 1rem;
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    pointer-events: auto
}

.region {
    fill: transparent;
    stroke: transparent;
    stroke-width: .35;
    transition: fill .15s ease, stroke .15s ease;
    cursor: pointer
}

.region:focus {
    outline: none;
    filter: drop-shadow(0 0 .5rem rgba(255, 255, 255, 0))
}

.region:hover {
    fill: transparent;
    stroke: transparent
}

#tooltip {
    position: absolute;
    pointer-events: none;
    background: #111827;
    color: #fff;
    padding: .35rem .5rem;
    border-radius: .375rem;
    font-size: .85rem;
    transform: translate(8px, -8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15)
}

.modal[aria-hidden="true"] {
    display: none
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .55)
}

.modal-dialog {
    position: relative;
    margin: 0;
    width: min(90vw, 900px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: .75rem;
    padding: 1rem 1rem 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25)
}

.modal-close {
    position: absolute;
    right: .5rem;
    top: .5rem;
    border-radius: 999px;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    font-size: 1.25rem
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0; /* allow child to size to container */
    /* pas d'overflow hidden, on bloque le scroll via JS pour la modale */
    overflow: auto;
    padding-right: 0
}

.modal-body img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: .5rem
}

/* Status badge in modal title */
.status-badge {
    display: inline-block;
    padding: .35rem .65rem;
    border-radius: .375rem;
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .025em;
    vertical-align: middle;
}

.status-badge.vendu {
    background: #dc2626;
    color: #fff;
    border: 2px solid #991b1b;
}

.status-badge.disponible {
    background: #16a34a;
    color: #fff;
    border: 2px solid #15803d;
}

@media (prefers-color-scheme:dark) {
    body {
        background: #0b1220;
        color: #dbeafe
    }

    .modal-dialog {
        background: #0f172a;
        color: #e2e8f0;
        border-color: #1e293b
    }

    .map-container img#planImg {
        background: #0f172a;
        border-color: #1f2937
    }

    #tooltip {
        background: #111827;
        color: #f8fafc
    }
}