@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* =====================================================
   STAR SEEKER — DESIGN SYSTEM
   Dark Anime Aesthetic (Red / Purple / Black)
   ===================================================== */

:root {
  --bg: #020005;
  --bg-trans: rgba(2, 0, 5, 0.85);
  --bg2: #0a000e;
  --surface: rgba(30, 0, 40, 0.3);
  --border: rgba(180, 0, 60, 0.3);
  --border-focus: rgba(255, 30, 60, 0.6);
  --accent1: #9e0031;
  --accent2: #5a004b;
  --teal: #00c8b4;
  --violet: #8b5cf6;
  --text: #e0d0d8;
  --text-dim: #8a7080;
  --text-muted: #5a4050;
  --red: #ff1e3c;
  --font-mono: 'Share Tech Mono', monospace;
  --font-head: 'Rajdhani', sans-serif;
  --glow-accent: 0 0 10px rgba(158, 0, 49, 0.5), 0 0 20px rgba(90, 0, 75, 0.3);
  --glow-red: 0 0 8px rgba(255, 30, 60, 0.6), 0 0 24px rgba(255, 30, 60, 0.2);
}

/* --- Reset ----------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  background: transparent;
  /* Changed to show negative z-index background */
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- Random Background Image ------------------------- */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: -5;
  /* Bottom layer */
  pointer-events: none;
  background-color: var(--bg);
  /* Fallback base color */
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.25;
  transition: background-image 0.5s ease-in-out;
}

/* --- Vignette Overlay ------------------------------- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle at center, transparent 30%, rgba(2, 0, 5, 0.9) 100%);
}

#noise-canvas {
  display: none;
}

/* Removed old noise canvas */

/* =====================================================
   PAGE WRAPPER
   ===================================================== */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
.glitch-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent1);
  text-shadow: var(--glow-accent);
  position: relative;
  user-select: none;
  opacity: 0.9;
}

.glitch-title::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent1), transparent);
  margin-top: 10px;
  width: 60%;
  margin-inline: auto;
}

.quote {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: #b09ba5;
  letter-spacing: 0.12em;
  text-align: center;
  margin-top: 1.5rem;
  font-style: italic;
  opacity: 0.8;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(10, 0, 14, 0.6);
  color: var(--text);
  padding: 0.6rem 2rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  background: rgba(158, 0, 49, 0.2);
  border-color: var(--border-focus);
  color: #fff;
  box-shadow: var(--glow-accent);
}

.btn-red {
  border-color: var(--border);
  color: var(--red);
}

.btn-red:hover {
  background: rgba(255, 30, 60, 0.15);
  border-color: var(--red);
  box-shadow: var(--glow-red);
}

.btn-sm {
  font-size: 0.72rem;
  padding: 0.5rem 1.5rem;
}

.btn-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2.5rem;
}

/* =====================================================
   PANELS / CARDS
   ===================================================== */
.panel {
  background: var(--bg-trans);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.panel-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--accent1);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.panel-body {
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text);
}

/* =====================================================
   INPUT FIELDS
   ===================================================== */
.terminal-field {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  transition: all 0.3s;
}

.terminal-field:focus-within {
  border-color: var(--accent1);
  box-shadow: 0 0 10px rgba(158, 0, 49, 0.2);
}

.terminal-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  width: 100%;
  letter-spacing: 0.1em;
}

.terminal-input::placeholder {
  color: var(--text-muted);
}

/* =====================================================
   TOAST NOTIFICATION
   ===================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(4rem);
  background: rgba(20, 0, 10, 0.95);
  border: 1px solid var(--accent1);
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  padding: 0.75rem 2rem;
  z-index: 10000;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =====================================================
   PROGRESS
   ===================================================== */
.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent1);
  transition: width 0.3s ease;
  position: relative;
}

.progress-indeterminate .progress-fill {
  width: 40% !important;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(300%);
  }
}

