/* PadhneSathi — shared base styles.
   This file is linked from every page instead of being repeated inline, so
   the browser downloads it once and reuses it (from cache) on every other
   page in the site — landing, browse, dashboard, view, admin, etc.
   Colors still come from the per-page :root{...} custom properties that
   render_theme_vars() prints inline (those depend on the signed-in user's
   chosen theme, so they can't live in a static, cacheable file). */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
/* Belt-and-braces: stops any element that's slightly too wide (a long
   unbroken word/URL, a third-party embed, etc.) from opening up horizontal
   page-scroll on a phone. Only clips the X axis — vertical scrolling and
   position:sticky both keep working normally. */
html, body { overflow-x: hidden; max-width: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); }
img, video, iframe, embed { max-width: 100%; }

/* ---- Shared header / nav shell (used on every logged-in & browse page) ---- */
header {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
header a.brand {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 19px; text-decoration: none;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
header a.back { color: var(--text-dim); text-decoration: none; font-size: 14px; }
header a.back:hover { color: var(--gold); }
header nav a { color: var(--text-dim); text-decoration: none; margin-left: 16px; font-size: 14px; font-weight: 500; transition: color .15s; }
header nav a:hover { color: var(--gold); }

/* ---- Shared form focus state ---- */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }

/* ---- Shared primary submit button ---- */
button.submit {
  background: linear-gradient(90deg, var(--gold), var(--gold-dark)); color: var(--btn-text); border: none;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-family: 'Poppins', sans-serif;
}
button.submit:hover { filter: brightness(1.08); }

/* ---- Shared content-type badges ---- */
.badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 10px; font-weight: 600; }
.badge.video { background: rgba(139,92,246,.15); color: #b39dfb; }
.badge.pdf { background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold); }
.badge.article { background: rgba(56,189,248,.15); color: #38bdf8; }

@media (max-width: 640px) {
  header { padding: 12px 16px; }
}

/* ---- Fast PDF viewer (assets/js/pdf-fast-viewer.js) ---- */
.fastpdf {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  background: var(--bg-elevated); border-radius: 10px; overflow: hidden;
}
.fastpdf-toolbar {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  background: var(--bg-card); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.fastpdf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); cursor: pointer; font-size: 14px;
  text-decoration: none; line-height: 1;
}
.fastpdf-btn:hover { border-color: var(--gold); color: var(--gold); }
.fastpdf-gap { flex: 1; }
.fastpdf-page-indicator { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }
.fastpdf-page-input {
  width: 42px; text-align: center; background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px; font-size: 12px; padding: 3px 2px;
}
.fastpdf-canvas-wrap {
  position: relative; flex: 1; overflow: auto; display: flex; justify-content: center;
  padding: 10px; background: #4b4b4b;
}
.fastpdf-canvas { max-width: 100%; height: auto; box-shadow: 0 4px 18px rgba(0,0,0,.35); background: #fff; }
.fastpdf-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #eee; background: rgba(0,0,0,.25);
}
