﻿:root {
  --bg: #0b0d10;
  --card: #12161b;
  --text: #e9eef5;
  --muted: #aab3c2;
  --border: rgba(255,255,255,0.08);

  /* Clearlooks tokens */
  --paper: #edebe9;
  --ink: #2e3436;
  --indigo: #3465a4;
  --muted-ink: #555753;

  /* Window chrome - Clearlooks style */
  --win-border-outer: #888a85;
  --win-border-inner: #ffffff;
  --win-shadow: 0 2px 8px rgba(0,0,0,0.25);
  --radius: 5px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 40% at 50% 0%, rgba(30,40,100,0.20), transparent),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* Light theme scope — percentage ellipses scale with viewport, never tile */
body.theme-paper {
  background:
    radial-gradient(ellipse 120% 55% at 50% 0%, rgba(42,47,143,0.10), transparent),
    radial-gradient(ellipse 90% 45% at 20% 25%, rgba(0,0,0,0.05), transparent),
    var(--paper);
  background-repeat: no-repeat;
  color: var(--ink);
}

/* .wrap max-width is intentionally the same in both themes to prevent layout shift on toggle */
body.theme-paper h1,
body.theme-paper .subtitle,
body.theme-paper .sub { color: rgba(11,13,16,0.72); }

/* Make links and accents indigo */
body.theme-paper a { color: var(--indigo); }

.wrap { max-width: 900px; margin: 0 auto; padding: 24px 18px; }

