/* =========================================================
   iSage / Invest-Sage — Shared Styles
   Covers: header/footer includes, index.php, site-index.php,
           site-demo.php (Investor Demo UI)
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root
{
    --bg: #0E1116;
    --panel: #151A22;
    --ink: #E9EEF6;
    --muted: #AAB4C3;
    --accent: #3DA6FF;
    --ok: #2ECC71;

    --border: #1F2632;
    --btn: #BB3BF7; /* primary CTA */
    --maxw: 1200px; /* unified content width */
    --radius: 16px;
    --pad: clamp(16px, 3vw, 28px);

    /* Demo (chat) palette */
    --bubble-user: #743CF0;
    --bubble-assist: #3E5FFF;
    --bubble-border: #1E2633;
    --input-bg: #0A0D12;
    --input-border: #3D4A5E;
    --btn-text: #FFFFFF;

    /* Chat layout */
    --chat-gutter: 12px; /* left/right inset inside the scroll area */
}

/* ---------- Base ---------- */
html, body
{
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    line-height: 1.5;
}

a
{
    color: var(--accent);
    text-decoration: none;
}

a:hover
{
    text-decoration: underline;
}

.wrap
{
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--pad);
}

/* ---------- Header / Nav ---------- */
header
{
    border-bottom: 1px solid #202633;
    background: linear-gradient(180deg, #0F141C, #0D1117);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.brand
{
    font-weight: 700;
    letter-spacing: .4px;
}

.tag
{
    color: var(--muted);
    font-size: .95rem;
    margin-left: 10px;
}

.menu .cta
{
    margin-left: 8px;
}

/* ---------- Buttons ---------- */
.cta
{
    display: inline-block;
    background: var(--btn);
    color: #FFF;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
}

.cta.secondary
{
    background: transparent;
    color: var(--ink);
    border: 1px solid #2A3342;
}

/* ---------- Layout Blocks ---------- */
.panel
{
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--pad);
}

.hero
{
    display: grid;
    gap: 22px;
    padding: 42px 0 24px;
}

.hero h1
{
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.1;
    margin: 0;
}

.hero p
{
    color: var(--muted);
    font-size: clamp(16px, 1.6vw, 18px);
    margin: 0;
}

.row
{
    display: grid;
    gap: 18px;
    grid-template-columns:1fr;
    line-height: 1.45;
}

/* layout rows (not chat) */
.buttons
{
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.kicker
{
    color: var(--ok);
    font-weight: 700;
    letter-spacing: .3px;
    font-size: .9rem;
    text-transform: uppercase;
}

.cols
{
    display: grid;
    gap: 16px;
    grid-template-columns:1fr;
}

.cols > .panel h3
{
    margin-top: 0;
}

.muted
{
    color: var(--muted);
}

.list
{
    margin: 0;
    padding-left: 18px;
}

footer
{
    border-top: 1px solid #202633;
    color: var(--muted);
    padding: 26px 0 60px;
    margin-top: 36px;
}

/* ---------- Responsive: product columns on wide screens ---------- */
@media (min-width: 920px)
{
    .cols.products
    {
        grid-template-columns:1fr 1fr;
    }
}

/* ---------- Product Colorways ---------- */
.panel-sites
{
    background: #3E5FFF;
    border-color: transparent;
    color: #FFF;
}

.panel-work
{
    background: #743CF0;
    border-color: transparent;
    color: #FFF;
}

.panel-sites .muted, .panel-work .muted
{
    color: rgba(255, 255, 255, 0.9);
}

.panel-sites a, .panel-work a
{
    color: #FFF;
    text-decoration: underline;
}

.panel .cta
{
    background: #BB3BF7;
    border-color: transparent;
}

.space-top
{
    margin-top: 12px;
}

/* =========================================================
   site-index.php — Ask-Sage full-width block & value props
   ========================================================= */
#ask-sage
{
    width: 100%;
    max-width: unset;
    grid-column: 1 / -1;
    flex-basis: 100%;
    align-self: stretch;
}

#ask-sage.panel
{
    border-radius: 14px;
    padding: 16px;
}

#ask-sage h2
{
    margin: 0 0 10px;
    font-size: 1.4rem;
}

/* Launch Demo special button and clearfix helper */
.cta.launch
{
    background: #BB3BF7;
    color: #FFF;
}

.clearfix::after
{
    content: "";
    display: block;
    clear: both;
}

/* Colored value-prop panels */
.panel-tech
{
    background: #3E5FFF;
    border-color: transparent;
    color: #FFF;
}

.panel-opp
{
    background: #6983FD;
    border-color: transparent;
    color: #FFF;
}

.panel-plan
{
    background: #743CF0;
    border-color: transparent;
    color: #FFF;
}

.panel-tech .muted, .panel-opp .muted, .panel-plan .muted
{
    color: rgba(255, 255, 255, 0.9);
}

.panel-tech a, .panel-opp a, .panel-plan a
{
    color: #FFF;
    text-decoration: underline;
}

/* Wider layout on desktops for this page’s grid */
@media (min-width: 860px)
{
    .row
    {
        grid-template-columns:1.2fr .8fr;
    }

    /* layout rows */
    .cols
    {
        grid-template-columns:repeat(3, 1fr);
    }
}

/* =========================================================
   site-demo.php — Investor Demo UI (chat, inputs, mode bar)
   ========================================================= */

/* Header row inside the demo panel */
.header
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 14px;
}

.nav a
{
    color: var(--ink);
    text-decoration: none;
    margin-left: 12px;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
}

.nav a:hover
{
    filter: brightness(1.08);
}

h1
{
    margin: 0 0 8px;
    font-size: 1.6rem;
}

#status
{
    color: var(--muted);
    margin: 6px 0 14px;
}

/* Mode bar & buttons */
.modebar
{
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.modebar .mode-left
{
    display: flex;
    gap: 8px;
}

#newConvBtn
{
    margin-left: auto;
}

/* Contrast behavior you liked */
.modebtn
{
    background: transparent;
    color: var(--ink);
    border: 1.5px solid #2A3342;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.modebtn.active
{
    background: var(--btn);
    color: #FFF;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(187, 59, 247, 0.25);
}

.modebtn:hover
{
    border-color: #3A465A;
}

.modebtn:focus-visible
{
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 166, 255, 0.35);
}

#newConvBtn:not(.active)
{
    background: transparent;
    color: var(--ink);
    border: 1.5px solid #2A3342;
}

/* Chat area (full width, no overflow) */
#chat
{
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 16px;
    max-height: 60vh;
    overflow: auto;
    overflow-x: hidden; /* prevent horizontal scrollbar */
    padding-inline: var(--chat-gutter);
    background: transparent;
    text-align: left !important; /* ensure content is left-aligned */
}

#chat .row
{
    display: block; /* override layout grid .row */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.45;
    word-break: break-word; /* prevent long URLs forcing overflow */
    overflow-wrap: anywhere;
}

#chat .user
{
    background: var(--bubble-user);
    border: 1px solid var(--bubble-border);
    color: #FFFFFF;
    white-space: pre-wrap;
    margin: 0; /* flush-left like assistant */
    text-align: left;
    border-top-left-radius: 12px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 4px;
}

#chat .assistant
{
    background: var(--bubble-assist);
    border: 1px solid var(--bubble-border);
    color: #FFFFFF;
    white-space: pre-wrap;
    margin: 0; /* flush-left */
    text-align: left;
    border-top-left-radius: 10px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 12px; /* fixed: rounded, not sharp */
    border-bottom-right-radius: 12px;
}

.sep
{
    height: 1px;
    background: var(--border);
    opacity: .6;
    width: 100%;
    margin: 8px 0;
}

/* Assistant list spacing/indent */
#chat .assistant ol,
#chat .assistant ul
{
    margin: 0.35rem 0 0.35rem 1.25rem;
    padding-left: 1rem;
}

#chat .assistant ul ul,
#chat .assistant ol ul,
#chat .assistant ul ol
{
    margin-left: 1.25rem; /* deeper indent for sub-lists */
}

#chat .assistant li
{
    margin: 0.15rem 0;
}

/* Form controls */
form
{
    display: flex;
    gap: 8px;
}

input[type="text"]
{
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    color: var(--ink);
    font-size: 16px;
    min-width: 240px;
}

button
{
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--btn);
    color: var(--btn-text);
    font-weight: 700;
    cursor: pointer;
}

button:disabled
{
    opacity: .6;
    cursor: not-allowed;
}

/* Meta / a11y */
.meta
{
    color: var(--muted);
    font-size: .92rem;
    margin-top: 8px;
}

.limit
{
    color: #FFCD57;
}

.sr-only
{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* === Fix: user bubble bottom-right corner should be rounded === */
#chat .user
{
    border-bottom-right-radius: 12px !important;
}

/* === Footer: smaller + less pronounced === */
footer
{
    font-size: 0.9rem; /* smaller text */
    color: rgba(170, 180, 195, 0.75); /* dimmer than var(--muted) */
}

footer a
{
    color: rgba(170, 180, 195, 0.85); /* slightly brighter than body text */
    text-decoration: none;
}

footer a:hover
{
    text-decoration: underline;
    color: #C5CFE0; /* gentle hover, still subtle */
}

/* Light indigo code blocks */
.panel .row.assistant pre,
.panel .row.user pre
{
    background: #F2F3FF !important; /* your color */
    color: #0F172A !important; /* dark slate text */
    border: 1px solid #F2F3FF !important;
    border: 1px solid #000000 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    overflow: auto !important;
    line-height: 1.4 !important;
}

.panel .row.assistant pre code,
.panel .row.user pre code
{
    color: inherit !important;
    background: transparent !important;
}

/* Optional: tint assistant bubble itself */
.panel .row.assistant
{
    background: #F2F3FF !important;
    color: #0F172A !important;
}


.row.assistant pre code,
.row.user pre code
{
    color: inherit;
    background: transparent;
}

/* Wrapper: no dim, no blocking clicks, only visible when .show is added */
#waitWrap
{
    display: none;
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

#waitWrap.show
{
    display: block !important;
}

#waitWrap .inner
{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 14px;

    padding: 18px 24px;
    border: 2px solid #444; /* darker border */
    border-radius: 16px;
    background: #FFF; /* bright white background */
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    font-weight: 700;
    color: #333; /* darker text */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

#waitWrap img
{
    height: 46px;
}

#waitWrap .inner span
{
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

/* 100% larger than your original (22px → 44px) */
#waitWrap img
{
    height: 44px;
}

#waitWrap .inner span
{
    font-size: 1.05rem;
}

.row.assistant ol, .row.assistant ul
{
    margin: 0.25rem 0 0.75rem 1.25rem;
    padding-left: 1rem;
}

.row.assistant ol
{
    list-style: decimal;
}

.row.assistant ul
{
    list-style: disc;
}


/* Tedd's stuff */
.floatR
{
    float: right;
}

.floatL
{
    float: left;
}

.right
{
    text-align: right;
}

.left
{
    text-align: left;
}

.center
{
    text-align: center;
}

.clear
{
    clear: both;
    margin: 0;
    padding: 0;
}

.bold
{
    font-weight: bold;
    color: #3B3B3B;
    font-family: arial, helvetica, sans-serif;
}
.clear
{
    clear: both;
    margin: 0;
    padding: 0;
}
