/* Property Exchange design tokens — see tmp/design_bundle/property-exchange/project/Property Exchange App.html */

/* ---- Global reset (mirrors the reference HTML <style> block) ----
   Loaded AFTER Bootstrap / MantiqWebappUtilsStyle so these rules win. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

button {
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    color: inherit;
}

:root {
    /* ---------- Spacing scale (4px base) ----------
       Mirrors bins/erp/styles/tokens.css so shared preview crates that use
       `var(--space-N)` without fallbacks (e.g. property_listing/preview/view)
       render with the same rhythm in both binaries.
       TODO: replace this duplication with one of:
         (a) define --space-* on `.body` in the shared preview crate's CSS
             so it self-contains, or
         (b) promote tokens.css to a shared location both binaries import. */
    --space-0: 0;
    --space-1: 0.25rem; /* 4px */
    --space-2: 0.5rem; /* 8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem; /* 16px */
    --space-5: 1.25rem; /* 20px */
    --space-6: 1.5rem; /* 24px */
    --space-8: 2rem; /* 32px */
    --space-10: 2.5rem; /* 40px */
    --space-12: 3rem; /* 48px */

    --bg: #0a1220;
    --bg-2: #0f1a2d;
    --surface: #111d33;
    --surface-2: #152440;
    --surface-3: #1a2c4e;
    --border: #1f3560;
    --border-2: #2a4679;
    --text: #e8eef7;
    --text-dim: #8a9bb8;
    --text-mute: #5f7090;
    --accent: #1d9bf0;
    --accent-2: #3fb0ff;
    --accent-soft: rgba(29, 155, 240, 0.12);
    --accent-softer: rgba(29, 155, 240, 0.06);
    --gold: #c9a86b;
    --gold-dim: #8a7548;
    --good: #35d399;
    --warn: #f5b544;
    --danger: #ef5a6b;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 22px;
    --shadow-lg: 0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---- Leaflet dark overrides ---- */
.leaflet-container {
    background: #0a1220;
    font-family: var(--sans);
    outline: none;
}

.leaflet-control-attribution {
    background: rgba(10, 18, 32, 0.8) !important;
    color: #5f7090 !important;
    font-size: 9px !important;
}

.leaflet-control-attribution a {
    color: #8a9bb8 !important;
}

.leaflet-control-zoom {
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-control-zoom a {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--surface-2) !important;
    color: var(--accent) !important;
}

.leaflet-popup-content-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

.leaflet-popup-tip {
    background: var(--surface) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-close-button {
    display: none !important;
}

/* ---- Custom Leaflet markers ---- */
.px-marker {
    background: transparent;
    border: none;
}

.px-marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.25), 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.18s ease;
    position: relative;
}

.px-marker-dot.hovered {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 7px rgba(29, 155, 240, 0.25), 0 2px 12px rgba(0, 0, 0, 0.5);
}

.px-marker-dot.active {
    background: #fff;
    border-color: var(--accent);
    width: 22px;
    height: 22px;
    box-shadow: 0 0 0 8px rgba(29, 155, 240, 0.35), 0 2px 12px rgba(0, 0, 0, 0.5);
}

.px-marker-price {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-2);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.18s ease;
}

.px-marker-price.hovered,
.px-marker-price.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translate(-50%, calc(-50% - 2px));
}

/* ---- Scroll utilities ---- */
.scroll-area {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}

.scroll-area::-webkit-scrollbar {
    width: 8px;
}

.scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 4px;
}

/* ---- Animations ---- */
@keyframes px-fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.px-fade-up {
    animation: px-fadeUp 0.35s ease both;
}

@keyframes px-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.px-fade-in {
    animation: px-fadeIn 0.25s ease both;
}

/* ---- Media Exchange theme override ----
   Scoped to subtrees with [data-theme="media-exchange"]. The cinematic
   gold-on-near-black palette is intentionally distinct from the property
   exchange theme so visitors can instantly tell the two surfaces apart.
   Mirrors the design's :root block in
   tmp/design_bundle/media-exchange/project/Media Exchange App.html. */
[data-theme="media-exchange"] {
    --bg: #0a0a0e;
    --bg-2: #0f1014;
    --surface: #15161c;
    --surface-2: #1c1d25;
    --surface-3: #24252f;
    --border: #242530;
    --border-2: #323340;
    --text: #ecebe5;
    --text-dim: #a8a698;
    --text-mute: #6b6a60;
    --accent: #d9a54f;
    --accent-2: #e6b765;
    --accent-deep: #a77d30;
    --accent-soft: rgba(217, 165, 79, 0.12);
    --accent-softer: rgba(217, 165, 79, 0.06);
    --gold: #d9a54f;
    --gold-dim: #a77d30;
    --good: #5ed38d;
    --warn: #f5b544;
    --danger: #ef6a5a;
    background: #0a0a0e;
    color: #ecebe5;
}

/* ---- Exchange landing theme ----
   Light, editorial palette mirroring landing.jsx :root in
   /Downloads/the exchange/The Exchange.html. Scoped so it does not
   leak into the dark properties / media listing pages. */
[data-theme="exchange-landing"] {
    --bg: #ffffff;
    --bg-2: #f7f8fb;
    --bg-3: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f5f7fa;
    --surface-3: #eaeef4;
    --border: #e4e8ef;
    --border-2: #cbd2dd;
    --border-3: #a8b2c2;
    --text: #011f45;
    --text-dim: #4a5a76;
    --text-mute: #8a96aa;
    --blue: #5f9fe1;
    --blue-deep: #011f45;
    --brand-dark: #011f45;
    --brand-light: #5f9fe1;
    --gold: #b88838;
    --gold-deep: #8a6325;
    --copper: #a85d33;
    --copper-deep: #6f3d1f;
    --equitativa: #8c7340;
    --good: #2c8c52;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    background: #ffffff;
    color: #011f45;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
}

[data-theme="exchange-landing"] a {
    color: inherit;
    text-decoration: none;
}

[data-theme="exchange-landing"]::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(
        circle at 1px 1px,
        rgba(1, 31, 69, 0.025) 1px,
        transparent 0
    );
    background-size: 3px 3px;
    z-index: 1;
}

@keyframes xl-fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes xl-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes xl-shimmer {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@keyframes xl-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes xl-ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

