/* 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;
}

/* Shared primary action button — orange, rounded. Reused across the exchange
   for the nav log-in and the headline CTAs (Start investing, Get early access,
   Request early access). Global (not a Stylance module) so a single string
   class can be dropped on an <a> or <button> in any component. */
.exc-action-btn {
    display: inline-block;
    text-align: center;
    padding: 12px 28px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(180deg, #f4a45c 0%, #ed8c43 100%);
    color: #ffffff;
    font-family:
        "Poppins",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        filter 160ms ease,
        box-shadow 160ms ease,
        transform 120ms ease;
}

.exc-action-btn:hover {
    filter: brightness(1.04);
    box-shadow: 0 10px 24px -10px rgba(237, 140, 67, 0.6);
}

.exc-action-btn:active {
    transform: translateY(1px);
}

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;

    & a {
        color: #8a9bb8 !important;
    }
}

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

    & a {
        background: var(--surface) !important;
        color: var(--text) !important;
        border-color: var(--border) !important;
    }

    & 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;

    &.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);
    }

    &.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;

    &::-webkit-scrollbar {
        width: 8px;
    }

    &::-webkit-scrollbar-track {
        background: transparent;
    }

    &::-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: #c14d6c;
    --accent-2: #d56685;
    --accent-deep: #8d3d56;
    --accent-soft: rgba(193, 77, 108, 0.14);
    --accent-softer: rgba(193, 77, 108, 0.07);
    --gold: #c7902b;
    --gold-dim: #a9781f;
    --good: #5ed38d;
    --warn: #f5b544;
    --danger: #ef6a5a;
    background: #0a0a0e;
    color: #ecebe5;
}

/* ---- Media Exchange — burgundy-on-white theme ----
   Scoped to [data-theme="media-burgundy"]. A light, institutional palette
   mirroring the reference design system (The.Exchange Media.html) — white
   surfaces, cool-warm neutrals, burgundy accent — used by the /media
   marketplace (spotlight + filter rail + shelves + grid). */
[data-theme="media-burgundy"] {
    --bg: #faf7f8;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4eef0;
    --surface-3: #ece2e6;
    --border: #e9e1e4;
    --border-2: #d9ccd1;
    --text: #1e1419;
    --text-dim: #6d5b62;
    --text-mute: #9c8d92;
    --accent: #8e1f43;
    --accent-2: #a8345a;
    --accent-deep: #6e1733;
    --accent-soft: rgba(142, 31, 67, 0.12);
    --accent-softer: rgba(142, 31, 67, 0.06);
    --gold: #c7902b;
    --gold-dim: #a9781f;
    --good: #11a86b;
    --warn: #e3a82f;
    --danger: #e0473d;
    background: #faf7f8;
    color: #1e1419;
}

[data-theme="exchange-property"] {
    --bg: #faf7f8;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4eef0;
    --surface-3: #ece2e6;
    --border: #e9e1e4;
    --border-2: #d9ccd1;
    --text: #1e1419;
    --text-dim: #6d5b62;
    --text-mute: #9c8d92;
    --accent: #5f9fe1;
    --accent-2: #011f45;
    --accent-deep: #011f45;
    --accent-soft: rgba(142, 31, 67, 0.12);
    --accent-softer: rgba(142, 31, 67, 0.06);
    --gold: #c7902b;
    --gold-dim: #a9781f;
    --good: #11a86b;
    --warn: #e3a82f;
    --danger: #e0473d;
    background: #faf7f8;
    color: #1e1419;
}

[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%);
    }
}