/* =====================================================
   BOOK CARDS
   ===================================================== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  width: 100%;
  padding: 1rem 0;
}

.book-card {
  background: var(--bg-trans);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.book-card:hover {
  border-color: var(--accent1);
  background: rgba(40, 0, 20, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.book-cover {
  width: 60px;
  height: 85px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.book-cover-placeholder {
  width: 60px;
  height: 85px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.book-info {
  flex: 1;
  min-width: 0;
}

.book-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.8rem;
  color: #b09ba5;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-details {
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================
   MODAL / OVERLAY
   ===================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

.overlay.hidden {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 2.5rem;
  width: 90%;
  max-width: 550px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s;
  font-family: var(--font-mono);
}

.modal-close:hover {
  color: var(--red);
}

/* =====================================================
   GUIDE PANEL (collapsible)
   ===================================================== */
.guide-toggle {
  position: fixed;
  top: 4.5rem;
  /* LOWERED to avoid overlap with auth/logout */
  right: 1.5rem;
  z-index: 100;
  font-size: 0.72rem;
}

.guide-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 90vw);
  height: 100vh;
  background: rgba(8, 0, 12, 0.95);
  backdrop-filter: blur(10px);
  border-left: 1px solid var(--border);
  z-index: 99;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-drawer.open {
  transform: translateX(0);
}

.guide-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.guide-step-num {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--accent1);
  opacity: 0.5;
  flex-shrink: 0;
  line-height: 1;
}

.guide-step-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}

.guide-step-text strong {
  color: #fff;
  font-weight: 600;
}

/* =====================================================
   TERMINAL LOG
   ===================================================== */
.term-log {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border);
  padding: 1rem;
  font-size: 0.8rem;
  height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scroll-behavior: smooth;
}

.term-log .log-line {
  color: var(--text-dim);
}

.term-log .log-line.active {
  color: var(--text);
}

.term-log .log-line.error {
  color: var(--red);
}

.term-log .log-line.done {
  color: var(--accent1);
}

/* =====================================================
   SEARCH BAR
   ===================================================== */
.search-wrap {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 3rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
}

.search-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1rem;
  background: rgba(15, 0, 20, 0.85);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  padding: 1rem 1.5rem;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--border-focus);
  background: rgba(30, 0, 40, 0.95);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  background: var(--accent1);
  color: #fff;
  border: 1px solid var(--accent1);
  padding: 0 2rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.3s;
  flex-shrink: 0;
}

.search-btn:hover {
  background: #ce0040;
}

/* =====================================================
   EXTENSION FILTERING
   ===================================================== */
.filter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 720px;
  margin: -1.5rem auto 2rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(158, 0, 49, 0.15);
  background: rgba(2, 0, 5, 0.5);
  backdrop-filter: blur(4px);
}

.filter-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.filter-primary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-more-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  background: none;
  border: 1px solid rgba(90, 64, 80, 0.5);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.filter-more-btn:hover {
  border-color: var(--accent1);
  color: var(--text);
}

.filter-more-btn.active {
  border-color: var(--accent1);
  color: var(--accent1);
}

.filter-extended {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(158, 0, 49, 0.15);
  animation: fade-in 0.2s ease;
}

.filter-item {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.filter-item input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.filter-box {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(90, 0, 75, 0.35);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  transition: all 0.2s ease;
  letter-spacing: 0.1em;
}

.filter-item:hover .filter-box {
  border-color: rgba(158, 0, 49, 0.6);
  color: var(--text-dim);
}

.filter-item input:checked~.filter-box {
  background: rgba(158, 0, 49, 0.18);
  border-color: var(--accent1);
  color: var(--text);
  box-shadow: 0 0 8px rgba(158, 0, 49, 0.25);
}

.filter-item input:checked~.filter-box::before {
  content: '▸ ';
  color: var(--accent1);
  font-size: 0.6rem;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* =====================================================
   STATUS BADGE
   ===================================================== */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.5);
}

