/* =========================================================
   KlaAtlas global stylesheet
   File: assets/style.css
   Recommended link:
   <link rel="stylesheet" href="assets/style.css?v=20260605">
   ========================================================= */

/* ---------- Base ---------- */
:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #4b5563;
    --muted-light: #6b7280;
    --border: #e5e7eb;
    --border-dark: #d9e1e8;
    --primary: #0f766e;
    --primary-light: #ecfdf5;
    --primary-soft: #dff7f2;
    --primary-border: #99d5cc;
    --sidebar-top: #0f172a;
    --sidebar-bottom: #063f3b;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.045);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.06), transparent 28%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.04), transparent 30%),
        var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
}

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

a:hover {
    text-decoration: none;
}

/* ---------- Layout ---------- */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 270px;
    min-width: 270px;
    min-height: 100vh;
    padding: 32px 22px;
    background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
    color: #e5edf0;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
    font-size: 31px;
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 36px 20px;
    letter-spacing: -0.6px;
}

.sidebar a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 58px;
    padding: 15px 18px;
    margin: 9px 0;
    border-radius: 15px;
    color: #e5edf0;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
    border: 1px solid transparent;
    transition: all 0.16s ease-in-out;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    transform: translateX(1px);
}

.sidebar a.active {
    background: rgba(20, 184, 166, 0.22);
    border-color: rgba(45, 212, 191, 0.25);
    color: #ffffff;
    box-shadow: inset 4px 0 0 #14b8a6, 0 8px 20px rgba(0, 0, 0, 0.10);
}

.nav-icon {
    display: inline-block;
    width: 26px;
    min-width: 26px;
    margin-right: 8px;
    text-align: center;
    font-size: 20px;
    line-height: 1;
}

.main {
    flex: 1;
    margin-left: 270px;
    padding: 42px 54px 60px 54px;
    max-width: 100%;
}

/* ---------- Page headings ---------- */
h1 {
    font-size: 44px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.8px;
    color: var(--text);
    margin: 0 0 16px 0;
}

h2 {
    font-size: 28px;
    line-height: 1.25;
    font-weight: 850;
    color: var(--text);
    margin: 0 0 18px 0;
}

h3 {
    font-size: 21px;
    line-height: 1.35;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 12px 0;
}

.page-subtitle {
    font-size: 19px;
    line-height: 1.75;
    color: #374151;
    margin: 0 0 28px 0;
    max-width: 1280px;
}

/* ---------- General cards ---------- */
.card,
.panel,
.publication-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 32px;
    margin-top: 26px;
    box-shadow: var(--shadow);
}

.card p,
.panel p,
.publication-card p {
    color: #111827;
}

/* ---------- Home page ---------- */
.overview-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 32px;
    margin-top: 26px;
    box-shadow: var(--shadow);
}

.overview-card h2 {
    margin-bottom: 14px;
}

.overview-card p {
    margin: 0;
    font-size: 17px;
    line-height: 1.8;
    color: #111827;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 26px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px 28px;
    box-shadow: var(--shadow-soft);
    min-height: 150px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22px;
    bottom: 22px;
    width: 5px;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.07);
}

.metric-number {
    position: relative;
    z-index: 1;
    font-size: 44px;
    line-height: 1.1;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.metric-label {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    font-size: 17px;
    font-weight: 800;
    color: #374151;
}

.usage-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 32px;
    margin-top: 32px;
    box-shadow: var(--shadow);
}

.usage-card p {
    margin: 10px 0;
    font-size: 16px;
    color: #111827;
}

/* ---------- Forms and query ---------- */
.search-card,
.query-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px 30px;
    margin-top: 24px;
    box-shadow: var(--shadow);
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

label {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #374151;
    margin-bottom: 8px;
}

input[type="text"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #cfd8dc;
    border-radius: 11px;
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    outline: none;
    transition: all 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

button,
.button,
.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: none;
    border-radius: 11px;
    background: var(--primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.18);
    transition: all 0.15s ease-in-out;
}

button:hover,
.button:hover,
.btn:hover,
input[type="submit"]:hover {
    background: #14b8a6;
    color: #ffffff;
    transform: translateY(-1px);
}

.result-summary {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-left: 5px solid var(--primary);
    border-radius: 16px;
    padding: 16px 18px;
    margin-top: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    color: #374151;
    font-size: 16px;
    line-height: 1.7;
}

.alert,
.message,
.notice {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-left: 5px solid #2563eb;
    border-radius: 14px;
    padding: 14px 16px;
    color: #374151;
    margin: 18px 0;
}

.warning {
    background: #fffaf0;
    border: 1px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: 14px;
    padding: 14px 16px;
    color: #7c2d12;
    margin: 18px 0;
}

/* ---------- Tables ---------- */
.table-wrapper,
.html-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-top: 16px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 14.5px;
    color: #1f2937;
    background: #ffffff;
}

th {
    background: #f8fafc;
    color: #374151;
    font-weight: 850;
    text-align: left;
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid #eef2f7;
    white-space: nowrap;
}

td {
    padding: 10px 13px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f3f4f6;
    vertical-align: middle;
    background: #ffffff;
    line-height: 1.45;
}

tr:hover td {
    background: #f0fdfa;
}

th:last-child,
td:last-child {
    border-right: none;
}

