/* ═══════════════════════════════════════════════════════════════
   TERMINAL THEME — Rhet-Comp Index / Pinakes
   80s CRT / green-phosphor aesthetic
   Override file: requires style.css as base.
   Activated by adding class "terminal" to <html>
   localStorage key 'rc-theme' = 'terminal'
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* ── CSS variable overrides ──────────────────────────────────── */
html.terminal body {
  --bg:            #070a07;
  --bg-sidebar:    #040704;
  --border:        #1a3a1a;
  --text:          #d4f0d4;
  --text-muted:    #7ab87a;
  --text-light:    #3d6e3d;
  --accent:        #00ff41;
  --accent-hover:  #6fffaa;
  --link:          #00d4ff;
  --link-hover:    #7eeeff;
  --active-bg:     #0a1f0a;
  --sidebar-hover: #0c1f0c;
  --font-body:     'Share Tech Mono', 'Courier New', Courier, monospace;
  --font-ui:       'Share Tech Mono', 'Courier New', Courier, monospace;
  --font-mono:     'Share Tech Mono', 'Courier New', Courier, monospace;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

/* ── Scanline overlay ────────────────────────────────────────── */
html.terminal body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 9997;
}

/* ── Sharp corners everywhere ────────────────────────────────── */
html.terminal .src-badge,
html.terminal .search-input,
html.terminal .search-btn,
html.terminal .filter-select,
html.terminal .filter-apply-btn,
html.terminal .filter-pill,
html.terminal .article-tag,
html.terminal .oa-badge,
html.terminal .export-btn,
html.terminal .fetch-btn,
html.terminal .alpha-link,
html.terminal .accordion-nav,
html.terminal .accordion-card,
html.terminal .tool-card,
html.terminal .network-container,
html.terminal .heatmap-tooltip,
html.terminal .journal-filter,
html.terminal .new-badge,
html.terminal .fetch-status,
html.terminal .citnet-journal-summary,
html.terminal .citnet-journal-list,
html.terminal .citnet-search-input,
html.terminal .citnet-legend-dot,
html.terminal .citnet-container,
html.terminal .ego-container,
html.terminal .theme-toggle-btn,
html.terminal .coverage-table-wrap,
html.terminal .coverage-pct-bar,
html.terminal .coverage-pct-bar-fill,
html.terminal .citation-coverage-note,
html.terminal .citation-block,
html.terminal .most-cited-count,
html.terminal .most-cited-control-group select,
html.terminal .most-cited-control-group input,
html.terminal .most-cited-view-tab,
html.terminal .network-toolbar,
html.terminal .net-select,
html.terminal .net-search,
html.terminal .net-btn,
html.terminal .net-infobar,
html.terminal .author-filter-input,
html.terminal .books-filter-bar,
html.terminal .books-filter-input,
html.terminal .books-filter-select,
html.terminal .books-filter-btn,
html.terminal .book-card,
html.terminal .book-card-type,
html.terminal .book-detail-link,
html.terminal .author-insights,
html.terminal #author-network-container,
html.terminal .author-topic-bar {
  border-radius: 0;
}

/* ── Sidebar header ──────────────────────────────────────────── */
html.terminal .sidebar-header h1 {
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
}