.badge-fast {
  border: 1px solid var(--accent1);
  color: #ff9fb4;
}

.badge-slow {
  border: 1px solid var(--text-muted);
  color: var(--text-dim);
}

.badge-unk {
  border: 1px solid rgba(255, 30, 60, 0.3);
  color: rgba(255, 30, 60, 0.6);
}

.badge-annas {
  border: 1px solid var(--accent1);
  color: #ff9fb4;
}

.badge-calibre {
  border: 1px solid rgba(0, 200, 180, 0.5);
  color: rgba(0, 220, 200, 0.9);
}

.badge-libgen {
  border: 1px solid rgba(220, 140, 0, 0.5);
  color: rgba(240, 160, 20, 0.9);
}

/* =====================================================
   TOP NAV
   ===================================================== */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 20%, transparent);
}

.topnav-logo {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text);
  text-decoration: none;
}

/* =====================================================
   LANDING — CANVAS BACKGROUND
   ===================================================== */
#star-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* =====================================================
   SCROLL BAR
   ===================================================== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--teal);
}

/* =====================================================
   UTILITY
   ===================================================== */
.text-teal {
  color: var(--teal);
}

.text-violet {
  color: var(--violet);
}

.text-dim {
  color: var(--text-dim);
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.w-full {
  width: 100%;
}

.text-red {
  color: var(--red);
}

.text-accent1 {
  color: var(--accent1);
}

.btn-violet {
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--violet);
}

.btn-violet:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--violet);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.hidden {
  display: none !important;
}

/* =====================================================
   ERROR / SUCCESS STATES
   ===================================================== */
.field-error .terminal-field {
  border-color: var(--red);
  animation: shake 0.3s ease;
}

.field-error .terminal-prompt {
  color: var(--red);
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-4px);
  }

  40% {
    transform: translateX(4px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }
}

