/* style.css — AttnSeq-PPI · modern theme */

:root {
    --brand:        #2563eb;
    --brand-dark:   #1d4ed8;
    --brand-light:  #3b82f6;
    --accent:       #10b981;
    --accent-dark:  #059669;
    --info:         #0ea5e9;
    --info-dark:    #0284c7;

    --ink:      #0f172a;
    --text:     #334155;
    --muted:    #64748b;
    --bg:       #f5f7fb;
    --surface:  #ffffff;
    --surface-2:#f1f5f9;
    --border:   #e5e9f0;

    --radius:    16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow:    0 6px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);

    --gradient: linear-gradient(135deg, #4f46e5 0%, #2563eb 45%, #06b6d4 100%);
    --max-width: 1160px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 100% -10%, #e8efff 0%, rgba(232, 239, 255, 0) 60%),
        radial-gradient(1000px 400px at -10% 0%, #e6fbf4 0%, rgba(230, 251, 244, 0) 55%),
        var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; }

.site-main { flex: 1; width: 100%; }

.container {
    width: 92%;
    max-width: var(--max-width);
    margin: 32px auto;
}

/* ---------- Navbar ---------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
}

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand);
}
.brand-sub { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a.active { background: var(--brand); color: #fff; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ink);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

@media (max-width: 820px) {
    .navbar-inner { flex-wrap: wrap; }
    .nav-toggle { display: block; }
    .site-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding-bottom: 12px;
        gap: 4px;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 10px 14px; }
}

/* ---------- Buttons ---------- */

.btn,
form button,
.button-group button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    padding: 11px 22px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover,
form button:hover,
.button-group button:hover {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

.btn-primary,
.btn-success { background: var(--accent); }
.btn-primary:hover,
.btn-success:hover { background: var(--accent-dark); }

.btn-info { background: var(--info); }
.btn-info:hover { background: var(--info-dark); }

.btn-ghost {
    background: transparent;
    color: var(--brand);
    box-shadow: inset 0 0 0 1.5px var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--brand-dark); box-shadow: inset 0 0 0 1.5px var(--brand-light); }

form button[type="reset"] { background: #eef1f6; color: var(--muted); box-shadow: none; }
form button[type="reset"]:hover { background: #e2e7ef; color: var(--ink); }

.button-group button.btn-example { background: var(--accent); }
.button-group button.btn-example:hover { background: var(--accent-dark); }

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 18px 0;
}

/* ---------- Hero (home) ---------- */

.hero {
    width: 92%;
    max-width: var(--max-width);
    margin: 48px auto 24px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
    background: #e8efff;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.hero-title {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}
.grad-text { color: var(--brand); }

.hero-lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; margin-bottom: 28px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-visual {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
}
.hero-visual img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; gap: 28px; margin-top: 32px; text-align: center; }
    .hero-lead { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { max-width: 520px; margin: 0 auto; }
}

/* ---------- Features ---------- */

.features {
    width: 92%;
    max-width: var(--max-width);
    margin: 24px auto 56px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 26px;
    transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.feature-card p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Publication ---------- */

.publication {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto 56px;
}
.pub-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 30px;
}
.pub-title { font-size: 1.2rem; line-height: 1.4; margin: 12px 0 8px; }
.pub-meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.pub-meta a { font-weight: 600; word-break: break-word; }

/* ---------- Cards / sections ---------- */

.card,
.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.form-section h2 { font-size: 1.6rem; margin-bottom: 18px; letter-spacing: -0.01em; }

.dropdown-section h3,
.sec_head { font-size: 1.2rem; color: var(--ink); font-weight: 700; }

.page-title {
    text-align: center;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 40px auto 8px;
}
.page-subtitle { text-align: center; color: var(--muted); margin-bottom: 20px; }

/* ---------- Forms ---------- */

form label { font-weight: 600; margin-bottom: 6px; display: block; color: var(--ink); }

form input,
form textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
form textarea { resize: vertical; min-height: 110px; font-variant-ligatures: none; letter-spacing: 0.02em; }
form input[type="file"] { padding: 10px; background: var(--surface-2); cursor: pointer; }

.input-row { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 10px; }
.input-group { flex: 1; min-width: 240px; }

.radio-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.radio-label input[type="radio"] {
    width: 22px; height: 22px; margin: 0;
    flex-shrink: 0;
    accent-color: var(--brand);
    cursor: pointer;
}
.radio-label .sec_head { margin-bottom: 0; }

/* ---- Prediction mode cards ---- */

.modes { display: flex; flex-direction: column; gap: 22px; }

.mode-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.mode-head {
    width: 100%;
    padding: 16px 22px;
    background: var(--surface-2);
    border-bottom: 1.5px solid var(--border);
    transition: background-color 0.2s ease;
}

.mode-badge {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--muted);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

.mode-head .sec_head { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }

.mode-tag {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.mode-body {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 22px;
}
.mode-body.active { opacity: 1; pointer-events: auto; }

/* Active mode — accent border + tinted header; each mode has its own hue */
.mode-card.is-active { box-shadow: var(--shadow); }
.mode-1.is-active { border-color: var(--brand); }
.mode-1.is-active .mode-head { background: #eef4ff; }
.mode-1.is-active .mode-badge { background: var(--brand); }

.mode-2.is-active { border-color: var(--info); }
.mode-2.is-active .mode-head { background: #e6f6fc; }
.mode-2.is-active .mode-badge { background: var(--info); }

.mode-3.is-active { border-color: var(--accent); }
.mode-3.is-active .mode-head { background: #e9fbf3; }
.mode-3.is-active .mode-badge { background: var(--accent); }

/* keep the generic form-container rule for any other use */
.form-container.active { opacity: 1; pointer-events: auto; }

@media (max-width: 560px) {
    .mode-head { flex-wrap: wrap; }
    .mode-tag { margin-left: 44px; }
}

hr.divider { margin: 24px 0; border: none; border-top: 1px solid var(--border); }

.limits-note {
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 6px 0 16px;
}
.limits-note strong { color: var(--brand); }

/* ---------- Loading / progress bar ---------- */

.progress-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.progress-overlay.show { display: flex; }

.progress-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 30px 34px;
    width: min(440px, 92vw);
    text-align: center;
}
.progress-title { font-size: 1.25rem; margin-bottom: 6px; }
.progress-status { color: var(--text); font-weight: 600; margin-bottom: 18px; min-height: 1.4em; }

.progress-track {
    height: 12px;
    width: 100%;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--brand);
    border-radius: 999px;
    transition: width 0.2s ease;
}
.progress-fill.indeterminate {
    width: 40% !important;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), var(--brand), rgba(37, 99, 235, 0.25));
    animation: indet 1.1s ease-in-out infinite;
}
@keyframes indet {
    0%   { margin-left: -45%; }
    100% { margin-left: 100%; }
}

.progress-meta { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }
.progress-hint { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* ---------- Tutorial (written docs) ---------- */

.tutorial {
    width: 92%;
    max-width: 860px;
    margin: 8px auto 56px;
}
.tutorial > p { color: var(--text); margin-bottom: 16px; }

.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 24px;
    margin-bottom: 28px;
}
.toc h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }

.tut-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 26px 28px;
    margin-bottom: 24px;
}
.tut-section h2 {
    font-size: 1.3rem;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.tut-section h3 { font-size: 1.05rem; margin: 18px 0 8px; }
.tut-section p { margin: 8px 0; }

.steps { list-style: none; counter-reset: step; margin: 14px 0 4px; padding: 0; }
.steps > li {
    counter-increment: step;
    position: relative;
    padding: 4px 0 16px 46px;
    margin: 0;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    background: var(--brand);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 50%;
}
.steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 14px; top: 32px; bottom: 4px;
    width: 2px;
    background: var(--border);
}

