@font-face {
    font-family: "IRANSansX";
    src: url("/assets/fonts/IRANSansX-Regular.woff2") format("woff2"),
         url("/assets/fonts/IRANSansX-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "IRANSansX";
    src: url("/assets/fonts/IRANSansX-Bold.woff2") format("woff2"),
         url("/assets/fonts/IRANSansX-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #172033;
    --muted: #64748b;
    --surface: rgba(255, 255, 255, .96);
    --line: #e2e8f0;
    --primary: #1d4ed8;
    --available: #16a34a;
    --occupied: #e11d48;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
    color: var(--ink);
    background: #dbeafe;
    font-family: "IRANSansX", Tahoma, Arial, sans-serif;
}

.map-shell, #map { width: 100%; height: 100%; }
#map { position: fixed; inset: 0; z-index: 1; }
#map img.leaflet-tile { max-width: none; width: 256px; height: 256px; }
.leaflet-container { font-family: "IRANSansX", Tahoma, Arial, sans-serif; }

.map-toolbar {
    position: fixed;
    right: auto;
    bottom: 18px;
    left: 18px;
    z-index: 1000;
    width: min(280px, calc(100vw - 36px));
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
    backdrop-filter: blur(14px);
}
.map-toolbar.collapsed { width: 178px; border-radius: 12px; }
.toolbar-toggle {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border: 0;
    border-radius: inherit;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.toolbar-arrow { color: var(--primary); font-size: 20px; line-height: 1; transition: transform .2s ease; }
.map-toolbar:not(.collapsed) { padding: 14px; }
.map-toolbar:not(.collapsed) .toolbar-toggle { padding: 0 0 10px; border-radius: 0; border-bottom: 1px solid var(--line); }
.map-toolbar:not(.collapsed) .toolbar-arrow { transform: rotate(180deg); }
.toolbar-content[hidden] { display: none; }

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.toolbar-title h1 { margin: 0 0 4px; font-size: 16px; }
.toolbar-title p { margin: 0; color: var(--muted); font-size: 12px; }
.toolbar-title .seo-lead { margin-bottom: 3px; line-height: 1.7; }
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f766e);
}

.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.filters label span {
    display: block;
    margin: 0 4px 6px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}
.filters input, .filters select {
    width: 100%;
    height: 43px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    padding: 0 11px;
}
.filters input:focus, .filters select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.legend {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    color: #475569;
    font-size: 12px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-dot.available { background: var(--available); }
.legend-dot.occupied { background: var(--occupied); }

.map-theme { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: #475569; font-size: 12px; font-weight: 700; }
.map-theme label { white-space: nowrap; }
.map-theme select { min-width: 0; flex: 1; height: 34px; padding: 0 9px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }

.billboard-marker {
    position: relative;
    z-index: 0;
    isolation: isolate;
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .35);
}
.billboard-marker::before {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.9);
    animation: billboard-pulse 1.55s ease-out infinite;
}
.billboard-marker.available { background: var(--available); }
.billboard-marker.available::before { color: rgba(22, 163, 74, .75); background: rgba(22, 163, 74, .42); }
.billboard-marker.occupied { background: var(--occupied); }
.billboard-marker.occupied::before { color: rgba(225, 29, 72, .75); background: rgba(225, 29, 72, .42); }
@keyframes billboard-pulse {
    0% { opacity: .95; transform: translate(-50%, -50%) scale(.9); }
    70%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.7); }
}


.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    display: grid;
    width: 42px !important;
    height: 42px !important;
    place-items: center;
    border-radius: 50%;
    background: rgba(20, 184, 166, 0.14) !important;
    overflow: visible;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
}

.marker-cluster-small::before,
.marker-cluster-medium::before,
.marker-cluster-large::before {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(20, 184, 166, 0.26);
    border-radius: 50%;
    content: "";
    pointer-events: none;
    animation: cluster-pulse 1.9s ease-out infinite;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    position: relative;
    display: grid;
    width: 30px;
    height: 30px;
    margin: 0 !important;
    place-items: center;
    border: 2px solid rgba(255,255,255,.95);
    border-radius: 50%;
    color: #fff;
    background: #0f172a !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .25);
    font-family: inherit;
    font-weight: 800;
}


.marker-cluster span { line-height: 1; }
@keyframes cluster-pulse {
    0%, 35% { transform: scale(.82); opacity: .9; }
    75%, 100% { transform: scale(1.42); opacity: 0; }
}