.field-success .terminal-field {
  border-color: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* =====================================================
   THREE-COLUMN SOURCE GRID & ANIMATIONS
   ===================================================== */
.panel-toggles {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.sources-grid {
  display: grid;
  /* Default 3-column layout uses specific fr sizing for dominance */
  /* Left/Right get 1fr when open, 0fr when closed. Center (Anna's) gets min 2fr. */
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 1400px;
  padding: 0 1.25rem 3rem;
  align-items: start;
  transition: grid-template-columns 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 
  Using CSS Grid animation trick:
  A grid column with an element inside can be animated to 0 width by changing the fr value.
*/

.sources-grid:has(#col-calibre.collapsed) {
  /* Left column collapsed */
  grid-template-columns:
    minmax(0, 0fr) minmax(0, 2.5fr) minmax(0, 1fr);
}

.sources-grid:has(#col-libgen.collapsed) {
  /* Right column collapsed */
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 0fr);
}

.sources-grid:has(#col-calibre.collapsed):has(#col-libgen.collapsed) {
  /* Both columns collapsed -> Anna's Archive dominates the center */
  grid-template-columns:
    minmax(0, 0fr) minmax(0, 3fr) minmax(0, 0fr);
}

@media (max-width: 960px) {
  .sources-grid {
    grid-template-columns: 1fr;
  }

  .sources-grid:has(#col-calibre.collapsed),
  .sources-grid:has(#col-libgen.collapsed),
  .sources-grid:has(#col-calibre.collapsed):has(#col-libgen.collapsed) {
    grid-template-columns: 1fr;
  }
}

.source-col {
  display: flex;
  flex-direction: column;
  background: rgba(2, 0, 5, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(180, 0, 60, 0.2);
  min-height: 200px;
  overflow: hidden;
  /* Important for grid shrink trick */
  opacity: 1;
  transition: opacity 0.4s ease, border-color 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.source-col.collapsed {
  opacity: 0;
  border-color: transparent;
  pointer-events: none;
}

/* Center Column prominence */
#col-annas {
  border-color: rgba(158, 0, 49, 0.5);
  background: rgba(10, 0, 15, 0.7);
  box-shadow: 0 0 20px rgba(158, 0, 49, 0.15);
}

.source-col {
  display: flex;
  flex-direction: column;
  background: rgba(2, 0, 5, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(180, 0, 60, 0.2);
  min-height: 200px;
}

/* --- Column Headers --- */
.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(180, 0, 60, 0.2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.col-header-annas {
  background: rgba(158, 0, 49, 0.12);
  border-bottom-color: rgba(158, 0, 49, 0.35);
  color: #ff9fb4;
}

.col-header-libgen {
  background: rgba(180, 100, 0, 0.1);
  border-bottom-color: rgba(220, 140, 0, 0.35);
  color: rgba(240, 160, 20, 0.95);
}

.col-header-calibre {
  background: rgba(0, 160, 140, 0.08);
  border-bottom-color: rgba(0, 200, 180, 0.3);
  color: rgba(0, 220, 200, 0.95);
}

.col-header-title {
  font-weight: 600;
}

.col-status {
  font-size: 0.65rem;
  opacity: 0.7;
  min-width: 1.5em;
  text-align: right;
}

/* --- Column Loading --- */
.col-loading {
  padding: 1.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

/* --- Column Error --- */
.col-error {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--red);
  text-align: center;
}

/* --- Column Results — vertical list instead of grid --- */
.col-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

/* Tighten book cards inside columns */
.col-results .book-card {
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(180, 0, 60, 0.12);
  padding: 0.75rem 0.9rem;
  gap: 0.75rem;
}

.col-results .book-card:hover {
  transform: none;
  background: rgba(40, 0, 20, 0.5);
  border-bottom-color: rgba(180, 0, 60, 0.25);
}

/* --- Column Pagination --- */
.col-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid rgba(180, 0, 60, 0.15);
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  gap: 0.5rem;
}

.col-pagination .btn {
  font-size: 0.65rem;
  padding: 0.3rem 0.8rem;
  letter-spacing: 0.08em;
}

.col-header-libgen~.col-pagination .btn,
#col-libgen .col-pagination .btn {
  border-color: rgba(220, 140, 0, 0.4);
  color: rgba(240, 160, 20, 0.85);
}

/* =====================================================
   TOP NAV LINKS (shared)
   ===================================================== */
.topnav-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #ffffff !important;
  text-decoration: none;
  text-transform: uppercase;
  border: none !important;
  border-bottom: 2px solid #ffffff !important;
  padding: 0.25rem 0.6rem;
  transition: all 0.2s ease;
}

.topnav-link:hover {
  opacity: 0.8;
}

.topnav-link-active {
  color: var(--violet) !important;
  border-bottom-color: var(--violet) !important;
  font-weight: 700;
}

/* SemVer Badges for News */
.badge-patch {
  border-color: rgba(0, 150, 255, 0.4) !important;
  color: #80cfff !important;
}

.badge-minor {
  border-color: rgba(220, 140, 0, 0.4) !important;
  color: #ffc44d !important;
}

.badge-major {
  border-color: rgba(158, 0, 49, 0.6) !important;
  color: #ff4d79 !important;
  font-weight: 700 !important;
}

/* --- News Layout Spacing --- */
.news-container {
  width: 100%;
  max-width: 800px;
  /* Slightly cap the width so it looks nicer */
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 3.5rem !important;
  /* EXTREME gap to guarantee we see the change */
  margin-top: 2rem;
}

.news-card {
  background: rgba(10, 0, 15, 0.75);
  border: 1px solid var(--border);
  padding: 1.8rem !important;
  /* More breathing room inside the card */
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.news-content {
  line-height: 2.0 !important;
  /* Very tall line height inside markdown */
  font-size: 0.9rem !important;
  color: #efdfeb;
}

/* =====================================================
   MAIN LAYOUT & CARDS
   ===================================================== */