/* Rutgers DFT & DMFT Materials Database */

:root {
  --bg: #ffffff;
  --fg: #1d2127;
  --muted: #5f6873;
  --line: #d9dde3;
  --panel: #f5f6f8;
  --link: #1a5fb4;
  --accent: #b3160b;
  --nav-bg: #2b2f36;
  --nav-fg: #e9ecef;
  --row-alt: #fafbfc;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16181c;
  --fg: #e4e6ea;
  --muted: #9aa3ad;
  --line: #333840;
  --panel: #1f2227;
  --link: #7fb2ff;
  --accent: #ff6b5c;
  --nav-bg: #0e0f12;
  --nav-fg: #e9ecef;
  --row-alt: #1b1e22;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); }
h1, h2, h3 { line-height: 1.25; }
code { font-size: 0.92em; }

/* ------------------------------------------------ banner + navigation */

.banner {
  position: relative;
  height: 128px;
  background: #3a0000 url("/static/images/akw-banner.png") 0 0 repeat-x;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  overflow: hidden;
}
.banner-text { text-decoration: none; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.banner-title { display: block; font: 700 1.9rem/1.15 Georgia, "Times New Roman", serif; }
.banner-sub { display: block; font: 600 1.02rem/1.35 Georgia, "Times New Roman", serif; max-width: 34em; }

.nav {
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; flex: 1; }
.nav a {
  display: block;
  padding: 9px 12px;
  color: var(--nav-fg);
  text-decoration: none;
  font-size: 0.93rem;
  border-bottom: 3px solid transparent;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); }
.nav a.active { border-bottom-color: var(--accent); }
.theme-toggle {
  background: none; border: 1px solid #555; color: var(--nav-fg);
  border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 1rem;
}

.content { max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
.footer { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 16px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .banner { height: auto; min-height: 100px; padding: 12px 16px; }
  .banner-title { font-size: 1.3rem; }
  .banner-sub { font-size: 0.8rem; }
}

/* ------------------------------------------------ tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.db { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.db th, table.db td { padding: 5px 9px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.db thead th { background: var(--panel); position: sticky; top: 0; font-weight: 600; }
table.db thead tr.group th { border-bottom: none; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.db td.name { text-align: left; font-weight: 600; }
table.db tbody tr:nth-child(even) { background: var(--row-alt); }
table.db tbody tr:hover { background: var(--panel); }
table.db .sep { border-left: 2px solid var(--line); }
.off { color: var(--muted); opacity: 0.45; }
a.plot { font-weight: 600; }

/* ------------------------------------------------ plot pages */

.crumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.page-title { margin: 0 0 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a, .tabs span {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; font-size: 0.9rem;
}
.tabs a.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tabs span { opacity: 0.4; }

.plot-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .plot-layout { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.panel h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 12px 0 6px; }
.panel h3:first-child { margin-top: 0; }
.series { margin-bottom: 8px; }
.series .atom { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.series .orbs { display: flex; flex-wrap: wrap; gap: 4px 10px; padding-left: 22px; }
.series label, .check { cursor: pointer; user-select: none; }
.orb-btn input { margin-right: 3px; }

.ranges { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 6px; align-items: center; font-size: 0.88rem; }
.ranges input { width: 100%; min-width: 0; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--fg); }
.btn {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg); color: var(--fg); cursor: pointer; font-size: 0.88rem;
}
.btn:hover { border-color: var(--fg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plot { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.plot.small { height: 300px; margin-top: 12px; }
.note { color: var(--muted); font-size: 0.88rem; }
.kv { font-size: 0.82rem; border-collapse: collapse; width: 100%; }
.kv td, .kv th { padding: 2px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.kv th:first-child, .kv td:first-child { text-align: left; }
.akw-img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #000; }
input[type=range] { width: 100%; }
select { padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--fg); }

/* ------------------------------------------------ listing */
.listing td { padding: 2px 12px 2px 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88rem; }
.listing td.size { text-align: right; color: var(--muted); }
.tabs a.files { margin-left: auto; border-style: dashed; }
.panel label.check { display: block; margin: 2px 0; }
.series label.check, .orbs label.check { display: inline-block; }

/* ------------------------------------------------ documentation */
.doc { max-width: 980px; }
.doc h2 { margin-top: 1.8em; }
.doc dt { font-weight: 600; margin-top: 0.7em; }
.doc dd { margin-left: 1.2em; }
table.doc-table td { white-space: normal; text-align: left; vertical-align: top; }
table.doc-table td:first-child { font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------ accounts, forms, downloads */
.nav-user { display: flex; gap: 2px; margin-right: 10px; }
.nav-user a { color: var(--nav-fg); text-decoration: none; padding: 9px 8px; font-size: 0.9rem; }
.form-page { max-width: 460px; }
.form-page.wide { max-width: 760px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 0.92rem; }
.form input, .form textarea, .form select, .inline-form input {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--fg); font: inherit;
}
.form .btn { align-self: flex-start; }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.danger { color: var(--accent); }
a.btn { display: inline-block; text-decoration: none; }
.alert { border-left: 4px solid var(--accent); background: var(--panel); padding: 8px 12px; }
.ok { border-left: 4px solid #3a8a3a; background: var(--panel); padding: 8px 12px; }
.hp { position: absolute; left: -9999px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 3px 0; }
td.actions form { display: inline-flex; gap: 4px; margin: 2px 0; }
.status { padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--line); }
.status.pending { background: #fff4d6; color: #7a5500; }
.status.accepted, .status.user { background: #e3f2e3; color: #245c24; }
.status.installed, .status.admin { background: #e1ecfb; color: #1b4b8f; }
.status.rejected { background: #fbe4e2; color: #8f1d12; }
.badge { font-size: 0.72rem; font-weight: 500; padding: 1px 6px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.download-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .download-grid { grid-template-columns: 1fr; } }
.dl-section h2 { font-size: 1.15rem; margin: 1.2em 0 0.3em; }
.dl-section:first-child h2 { margin-top: 0; }
.dl-list { padding-left: 1.2em; }
.dl-list li { margin: 4px 0; }
.dl-group { margin: 0 0 12px; }
.dl-group legend { font-weight: 600; padding: 0 4px; }
progress { width: 100%; }
.kv-left td, .kv-left td:first-child { text-align: left; } .kv-left td:first-child { color: var(--muted); width: 9em; }

/* ------------------------------------------------ input generator */
.ptable { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.ptable th, .ptable td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ptable th { white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }
.ptable input, .ptable select { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--fg); font: inherit; }
.ptable .pdesc { font-weight: 600; }
.ptable .phelp { color: var(--muted); }
.params-form h2 { font-size: 1.1rem; margin-top: 1.4em; }
.gen-file pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 0.82rem; }
.gen-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gen-head h2 { margin: 0.6em 1em 0.6em 0; font-size: 1.1rem; }
.tabs a.files + a.files { margin-left: 0; }
.counts { font-size: 1.05rem; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: inline-block; }
.home-links { font-size: 1.1rem; margin-top: 1.6em; }
.content > p, .content > ul { max-width: 52em; }
.lead { font-size: 1.08rem; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 0.92rem; }
.glossary dt { font-size: 1.02rem; margin-top: 1.1em; }
.glossary dd { margin: 0.3em 0 0 1.2em; }
.refs li { margin: 0.5em 0; }