tr:last-child td {
    border-bottom: none;
}

.detail-link,
.small-link {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--primary-border);
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
}

.detail-link:hover,
.small-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.pmid-link {
    display: inline-block;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
}

.pmid-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* ---------- Detail page ---------- */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 20px;
}

.detail-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px 30px;
    margin-top: 22px;
    box-shadow: var(--shadow);
}

/* ---------- Download page ---------- */
.download-section-title {
    font-size: 22px;
    font-weight: 850;
    color: var(--text);
    margin-top: 28px;
    margin-bottom: 14px;
}

.download-table {
    width: 100%;
}

.download-button,
.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 850;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.16);
}

.download-button:hover,
.download-link:hover {
    background: #14b8a6;
    color: #ffffff;
}

/* ---------- Publication page ---------- */
.publication-card {
    padding: 32px 40px;
}

.publication-card h2 {
    font-size: 31px;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 20px 0;
}

.publication-status {
    display: inline-block;
    margin-top: 8px;
    margin-bottom: 26px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    font-size: 14px;
    font-weight: 850;
}

.citation-box {
    margin-top: 18px;
    padding: 24px 28px;
    border-radius: 14px;
    background: #f8fafc;
    border-left: 5px solid var(--primary);
}

.publication-citation {
    font-size: 18px;
    line-height: 1.9;
    color: #111827;
    margin: 0;
}

.publication-citation .title {
    font-weight: 850;
}

.publication-note {
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
    margin-top: 24px;
    margin-bottom: 0;
}

/* ---------- GitHub page ---------- */
.github-link-box {
    padding: 18px 20px;
    border-radius: 14px;
    background: #f8fafc;
    border-left: 5px solid var(--primary);
    font-size: 16px;
    line-height: 1.7;
    word-break: break-all;
}

/* ---------- Protein sequence view ---------- */
.sequence-section-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--text);
    margin-top: 30px;
    margin-bottom: 10px;
}

.sequence-legend {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 14px;
}

.sequence-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 18px 20px;
    margin-bottom: 18px;
}

.sequence-card-title {
    font-size: 18px;
    font-weight: 850;
    color: var(--text);
    margin-bottom: 4px;
}

.sequence-card-subtitle {
    font-size: 13px;
    color: #60707c;
    margin-bottom: 8px;
}

.sequence-site-list {
    font-size: 13px;
    color: #34424f;
    margin-bottom: 10px;
}

.sequence-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    overflow-x: auto;
}

.sequence-line {
    display: grid;
    grid-template-columns: 56px max-content 56px;
    column-gap: 14px;
    align-items: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.9;
    white-space: nowrap;
    margin: 1px 0;
}

.sequence-pos,
.sequence-pos-end {
    color: #6b7785;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.sequence-pos {
    text-align: right;
    padding-right: 4px;
}

.sequence-pos-end {
    text-align: left;
}

.sequence-body {
    display: inline-grid;
    grid-template-columns: repeat(6, 10ch);
    column-gap: 2ch;
    align-items: center;
}

.sequence-group {
    display: inline-block;
    width: 10ch;
    letter-spacing: 0.2px;
}

.sequence-aa {
    color: #263238;
    display: inline-block;
    width: 1ch;
    text-align: center;
}

.sequence-hit {
    display: inline-block;
    width: 1ch;
    text-align: center;
    background: #fde68a;
    color: #991b1b;
    border-radius: 4px;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(180, 120, 0, 0.20);
}

.sequence-missing {
    background: #fffaf0;
    border: 1px solid #f3d59f;
    color: #8a6212;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

/* ---------- Utility ---------- */
.text-muted {
    color: var(--muted);
}

.text-primary {
    color: var(--primary);
}

.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: 12px;
}

.mt-3 {
    margin-top: 18px;
}

.mt-4 {
    margin-top: 26px;
}

.mb-0 {
    margin-bottom: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 34px 34px 48px 34px;
    }
}

@media (max-width: 820px) {
    .layout {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        min-height: auto;
        padding: 20px 18px;
    }

    .sidebar-title {
        margin: 0 0 16px 0;
        font-size: 28px;
    }

    .sidebar a {
        min-height: 48px;
        margin: 6px 0;
        font-size: 17px;
    }

    .main {
        margin-left: 0;
        padding: 28px 20px 42px 20px;
    }

    h1 {
        font-size: 36px;
    }

    .page-subtitle {
        font-size: 17px;
    }

    .card,
    .panel,
    .publication-card,
    .overview-card,
    .usage-card,
    .search-card,
    .query-card {
        padding: 22px 20px;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 32px;
    }

    h2,
    .publication-card h2 {
        font-size: 24px;
    }

    .publication-citation {
        font-size: 16px;
    }

    .metric-number {
        font-size: 38px;
    }

    .main {
        padding-left: 16px;
        padding-right: 16px;
    }
}


/* KlaAtlas dataset metadata additions */
.dataset-filters{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0;}
.dataset-filters input{flex:2 1 250px;}.dataset-filters select{flex:1 1 180px;}
.dataset-longtext{overflow-wrap:anywhere;white-space:normal;max-width:980px;}
details{margin-top:22px;padding:14px;background:#f8fafc;border-radius:12px;}
details summary{cursor:pointer;font-weight:700;}
