/* MissenseDB v2.0 — main.css */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:       #0d6efd;
    --blue-dark:  #0a58ca;
    --blue-faint: #e8f0fe;
    --text:       #1a1a1a;
    --muted:      #555;
    --border:     #d8d8d8;
    --bg:         #fafafa;
    --card-bg:    #ffffff;
    --mono:       'IBM Plex Mono', monospace;
    --sans:       'IBM Plex Sans', sans-serif;
    --radius:     6px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Nav ── */
.nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 2.5rem;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    font-size: 0.88rem;
}
.nav-brand {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-brand:hover  { color: var(--blue-dark); }
.nav-sep          { color: var(--border); font-weight: 300; }
.nav-current      { color: var(--muted); font-weight: 400; }
.nav-spacer       { flex: 1; }
.nav-link {
    color: var(--muted);
    text-decoration: none;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
    font-size: 0.85rem;
}
.nav-link:hover { background: var(--blue-faint); color: var(--blue); }

/* ── Landing ── */
.landing { flex: 1; }
.landing-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}
.landing-header { text-align: center; margin-bottom: 2.5rem; }

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}
.landing-title {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}
.version-badge {
    font-family: var(--mono);
    font-size: 0.72rem;
    background: var(--blue-faint);
    color: var(--blue);
    border: 1px solid #c2d4fb;
    padding: 0.25rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
    align-self: center;
}
.landing-authors {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.9rem;
}
.landing-authors a         { color: var(--blue); text-decoration: none; }
.landing-authors a:hover   { text-decoration: underline; }
.landing-sub {
    font-size: 1rem;
    font-weight: 300;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.landing-desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.65;
    max-width: 580px;
    margin: 0 auto 2rem;
}

/* ── Stats strip ── */
.stats-strip {
    display: flex;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2.5rem;
}
.stat-cell {
    flex: 1;
    background: #fff;
    padding: 0.85rem 1rem;
    text-align: center;
}
.stat-value {
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--blue);
    display: block;
}
.stat-label {
    font-size: 0.74rem;
    color: var(--muted);
    margin-top: 0.1rem;
    display: block;
    line-height: 1.3;
}

/* ── Search card ── */
.search-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
}
.search-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.search-label .hint {
    font-weight: 400;
    color: var(--muted);
    margin-left: 0.35rem;
    font-size: 0.78rem;
}
.search-row {
    display: flex;
    gap: 0.6rem;
    position: relative;
}
.search-input {
    font-family: var(--mono);
    font-size: 1rem;
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s;
    text-transform: uppercase;
}
.search-input::placeholder { text-transform: none; }
.search-input:focus         { border-color: var(--blue); }

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 80px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: none;
}
.autocomplete-dropdown.open { display: block; }
.autocomplete-item {
    font-family: var(--mono);
    font-size: 0.88rem;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.1s;
}
.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--blue-faint);
    color: var(--blue);
}

.submit-btn {
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.6rem 1.3rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}
.submit-btn:hover  { background: var(--blue-dark); }
.submit-btn:active { transform: scale(0.98); }

.error-msg {
    font-size: 0.85rem;
    color: #dc3545;
    margin-top: 0.5rem;
    padding: 0.5rem 0.7rem;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius);
}

/* ── Info cards ── */
.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
}
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.info-card-title {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.info-card-body {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: #fff;
    margin-top: auto;
}
.footer-link         { color: var(--muted); text-decoration: none; }
.footer-link:hover   { color: var(--blue); }

/* ════════════════════════════════════════════════
   RESULTS PAGE
   ════════════════════════════════════════════════ */

.results-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.2rem 2rem 5rem;
}

.results-header {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.results-header span {
    color: var(--blue);
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.5rem;
}

.panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    height: 100%;
}
.panel-title {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.structure-info {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
    font-family: var(--mono);
    min-height: 1.2em;
}

.pred-btns {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.pred-btn {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}
.pred-btn:hover  { border-color: var(--blue); color: var(--blue); }
.pred-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

#Structure {
    width: 100%;
    height: 420px;
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dl-btn {
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
    border: none;
    background: none;
}
.dl-btn:hover { color: var(--blue); }

/* pfv container — fixed height prevents snap on residue click */
.pfv-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    /* Fixed height prevents layout reflow when residue table appears */
    min-height: 400px;
    overflow: hidden;
}

#pfv {
    /* Pre-reserve full width so Saguaro never recalculates on first click */
    width: 100%;
    min-height: 360px;
}

.placeholder-msg {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
    padding: 0.5rem 0;
}

/* ── Tabulator overrides ── */
.tabulator {
    border: none !important;
    font-family: var(--mono);
    font-size: 0.78rem;
    background: transparent;
}
.tabulator .tabulator-header {
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
}
.tabulator .tabulator-header .tabulator-col {
    background: var(--bg) !important;
    font-family: var(--mono);
    font-size: 0.73rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-right: none !important;
}
.tabulator-row { border-bottom: 1px solid #f0f0f0 !important; }
.tabulator-row:hover    { background: var(--blue-faint) !important; cursor: pointer; }
.tabulator-row.tabulator-selected { background: var(--blue-faint) !important; }

.nav-logo-mark {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.75rem;
    background: var(--blue);
    color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    letter-spacing: -0.02em;
    flex-shrink: 0;

    padding: 0 0.45rem;        /* Removed top/bottom padding, just left/right */
    height: 24px;              /* Explicitly lock the height — tweak this number! */
   

    line-height: 1;            /* Ignores Bootstrap's 1.5 line height */
    display: inline-flex;      /* Allows perfect vertical centering */
    align-items: center;
    justify-content: center;

}


/* ── Responsive ── */
@media (max-width: 900px) {
    .info-cards    { grid-template-columns: 1fr; }
    .stats-strip   { flex-wrap: wrap; }
    .stat-cell     { min-width: 50%; }
    .landing-inner { padding: 2rem 1rem 3rem; }
    .results-wrap  { padding: 1rem 1rem 4rem; }
    #Structure     { height: 300px; }
}