html.terminal .sidebar-header h1::after {
  content: '_';
  animation: blink 1.1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

html.terminal .sidebar-header .subtitle {
  font-style: normal;
  letter-spacing: 0.04em;
}

/* ── Nav section heads ───────────────────────────────────────── */
html.terminal .nav-section-head {
  font-weight: normal;
  letter-spacing: 0.12em;
}

html.terminal .unavailable-head { color: #2a4a2a; }

/* ── Journal links ───────────────────────────────────────────── */
html.terminal .journal-link {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
}

html.terminal .journal-link.active {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

/* ── Source badges ───────────────────────────────────────────── */
html.terminal .src-badge {
  font-weight: normal;
  letter-spacing: 0.06em;
}

html.terminal .src-badge.rss {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

html.terminal .src-badge.scrape {
  background: transparent;
  color: #ffd700;
  border: 1px solid #806800;
}

/* ── Fetch button ────────────────────────────────────────────── */
html.terminal .fetch-btn {
  font-size: 0.72rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

html.terminal .fetch-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
  text-shadow: none;
}

html.terminal .fetch-btn:disabled { opacity: 0.4; }

/* ── Content header ──────────────────────────────────────────── */
html.terminal .content-header {
  border-bottom: 1px solid var(--border);
}

html.terminal .content-header h2 {
  font-size: 1rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.35);
}

html.terminal .content-header h2::before {
  content: '>  ';
  color: var(--text-light);
}

/* ── Search & filter bar ─────────────────────────────────────── */
html.terminal .search-input {
  font-size: 0.85rem;
  border-radius: 0;
  background: #000;
}

html.terminal .search-input::placeholder {
  font-style: normal;
}

html.terminal .search-btn {
  font-size: 0.72rem;
  font-weight: normal;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s;
}

html.terminal .search-btn:hover {
  background: var(--accent);
  color: #000;
}

html.terminal .filter-select {
  border-radius: 0;
  background: #000;
}

html.terminal .filter-apply-btn {
  background: transparent;
  transition: border-color 0.12s, color 0.12s;
}

html.terminal .filter-apply-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ── Filter pills ────────────────────────────────────────────── */
html.terminal .filter-pill {
  font-size: 0.68rem;
  background: var(--active-bg);
}

html.terminal .pill-label { font-style: normal; }

html.terminal .pill-remove:hover { color: var(--accent); }

/* ── Article tags ────────────────────────────────────────────── */
html.terminal .article-tag {
  font-size: 0.62rem;
  color: var(--text-light);
  background: transparent;
  transition: border-color 0.1s, color 0.1s;
}

html.terminal .article-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Keywords ────────────────────────────────────────────────── */
html.terminal .keywords-label { font-style: normal; }

/* ── Period sections ─────────────────────────────────────────── */
html.terminal .period-heading {
  font-weight: normal;
  letter-spacing: 0.1em;
}

html.terminal .period-heading::before { content: '── '; }
html.terminal .period-heading::after  { content: ' ──'; }

/* ── Article list ────────────────────────────────────────────── */
html.terminal .article-journal {
  font-style: normal;
}

html.terminal .article-title {
  font-size: 1rem;
  font-weight: normal;
  color: var(--text);
  transition: color 0.1s;
}

html.terminal .article-authors.no-data {
  font-style: normal;
}

/* ── Abstract toggle ─────────────────────────────────────────── */
html.terminal .abstract-toggle summary::before {
  content: "+";
  font-size: 0.8rem;
  transition: none;
}

html.terminal .abstract-toggle[open] summary::before {
  content: "−";
  transform: none;
}

/* ── Fetch status toast ──────────────────────────────────────── */
html.terminal .fetch-status {
  background: #000;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
}

/* ── Feature nav ─────────────────────────────────────────────── */
html.terminal .feature-nav-link {
  font-size: 0.72rem;
  font-weight: normal;
  transition: background 0.1s, color 0.1s;
}

html.terminal .feature-nav-link:hover {
  background: var(--sidebar-hover);
}

html.terminal .active-feature-link {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.35);
}

html.terminal .new-badge {
  font-weight: normal;
  color: #000;
  border-radius: 0;
}

/* ── OA badge ────────────────────────────────────────────────── */
html.terminal .oa-badge {
  font-weight: normal;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

html.terminal .oa-badge:hover {
  background: var(--accent);
  color: #000;
}

/* ── Export buttons ───────────────────────────────────────────── */
html.terminal .export-btn {
  background: transparent;
  transition: border-color 0.1s, color 0.1s;
}

html.terminal .export-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ── Article detail page ─────────────────────────────────────── */
html.terminal .detail-header {
  border-bottom: 1px solid var(--border);
}

html.terminal .detail-title {
  font-size: 1.2rem;
  font-weight: normal;
  color: var(--text);
}

html.terminal .detail-title a { color: var(--text); }

html.terminal .detail-section-head {
  font-weight: normal;
  letter-spacing: 0.1em;
}

html.terminal .detail-section-head::before {
  content: '// ';
  color: var(--border);
}

html.terminal .detail-fields dt {
  font-weight: normal;
  color: var(--text-light);
}

/* ── Authors list page ───────────────────────────────────────── */
html.terminal .alpha-link {
  font-weight: normal;
  transition: border-color 0.1s, background 0.1s;
}

html.terminal .alpha-link:hover {
  border-color: var(--accent);
}

html.terminal .alpha-link-active {
  color: #000;
}

/* ── Explore page ────────────────────────────────────────────── */
html.terminal .explore-tab {
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html.terminal .explore-tab.active {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* ── Accordion nav ───────────────────────────────────────────── */
html.terminal .accordion-question {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

html.terminal .accordion-card:hover {
  box-shadow: none;
}

html.terminal .accordion-card-name {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html.terminal .accordion-card.active .accordion-card-name {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

html.terminal .accordion-browse-link {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Browse All Tools page ───────────────────────────────────── */
html.terminal .tools-section-heading {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

html.terminal .tool-card:hover {
  box-shadow: none;
}

/* ── Network / chart containers ──────────────────────────────── */
html.terminal .network-container {
  background: #010901;
}

html.terminal .explore-hint {
  font-style: normal;
}

html.terminal .loading-msg::before {
  content: '> ';
  color: var(--accent);
}

/* ── D3 tooltip ──────────────────────────────────────────────── */
html.terminal .heatmap-tooltip {
  background: #000;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.15);
}

/* ── Responsive (720px) ──────────────────────────────────────── */
@media (max-width: 720px) {
  html.terminal .journal-link {
    border-radius: 0;
  }

  html.terminal .journal-link.active {
    background: var(--active-bg);
    color: var(--accent);
    border-color: var(--accent);
  }
}

/* ── Journal filter dropdown ─────────────────────────────────── */
html.terminal .journal-filter-summary {
  font-weight: normal;
}

html.terminal .dropdown-arrow { color: var(--text-light); }

html.terminal .journal-check-label.all-journals-label {
  font-weight: normal;
}

html.terminal .journal-check-label.unavailable { opacity: 0.3; }

/* ── Citation context ────────────────────────────────────────── */
html.terminal .citation-col-head {
  font-weight: normal;
  letter-spacing: 0.07em;
}

html.terminal .citation-count { font-weight: normal; }

html.terminal .citation-pending,
html.terminal .citation-empty {
  font-style: normal;
}

html.terminal .citation-item--ext {
  border-left-color: #0d1f0d;
  opacity: 0.75;
}

html.terminal .citation-outside-count {
  font-style: normal;
}

/* ── Citations page (ego network) ────────────────────────────── */
html.terminal .ego-header {
  border-bottom: 1px solid var(--border);
}

html.terminal .ego-title {
  font-size: 1.1rem;
  font-weight: normal;
}

html.terminal .ego-container {
  background: #010901;
}

/* ── Explore: Citations tab ──────────────────────────────────── */
html.terminal .citations-toolbar > .filter-label {
  font-weight: normal;
}

html.terminal .most-cited-rank {
  font-weight: normal;
}

html.terminal .most-cited-title a {
  color: var(--text);
}

html.terminal .most-cited-title a:hover {
  color: var(--link-hover);
}

html.terminal .most-cited-count {
  font-weight: normal;
  background: #0a1f0a;
  border: 1px solid var(--border);
}

/* ── Citation Network tab ────────────────────────────────────── */
html.terminal .citnet-journal-list {
  background: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 255, 65, 0.1);
}

html.terminal .citnet-search-input {
  background: #000;
}

html.terminal .citnet-container {
  background: #010901;
}

/* ── Theme toggle button ─────────────────────────────────────── */
html.terminal .theme-toggle-btn {
  font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

html.terminal .theme-toggle-btn:hover {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.5);
}

/* ── Dropdown feature nav ────────────────────────────────────── */
html.terminal .nav-item-trigger,
html.terminal .nav-item > a.feature-nav-link {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.terminal .nav-item-trigger:hover,
html.terminal .nav-item > a.feature-nav-link:hover {
  color: var(--accent);
}

html.terminal .nav-dropdown {
  border-left-color: var(--accent);
}

html.terminal .nav-dropdown-item {
  letter-spacing: 0.03em;
}

html.terminal .nav-dropdown-item:hover {
  color: var(--accent);
}

/* ── Tab intro ───────────────────────────────────────────────── */
html.terminal .tab-intro {
  border-left-color: var(--accent);
}

/* ── Coverage panel ──────────────────────────────────────────── */
html.terminal .coverage-toggle {
  letter-spacing: 0.04em;
}

html.terminal .coverage-table th {
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.terminal .coverage-note {
  letter-spacing: 0.03em;
}

html.terminal .citation-coverage-note {
  border-left-color: var(--accent);
}

/* ── Most-cited page ─────────────────────────────────────────── */
html.terminal .most-cited-control-group label {
  color: var(--accent);
  letter-spacing: 0.06em;
}

html.terminal .most-cited-control-group select,
html.terminal .most-cited-control-group input {
  color: var(--accent);
}

html.terminal .most-cited-view-tab {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html.terminal .most-cited-view-tab:hover { color: var(--accent); }

html.terminal .most-cited-view-tab.active {
  font-weight: 700;
}

html.terminal .most-cited-group-head {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

html.terminal .show-more-btn {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── About page ──────────────────────────────────────────────── */
html.terminal .about-nav-home {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.terminal .about-nav-home:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

html.terminal .about-nav-links a {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html.terminal .about-nav-links a:hover { color: var(--accent); }

html.terminal .about-title {
  color: var(--accent);
}

html.terminal .about-section h2 {
  color: var(--accent);
}

html.terminal .citation-block {
  color: var(--accent);
  border-left-color: var(--accent);
}

html.terminal .about-page-footer {
  letter-spacing: 0.04em;
}

html.terminal .about-page-footer a:hover { color: var(--accent); }

/* ── Sidebar about link ──────────────────────────────────────── */
html.terminal .sidebar-about-link {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.terminal .sidebar-about-link:hover {
  color: var(--accent);
}