.map-message {
    position: fixed;
    z-index: 1100;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    padding: 12px 18px;
    border-radius: 12px;
    color: #fff;
    background: #172033;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
    font-size: 13px;
}

.contact-button {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: grid;
    width: 108px;
    height: 108px;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 10px;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    color: #172033;
    background: linear-gradient(145deg, #fde047, #f59e0b);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .28), 0 0 0 6px rgba(255, 255, 255, .22);
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.contact-button:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15, 23, 42, .32), 0 0 0 7px rgba(255, 255, 255, .28); }
.contact-button:focus-visible { outline: 3px solid #facc15; outline-offset: 4px; }
.contact-dialog {
    width: min(430px, calc(100vw - 28px));
    padding: 24px;
    border: 0;
    border-radius: 22px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .34);
}
.contact-dialog::backdrop { background: rgba(15, 23, 42, .62); backdrop-filter: blur(5px); }
.contact-dialog-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #172033;
    font-size: 21px;
    cursor: pointer;
}
.contact-dialog-header { display: flex; align-items: center; padding-left: 30px; }
.contact-dialog h2 { margin: 3px 0 0; overflow: visible; white-space: nowrap; font-size: 16px; line-height: 1.6; letter-spacing: -.25px; }
.contact-dialog-intro { margin: 18px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.contact-list { display: grid; gap: 9px; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.contact-row div { display: grid; gap: 3px; }
.contact-row span { color: var(--muted); font-size: 10px; font-weight: 700; }
.contact-row strong { direction: ltr; color: var(--ink); font-size: 14px; letter-spacing: .3px; }
.contact-call { min-width: 58px; padding: 7px 10px; border-radius: 9px; color: #fff; background: #0f766e; text-align: center; text-decoration: none; font-size: 11px; font-weight: 800; }
.contact-call:hover { background: #115e59; }
.contact-website { display: block; margin-top: 18px; color: var(--primary); font-size: 13px; font-weight: 800; text-align: center; text-decoration: none; }
.contact-website:hover { text-decoration: underline; }

.billboard-dialog {
    display: flex;
    width: min(820px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    flex-direction: row;
    align-items: stretch;
    direction: rtl;
    padding: 0;
    border: 0;
    border-radius: 17px;
    overflow: auto;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .35);
}
.billboard-dialog::backdrop {
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(5px);
}
.dialog-close {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 23, 42, .75);
    font-size: 21px;
    cursor: pointer;
}
.dialog-image-wrap {
    display: grid;
    width: 52%;
    min-width: 300px;
    height: auto;
    min-height: 360px;
    flex: 0 1 52%;
    align-self: stretch;
    place-items: center;
    overflow: hidden;
    background: #e2e8f0;
}
.dialog-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--muted); font-size: 13px; }
.dialog-content { min-width: 0; flex: 1 1 48%; padding: 20px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; }
.dialog-heading h2 { margin: 3px 0 0; font-size: 20px; }
.status-badge { padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-badge.available { color: #166534; background: #dcfce7; }
.status-badge.occupied { color: #9f1239; background: #ffe4e6; }
.billboard-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 14px 0 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    overflow: hidden;
}
.billboard-details div { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.billboard-details div:nth-child(odd) { border-left: 1px solid var(--line); }
.billboard-details div:last-child { border-bottom: 0; }
.billboard-details .detail-address { grid-column: 1 / -1; border-left: 0; }
.billboard-details dt { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.billboard-details dd { margin: 0; line-height: 1.65; font-size: 12px; }

@media (max-width: 640px) {
    .contact-button { top: 10px; right: 10px; width: 92px; height: 92px; font-size: 9px; }
    .contact-dialog { padding: 20px 14px; }
    .contact-dialog h2 { font-size: 13px; letter-spacing: -.35px; }
    .map-toolbar { right: auto; bottom: 10px; left: 10px; width: min(280px, calc(100vw - 20px)); padding: 12px; border-radius: 16px; }
    .map-toolbar.collapsed { width: 178px; padding: 0; }
    .filters { grid-template-columns: 1fr; }
    .toolbar-title { margin-bottom: 11px; }
    .legend { margin-top: 10px; }
    .map-theme { justify-content: space-between; }
    .billboard-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); flex-direction: column; }
    .dialog-image-wrap { width: 100%; min-width: 0; height: 240px; min-height: 0; flex: 0 0 240px; }
    .dialog-content { padding: 14px; }
    .billboard-details { grid-template-columns: 1fr; }
    .billboard-details div:nth-child(odd) { border-left: 0; }
    .billboard-details div:last-child { border-bottom: 0; }
}
