/* Real Estate CRM Pro — interactive demo (/demo/) styles. Self-contained. */

:root {
    --demo-ink: #0E1612;
    --demo-paper: #F1F4EE;
    --demo-paper-2: #E5EAE0;
    --demo-shell-bg: #0F172A;
    --demo-shell-bg-2: #111B33;
    --demo-shell-line: rgba(255, 255, 255, 0.10);
    --demo-shell-text: #E2E8F0;
    --demo-shell-muted: #94A3B8;
    --demo-shell-muted-2: #64748B;
    --demo-accent: #3DDC97;
    --demo-line: rgba(14, 22, 18, 0.10);
    --demo-muted: rgba(14, 22, 18, 0.58);
    --demo-muted-2: rgba(14, 22, 18, 0.42);
    --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-display: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-serif: "Instrument Serif", "Times New Roman", serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
    font-family: var(--font-sans);
    background: var(--demo-paper);
    color: var(--demo-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ─── shell ─── */
.demo-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

/* ─── sidebar ─── */
.demo-sidebar {
    background: var(--demo-shell-bg);
    color: var(--demo-shell-text);
    border-right: 1px solid var(--demo-shell-line);
    padding: 14px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.demo-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    color: var(--demo-shell-text);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.demo-logo strong {
    color: var(--demo-accent);
    font-weight: 700;
    margin-left: 2px;
}

.demo-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--demo-shell-line);
    border-radius: 10px;
}
.demo-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--demo-shell-text);
    font-size: 13px;
}
.demo-search input::placeholder { color: var(--demo-shell-muted-2); }
.demo-kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--demo-shell-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--demo-shell-line);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.demo-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 4px;
}
.demo-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--demo-shell-muted);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.demo-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--demo-shell-text);
}
.demo-nav-link.active {
    background: rgba(61, 220, 151, 0.14);
    color: var(--demo-accent);
    border-color: rgba(61, 220, 151, 0.20);
}
.demo-nav-ico {
    display: inline-flex;
    width: 18px;
    justify-content: center;
    font-size: 14px;
    color: inherit;
    opacity: 0.95;
}

.demo-mode-pill {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(61, 220, 151, 0.10);
    border: 1px solid rgba(61, 220, 151, 0.24);
    border-radius: 999px;
    color: var(--demo-accent);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.demo-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--demo-accent);
    box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.20);
}

/* ─── main / topbar ─── */
.demo-main {
    background: var(--demo-paper);
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

.demo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    background: var(--demo-shell-bg);
    color: var(--demo-shell-text);
    border-bottom: 1px solid var(--demo-shell-line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.demo-topbar-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.demo-section-label {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--demo-shell-text);
}
.demo-section-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--demo-shell-muted);
}
.demo-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.demo-topbar-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--demo-shell-line);
    color: var(--demo-shell-muted);
    font-size: 12px;
    font-weight: 500;
}

/* ─── buttons ─── */
.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    transition: transform .12s ease, background .15s ease, border-color .15s ease;
    white-space: nowrap;
    background: transparent;
}
.demo-btn:hover { transform: translateY(-1px); }
.demo-btn-primary {
    background: var(--demo-accent);
    color: var(--demo-ink);
}
.demo-btn-primary:hover { background: color-mix(in oklab, var(--demo-accent) 88%, white); }
.demo-btn-dark {
    background: var(--demo-ink);
    color: var(--demo-paper);
}
.demo-btn-dark:hover { background: color-mix(in oklab, var(--demo-ink) 88%, white); }
.demo-btn-ghost {
    background: transparent;
    color: inherit;
    border-color: rgba(255, 255, 255, 0.20);
}
.demo-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* main-area buttons need different ghost colors (light bg) */
.demo-section .demo-btn-ghost {
    color: var(--demo-ink);
    border-color: var(--demo-line);
}
.demo-section .demo-btn-ghost:hover {
    background: rgba(14, 22, 18, 0.04);
}

/* ─── stage / sections ─── */
.demo-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 16px 24px 0;
    overflow: hidden;
}

.demo-section {
    display: none;
    width: 100%;
    max-width: 1500px;
    min-height: 0;
    margin: 0 auto;
}
.demo-section.active {
    display: flex;
    flex-direction: column;
}

.demo-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.demo-h1 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.025em;
    font-size: 26px;
    line-height: 1.05;
    margin: 0 0 4px;
}
.demo-h1-sub {
    color: var(--demo-muted);
    font-size: 13.5px;
    line-height: 1.35;
    max-width: 64ch;
    margin: 0;
}
.demo-h1 .demo-ital {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}
.demo-section-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-shot {
    border: 1px solid var(--demo-line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--demo-paper-2);
    box-shadow: 0 24px 60px rgba(11, 15, 14, 0.10);
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--demo-paper-2);
    cursor: zoom-in;
    transition: transform 0.18s ease;
}
.demo-shot:hover img { transform: scale(1.005); }

.demo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(11, 15, 14, 0.90);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.demo-lightbox.open { display: flex; opacity: 1; }
.demo-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    cursor: default;
}
.demo-lightbox-close {
    position: fixed;
    top: 22px;
    right: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: var(--demo-paper);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.demo-lightbox-caption {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-align: center;
    max-width: 80vw;
}

.demo-caption {
    margin: 8px 0 0;
    color: var(--demo-muted);
    font-size: 12.5px;
    line-height: 1.35;
    max-width: 80ch;
}

.demo-footnote {
    border-top: 1px solid var(--demo-line);
    margin: 0 auto;
    padding: 8px 24px 10px;
    color: var(--demo-muted);
    font-size: 11.5px;
    text-align: center;
    background: var(--demo-paper);
}
.demo-footnote a {
    color: var(--demo-ink);
    border-bottom: 2px solid var(--demo-accent);
    padding-bottom: 1px;
    font-weight: 500;
    margin-left: 6px;
}

/* ─── toast ─── */
.demo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 16px);
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--demo-ink);
    color: var(--demo-paper);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 16px 40px rgba(11, 15, 14, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
    z-index: 100;
}
.demo-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ─── responsive ─── */
@media (max-width: 980px) {
    html, body { height: auto; overflow: auto; }
    .demo-shell { grid-template-columns: 1fr; }
    .demo-sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 14px;
    }
    .demo-search { display: none; }
    .demo-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        margin-top: 0;
        padding-bottom: 4px;
        order: 2;
        flex-basis: 100%;
    }
    .demo-nav-link { white-space: nowrap; flex-shrink: 0; }
    .demo-mode-pill { margin: 0; order: 1; }
    .demo-main { height: auto; overflow: visible; }
    .demo-stage {
        display: block;
        overflow: visible;
        padding: 18px 18px 0;
    }
    .demo-section.active { display: block; }
    .demo-shot { display: block; }
    .demo-shot img { height: auto; object-fit: initial; }
    .demo-h1 { font-size: 28px; }
    .demo-section-header { flex-direction: column; align-items: stretch; }
    .demo-topbar { padding: 12px 18px; }
    .demo-topbar-pill { display: none; }
}

@media (max-width: 640px) {
    .demo-h1 { font-size: 24px; }
    .demo-section-actions .demo-btn { font-size: 12.5px; padding: 7px 12px; }
    .demo-footnote { padding: 18px; font-size: 12.5px; }
}