.ui-el {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}

.note {
    border-left: 4px solid var(--brand);
    background: #eef4ff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.95rem;
    color: var(--text);
}
.note.tip  { border-left-color: var(--accent); background: #ecfdf5; }
.note.warn { border-left-color: #f59e0b; background: #fff7ed; }
.note strong { color: var(--ink); }

.tut-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.94rem; }
.tut-table th, .tut-table td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.tut-table th { background: var(--surface-2); color: var(--ink); }
.tut-table td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

/* ---------- Contact ---------- */

.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: var(--max-width);
    margin: 0 auto 48px;
    padding: 8px 4%;
    gap: 24px;
}
.contact-column { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 20px; }

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.contact-card h2 { color: var(--ink); margin-bottom: 12px; font-size: 1.3rem; }
.contact-card h3 { color: var(--text); font-size: 1rem; margin: 3px 0; }
.contact-card p { margin: 4px 0; color: var(--muted); }
.contact-card a { color: var(--brand); }
.contact-card a:hover { text-decoration: underline; }
.contact-card iframe { border: none; width: 100%; height: 780px; border-radius: var(--radius-sm); }

@media (max-width: 768px) {
    .contact-wrapper { flex-direction: column; }
    .contact-card iframe { height: 620px; }
}

/* ---------- Result pages ---------- */

.result-container {
    background: var(--surface);
    padding: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 44px auto;
    max-width: 640px;
    text-align: center;
}
.result-container h2 { font-size: 1.6rem; margin-bottom: 12px; }
.result-container .prediction-value {
    display: inline-block;
    color: var(--accent-dark);
    font-weight: 800;
    font-size: 1.5rem;
}

/* Summary stat cards */
.result-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
.stat-card {
    flex: 1;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-card.accent { border-left: 4px solid var(--accent); }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1.05; }
.stat-card.accent .stat-num { color: var(--accent-dark); }
.stat-label { font-size: 0.9rem; color: var(--muted); font-weight: 600; }

/* Result blocks (table + network) */
.result-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.result-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.result-block-head h2 { font-size: 1.3rem; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.block-hint { color: var(--muted); font-size: 0.92rem; margin: 8px 0 0; }

/* Result table */
.table-wrap {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: auto;
    max-height: 560px;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table-wrap th,
.table-wrap td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.table-wrap thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--brand); color: #fff; font-weight: 700;
}
.table-wrap tbody tr:nth-child(even) { background: var(--surface-2); }
.table-wrap tbody tr:hover { background: #eef4ff; }

/* Network viewport (pyvis network is sandboxed in an iframe to isolate its CSS) */
.network-wrap {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}
.network-frame { width: 100%; height: 640px; border: none; display: block; }

/* ---------- Error page ---------- */

.error-card { max-width: 640px; margin: 3rem auto; text-align: center; }
.error-message { font-size: 1.15rem; font-weight: 700; color: #dc2626; margin: 0.5rem 0; }
.error-suggestion { color: var(--muted); margin: 0.25rem 0 1.2rem; }

.highlight { color: var(--brand); font-weight: 700; }

/* ---------- Footer ---------- */

.site-footer { background: #0b1220; color: #cbd5e1; margin-top: 40px; }
.footer-inner {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 44px 0 28px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.2fr;
    gap: 32px;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; letter-spacing: 0.01em; }
.footer-col p { color: #94a3b8; font-size: 0.92rem; max-width: 42ch; }
.footer-col a { display: block; color: #cbd5e1; font-size: 0.94rem; padding: 4px 0; }
.footer-col a:hover { color: #fff; }

.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer-bottom p {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 18px 0;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}

@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
