/* sites/producertube/pt/theme.css — ProducerTube's design tokens and the
   shared chrome (top navigation, buttons, forms, cards, dialogs, toasts).
   Every colour on the site comes from a token here; components never carry
   their own hex values. */

:root {
  --pt-red: #e32636;
  --pt-red-hover: #ff4050;
  --pt-red-ink: #ffffff;
  --pt-bg: #111216;
  --pt-panel: #1b1d23;
  --pt-panel-2: #252831;
  --pt-panel-3: #2e323d;
  --pt-line: #383c45;
  --pt-text: #f5f5f5;
  --pt-dim: #a9abb4;
  --pt-faint: #6f727c;
  --pt-ok: #3ccf8e;
  --pt-warn: #f5b041;
  --pt-danger: #ff5c6c;
  --pt-solo: #ffd65a;
  --pt-focus: #ff8a94;
  --pt-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --pt-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pt-nav-h: 52px;
  /* the logo's lettering is black: it always sits on this light plate */
  --pt-logo-plate: #f5f5f5;
  --pt-radius: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body.pt-body {
  background: var(--pt-bg);
  color: var(--pt-text);
  font: 14px/1.45 var(--pt-font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--pt-red-hover); }
a:hover { color: var(--pt-text); }
:focus-visible { outline: 2px solid var(--pt-focus); outline-offset: 1px; }
.pt-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-dim { color: var(--pt-dim); }
.pt-faint { color: var(--pt-faint); }
.pt-small { font-size: 12px; }
.pt-mono { font-family: var(--pt-mono); }
.pt-spacer { flex: 1; }
.pt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- top navigation ---------- */

.pt-nav {
  height: var(--pt-nav-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  background: var(--pt-panel);
  border-bottom: 1px solid var(--pt-line);
  position: relative;
  z-index: 50;
}
.pt-logo { display: flex; align-items: center; margin-right: 10px; flex: none; border-radius: 6px; background: var(--pt-logo-plate); padding: 2px 6px; line-height: 0; }
.pt-logo img { height: 42px; width: auto; display: block; }
.pt-logo:focus-visible { outline-offset: 2px; }
/* the full logo, large (home page, sign-in) */
.pt-logo-hero { display: inline-block; background: var(--pt-logo-plate); border-radius: 14px; padding: 14px 22px; line-height: 0; }
.pt-logo-hero img { width: min(320px, 70vw); height: auto; display: block; }
.pt-nav__links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.pt-nav__links::-webkit-scrollbar { display: none; }
.pt-nav__link { color: var(--pt-dim); text-decoration: none; padding: 6px 10px; border-radius: var(--pt-radius); white-space: nowrap; font-size: 13px; }
.pt-nav__link:hover { color: var(--pt-text); background: var(--pt-panel-2); }
.pt-nav__link[aria-current="page"] { color: var(--pt-text); background: var(--pt-panel-2); box-shadow: inset 0 -2px 0 var(--pt-red); }
.pt-nav__auth { display: flex; align-items: center; gap: 8px; margin-left: auto; padding-left: 10px; white-space: nowrap; }
.pt-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--pt-panel-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--pt-text); overflow: hidden; }
.pt-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- controls ---------- */

.pt-btn {
  appearance: none;
  border: 1px solid var(--pt-line);
  background: var(--pt-panel-2);
  color: var(--pt-text);
  border-radius: var(--pt-radius);
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pt-btn:hover:not(:disabled) { border-color: var(--pt-red); color: var(--pt-text); }
.pt-btn:disabled { opacity: 0.45; cursor: default; }
.pt-btn--primary { background: var(--pt-red); border-color: var(--pt-red); color: var(--pt-red-ink); font-weight: 600; }
.pt-btn--primary:hover:not(:disabled) { background: var(--pt-red-hover); border-color: var(--pt-red-hover); }
.pt-btn--ghost { background: transparent; }
.pt-btn--danger { color: var(--pt-danger); }
.pt-btn--sm { padding: 3px 8px; font-size: 12px; }
.pt-btn--lg { padding: 12px 22px; font-size: 16px; }
.pt-btn[aria-pressed="true"] { background: var(--pt-red); border-color: var(--pt-red); color: var(--pt-red-ink); }

.pt-input, .pt-select, .pt-textarea {
  background: var(--pt-bg);
  color: var(--pt-text);
  border: 1px solid var(--pt-line);
  border-radius: var(--pt-radius);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.pt-input:focus, .pt-select:focus, .pt-textarea:focus { border-color: var(--pt-red); outline: none; }
.pt-textarea { width: 100%; min-height: 70px; resize: vertical; }
.pt-field { display: grid; gap: 4px; margin: 0 0 12px; }
.pt-field > span { color: var(--pt-dim); font-size: 12px; }
.pt-range { accent-color: var(--pt-red); }
.pt-check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pt-check input { accent-color: var(--pt-red); }

/* ---------- layout pieces ---------- */

.pt-page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.pt-h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.3px; }
.pt-h2 { font-size: 18px; margin: 28px 0 10px; }
.pt-card { background: var(--pt-panel); border: 1px solid var(--pt-line); border-radius: 10px; padding: 16px; }
.pt-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pt-table th, .pt-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--pt-line); vertical-align: middle; }
.pt-table th { color: var(--pt-dim); font-weight: 500; font-size: 12px; }
.pt-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--pt-panel-3); color: var(--pt-dim); white-space: nowrap; }
.pt-badge[data-kind="cloud"] { background: rgba(60, 207, 142, 0.15); color: var(--pt-ok); }
.pt-badge[data-kind="syncing"] { background: rgba(245, 176, 65, 0.15); color: var(--pt-warn); }
.pt-badge[data-kind="failed"], .pt-badge[data-kind="full"], .pt-badge[data-kind="conflict"] { background: rgba(255, 92, 108, 0.15); color: var(--pt-danger); }
.pt-empty { color: var(--pt-dim); padding: 28px; text-align: center; border: 1px dashed var(--pt-line); border-radius: 10px; }

.pt-dialog { background: var(--pt-panel); color: var(--pt-text); border: 1px solid var(--pt-line); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.pt-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.pt-dialog__inner { padding: 18px 20px; }
.pt-dialog__title { margin: 0 0 12px; font-size: 18px; }
.pt-dialog__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.pt-toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--pt-panel-3); color: var(--pt-text); border: 1px solid var(--pt-line);
  padding: 9px 16px; border-radius: 8px; z-index: 1000; max-width: calc(100vw - 32px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); font-size: 13px;
}
.pt-toast[data-kind="error"] { border-color: var(--pt-danger); }
.pt-toast[data-kind="warn"] { border-color: var(--pt-warn); }
.pt-toast[data-kind="ok"] { border-color: var(--pt-ok); }

@media (max-width: 640px) {
  .pt-logo img { height: 36px; }
  .pt-page { padding: 16px 16px 48px; }
  .pt-h1 { font-size: 22px; }
}