.site-footer {
  max-width: 900px;
  margin: 24px auto 12px;
  padding: 0 18px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
body.theme-paper .site-footer { color: var(--muted-ink); }
body.theme-paper .site-footer a { color: var(--muted-ink); }
body.theme-paper .site-footer a:hover { color: var(--indigo); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 22px; }
.sub { margin-top: 4px; color: var(--muted); font-size: 13px; }

.topRight { display: flex; align-items: center; gap: 16px; }
.topBtns { display: flex; gap: 10px; }

/* Auth UI */
#authUI { display: flex; align-items: center; }

.userMenu {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}

.userName {
  font-size: 14px;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown {
  position: relative;
}

.dropdownBtn {
  padding: 6px 8px !important;
  font-size: 16px;
  line-height: 1;
}

.dropdownContent {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 100;
  overflow: hidden;
}

.dropdownContent.show {
  display: block;
}

.dropdownContent a,
.dropdownContent button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.15s;
}

.dropdownContent a:hover,
.dropdownContent button:hover {
  background: rgba(255,255,255,0.06);
}

.logoutBtn {
  border-top: 1px solid var(--border);
  color: #ff8080 !important;
}

.card {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.meta { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.authors { margin-top: 10px; font-size: 14px; }

.abstractLabel { margin-top: 14px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.abstract {
  margin-top: 8px;
  font-size: 15px;          /* bumped from 14px */
  line-height: 1.7;         /* increased readability */
  white-space: pre-wrap;
}

/* Collapsed abstract: show ~12 lines */
.abstract.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 12;   /* adjust 10–12; using 12 here */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Show more/less link */
.abstractToggle {
  margin-top: 10px;
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.abstractToggle:hover {
  text-decoration: underline;
}

.linkRow { margin-top: 14px; }
a.linkBtn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  text-decoration: none;
}

.actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.btn:hover { background: rgba(255,255,255,0.06); }

.btn.pass { background: rgba(255, 80, 80, 0.10); }
.btn.like { background: rgba(80, 200, 120, 0.10); }
.btn.super { background: rgba(255, 210, 80, 0.12); }
.btn.ghost { padding: 6px 12px; }

.debug { margin-top: 12px; color: var(--muted); font-size: 12px; }

/* --- Clearlooks window chrome --- */
.win {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--win-border-outer);
  border-radius: var(--radius);
  box-shadow: var(--win-shadow), inset 0 0 0 1px var(--win-border-inner);
  overflow: hidden;
}

.winBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: linear-gradient(to bottom, #f7f6f5 0%, #e0deda 100%);
  border-bottom: 1px solid #babdb6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
}

.winTitle {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.winTitle small {
  font-weight: 400;
  color: var(--muted-ink);
  font-size: 12px;
}

.winDots {
  display: flex;
  gap: 5px;
}

.winDot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #888a85;
  background: linear-gradient(to bottom, #f5f4f2 0%, #d3d0cc 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.8);
}

.winBody {
  padding: 12px;
}

/* Clearlooks form controls */
.win input,
.win select,
.win textarea {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid #babdb6;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  font-size: 13px;
}

.win input::placeholder,
.win textarea::placeholder {
  color: #888a85;
}

/* Clearlooks input focus */
.win input:focus,
.win select:focus,
.win textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 0 0 2px rgba(52,101,164,0.25);
}

/* Clearlooks button styling */
.win .btn {
  background: linear-gradient(to bottom, #f7f6f5 0%, #d3d0cc 100%);
  color: var(--ink);
  border: 1px solid #888a85;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 1px rgba(0,0,0,0.1);
  transition: none;
}

.win .btn:hover {
  background: linear-gradient(to bottom, #fafaf9 0%, #d8d5d1 100%);
  transform: none;
}

.win .btn:active {
  background: linear-gradient(to bottom, #d0cdc9 0%, #e8e6e3 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
  transform: none;
}

/* -----------------------------------------------
   Feed page — light theme (body.theme-paper)
   ----------------------------------------------- */

/* Window positioning */
.feed-win {
  margin-top: 14px;
}

/* Header buttons (outside .win) — same values as .win .btn (the gold standard) */
body.theme-paper header .btn {
  background: linear-gradient(to bottom, #f7f6f5 0%, #d3d0cc 100%);
  color: var(--ink);
  border: 1px solid #888a85;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 1px rgba(0,0,0,0.1);
  transition: none;
}
body.theme-paper header .btn:hover {
  background: linear-gradient(to bottom, #fafaf9 0%, #d8d5d1 100%);
  transform: none;
}
body.theme-paper header .btn:active {
  background: linear-gradient(to bottom, #d0cdc9 0%, #e8e6e3 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
  transform: none;
}

/* Colored action buttons — Clearlooks tinted */
body.theme-paper .btn.pass {
  background: linear-gradient(to bottom, #ffcdd2 0%, #ef9a9a 100%);
  border-color: #e57373;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 1px rgba(0,0,0,0.1);
}
body.theme-paper .btn.pass:hover {
  background: linear-gradient(to bottom, #ffd7db 0%, #f4adad 100%);
}
body.theme-paper .btn.like {
  background: linear-gradient(to bottom, #c8e6c9 0%, #a5d6a7 100%);
  border-color: #81c784;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 1px rgba(0,0,0,0.1);
}
body.theme-paper .btn.like:hover {
  background: linear-gradient(to bottom, #d4edcf 0%, #b2dfb4 100%);
}
body.theme-paper .btn.super {
  background: linear-gradient(to bottom, #fff9c4 0%, #fff176 100%);
  border-color: #fdd835;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 1px rgba(0,0,0,0.1);
}
body.theme-paper .btn.super:hover {
  background: linear-gradient(to bottom, #fffde7 0%, #fff59d 100%);
}

/* Paper content colors */
body.theme-paper .title      { color: var(--ink); }
body.theme-paper .meta       { color: var(--muted-ink); }
body.theme-paper .authors    { color: var(--ink); font-size: 13px; }
body.theme-paper .abstractLabel { color: var(--muted-ink); }
body.theme-paper .abstract   { color: var(--ink); }
body.theme-paper .abstractToggle { color: var(--indigo); }
body.theme-paper .debug      { color: var(--muted-ink); }

/* Open paper link */
body.theme-paper a.linkBtn {
  border: 1px solid #babdb6;
  border-radius: 3px;
  color: var(--indigo);
  background: linear-gradient(to bottom, #f7f6f5 0%, #e8e6e3 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 1px rgba(0,0,0,0.08);
  font-size: 13px;
}
body.theme-paper a.linkBtn:hover {
  background: linear-gradient(to bottom, #fafaf9 0%, #eeebe8 100%);
}

/* Auth dropdown in light theme */
body.theme-paper .dropdownContent {
  background: var(--paper);
  border: 1px solid #babdb6;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
body.theme-paper .dropdownContent a,
body.theme-paper .dropdownContent button {
  color: var(--ink);
  font-size: 13px;
}
body.theme-paper .dropdownContent a:hover,
body.theme-paper .dropdownContent button:hover {
  background: rgba(0,0,0,0.05);
}
body.theme-paper .logoutBtn {
  border-top: 1px solid #babdb6;
  color: #cc3333 !important;
}

/* Avatar + username */
body.theme-paper .avatar   { border-color: #babdb6; }
body.theme-paper .userName { color: var(--ink); font-size: 13px; }

/* -----------------------------------------------
   Dark mode (High Contrast Inverse) — win overrides
   The base body dark styles apply automatically;
   these undo the hardcoded light colors in .win chrome.
   ----------------------------------------------- */

body:not(.theme-paper) .win {
  background: var(--card);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
  /* mirrors light: outer shadow + inset 1px inner highlight */
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.05);
}

body:not(.theme-paper) .winBar {
  background: linear-gradient(to bottom, #252b36 0%, #1a2028 100%);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  color: var(--text);
}

body:not(.theme-paper) .winTitle       { color: var(--text); }
body:not(.theme-paper) .winTitle small { color: var(--muted); }

body:not(.theme-paper) .winDot {
  background: linear-gradient(to bottom, #2d3340 0%, #1e2530 100%);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.08);
}

/* Dark mode — all buttons use Clearlooks gradient structure with dark palette */
body:not(.theme-paper) .btn {
  background: linear-gradient(to bottom, #2d3340 0%, #1e2530 100%);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 1px rgba(0,0,0,0.35);
  transition: none;
}
body:not(.theme-paper) .btn:hover {
  background: linear-gradient(to bottom, #343b4a 0%, #252d3c 100%);
  transform: none;
}
body:not(.theme-paper) .btn:active {
  background: linear-gradient(to bottom, #1a2030 0%, #2a3240 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.45);
  transform: none;
}

/* Dark action buttons — same Clearlooks structure, saturated dark tints */
body:not(.theme-paper) .btn.pass {
  background: linear-gradient(to bottom, #5c1a1a 0%, #3d0f0f 100%);
  border-color: #c62828;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 1px rgba(0,0,0,0.35);
}
body:not(.theme-paper) .btn.pass:hover {
  background: linear-gradient(to bottom, #6d2020 0%, #4a1414 100%);
}
body:not(.theme-paper) .btn.like {
  background: linear-gradient(to bottom, #1a4a1a 0%, #0f3a0f 100%);
  border-color: #388e3c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 1px rgba(0,0,0,0.35);
}
body:not(.theme-paper) .btn.like:hover {
  background: linear-gradient(to bottom, #205520 0%, #154515 100%);
}
body:not(.theme-paper) .btn.super {
  background: linear-gradient(to bottom, #4a4000 0%, #3a3200 100%);
  border-color: #f9a825;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 1px rgba(0,0,0,0.35);
}
body:not(.theme-paper) .btn.super:hover {
  background: linear-gradient(to bottom, #554a00 0%, #453c00 100%);
}

/* Dark mode — content colors */
body:not(.theme-paper) .title        { color: var(--text); }
body:not(.theme-paper) .meta         { color: var(--muted); }
body:not(.theme-paper) .authors      { color: var(--text); }
body:not(.theme-paper) .abstractLabel{ color: var(--muted); }
body:not(.theme-paper) .abstract     { color: var(--text); }
body:not(.theme-paper) .abstractToggle { color: var(--muted); }
body:not(.theme-paper) .debug        { color: var(--muted); }

body:not(.theme-paper) a.linkBtn {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  color: var(--text);
  background: linear-gradient(to bottom, #2d3340 0%, #1e2530 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 1px rgba(0,0,0,0.35);
}
body:not(.theme-paper) a.linkBtn:hover {
  background: linear-gradient(to bottom, #343b4a 0%, #252d3c 100%);
}
