/* Design language of SlidesLive Alex: dark violet gradient, Roboto with heavy
 * headings, translucent cards, filled fields with the label inside, teal
 * primary actions, rounded table rows. Values measured from alex.slideslive.com. */

:root {
  color-scheme: dark;
  --bg: #1d1d1d;
  --text: rgba(255, 255, 255, 0.89);
  --muted: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.45);
  --surface: rgba(255, 255, 255, 0.07);   /* cards, secondary buttons */
  --field: rgba(255, 255, 255, 0.12);     /* inputs */
  --field-hover: rgba(255, 255, 255, 0.16);
  --row: rgba(86, 86, 86, 0.39);          /* table rows */
  --row-alt: rgba(182, 154, 219, 0.1);
  --tile: rgba(182, 154, 219, 0.15);
  --menu: #343039;                        /* dropdown menus */
  --line: rgba(255, 255, 255, 0.1);
  --accent: #2bcda8;                      /* teal */
  --accent-ink: rgba(29, 29, 29, 0.85);
  --brand: #ec1f4b;
  --warn: #ff9900;
  --bad: #ff5d6c;
  --radius: 4px;
  --radius-card: 16px;
  --gutter: clamp(16px, 2.5vw, 40px);
  --sans: Roboto, 'Helvetica Neue', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, Consolas, 'Liberation Mono', monospace;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12'%3E%3Cpath d='M5 1v9M1.5 6.5 5 10l3.5-3.5' fill='none' stroke='white' stroke-opacity='.89' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  background-color: var(--bg);
  background-image:
    linear-gradient(#1d1d1d 0%, rgba(29, 29, 29, 0) 50%, #1d1d1d 100%),
    linear-gradient(98deg, rgba(61, 53, 128, 0.5) 45%, rgba(89, 51, 112, 0.5) 75%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }
code { font-family: var(--mono); font-size: 0.92em; color: var(--text); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  background: rgba(29, 29, 29, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 17px; font-weight: 900; color: #fff; text-decoration: none; white-space: nowrap; }
.brand em { margin-left: 5px; font-style: normal; color: var(--brand); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: var(--radius); }
.nav a:hover { color: #fff; background: var(--field); }
.nav a.active { color: #fff; background: var(--field); }

/* ---------- page ---------- */

/* Alex's page container (Tailwind's): full width up to 1280px, then
   centered at 1280px, and at 1536px from there. */
.page { margin: 0 auto; padding: 44px 16px 72px; }
@media (min-width: 1280px) { .page { max-width: 1280px; } }
@media (min-width: 1536px) { .page { max-width: 1536px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 20px; }
.page-head .head-side { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
h1 { font-size: 38px; font-weight: 900; line-height: 1.15; margin: 0; }
@media (max-width: 560px) { h1 { font-size: 28px; } }
.lead { margin: 6px 0 0; color: var(--text); max-width: 900px; }
.back-link { display: inline-block; margin-bottom: 6px; color: var(--muted); font-weight: 700; text-decoration: none; cursor: pointer; }
.back-link:hover { color: #fff; }

.card { background: var(--surface); border-radius: var(--radius-card); padding: 20px; }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 20px; font-weight: 900; line-height: 1.25; margin: 0; }
.card h3 { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 6px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.help, .hint { font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 0 0; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
footer { color: var(--faint); font-size: 12px; text-align: center; margin-top: 32px; }

/* ---------- fields: filled box, label inside ---------- */

.field {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 48px;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background 0.1s, border-color 0.1s;
}
.field:hover { background: var(--field-hover); }
.field:focus-within { border-color: var(--accent); }
.field > label {
  position: absolute;
  top: 6px;
  left: 12px;
  right: 34px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.field > input,
.field > select,
.field > textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 22px 12px 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.field > textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.field > input::placeholder, .field > textarea::placeholder { color: var(--faint); }
.field > input[readonly] { color: var(--muted); cursor: default; }
.field > input:disabled { cursor: default; }
.field > select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.field.select::after,
.field:has(> select)::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  background: var(--field) var(--arrow) no-repeat center;
  border-radius: 0 var(--radius) var(--radius) 0;
  pointer-events: none;
}
.field.mono > input { font-family: var(--mono); font-size: 13px; }
.field.attention { border-color: var(--warn); background: rgba(255, 153, 0, 0.1); }
.field.attention > label { color: #ffc266; }
select option, select optgroup { background: var(--menu); color: var(--text); }

/* A file picker in the same box style. */
.file-field { background: var(--field); border-radius: var(--radius); padding: 7px 12px 9px; min-height: 48px; }
.file-field > label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.file-field input[type=file] { color: var(--muted); font: inherit; font-size: 12.5px; max-width: 100%; margin-top: 4px; }
.file-field input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; font-size: 12.5px; color: var(--text);
  background: var(--field); border: 0; border-radius: var(--radius); padding: 5px 10px; margin-right: 10px; cursor: pointer;
}
.file-field .help { margin-top: 4px; }

.check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.inline-number {
  width: 64px; height: 34px; padding: 0 8px; text-align: center;
  background: var(--field); border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text); font: inherit; outline: 0;
  -moz-appearance: textfield; appearance: textfield;
}
.inline-number:focus { border-color: var(--accent); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Fields side by side, wrapping on narrow screens. */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid .span-2 { grid-column: auto; } }

/* Read-only values (label inside, like Alex's fields). */
.value-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 12px; margin-top: 12px; }
.value-grid .field.wide { grid-column: span 2; }
@media (max-width: 560px) { .value-grid .field.wide { grid-column: auto; } }

/* ---------- buttons ---------- */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, filter 0.1s, opacity 0.1s;
}
button:hover:not(:disabled), .button:hover { filter: brightness(1.08); }
button.secondary, .button.secondary { background: var(--field); color: var(--text); font-weight: 700; }
button.secondary:hover:not(:disabled), .button.secondary:hover { background: var(--field-hover); filter: none; }
button.danger { background: rgba(255, 93, 108, 0.12); color: var(--bad); font-weight: 700; }
button.danger.armed { background: var(--bad); color: #fff; }
button.big, .button.big { height: 48px; padding: 0 22px; font-size: 16px; }
button.small { height: 32px; padding: 0 10px; font-size: 12.5px; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.quiet-link { background: none; height: auto; padding: 0; color: var(--text); font-size: 12.5px; font-weight: 700; text-decoration: underline; }
.quiet-link:hover:not(:disabled) { filter: none; color: #fff; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* ---------- tables: rounded rows, alternating tint ---------- */

table.grid { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
table.grid th { text-align: left; font-weight: 700; color: var(--text); padding: 0 8px 2px; white-space: nowrap; }
table.grid th:first-child { padding-left: 16px; }
table.grid td { background: var(--row); padding: 12px 8px; vertical-align: middle; }
table.grid tbody tr:nth-child(even) td { background: var(--row-alt); }
table.grid td:first-child { border-radius: var(--radius) 0 0 var(--radius); padding-left: 16px; }
table.grid td:last-child { border-radius: 0 var(--radius) var(--radius) 0; padding-right: 16px; }
table.grid td.narrow, table.grid th.narrow { width: 44px; }
table.grid td.actions { display: table-cell; margin: 0; text-align: right; white-space: nowrap; }
table.grid td.actions button { margin-left: 6px; }
table.grid td.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
table.grid.compact td { padding-top: 6px; padding-bottom: 6px; }

/* A wide table scrolls by itself on a narrow screen, not the whole page. */
.table-scroll { overflow-x: auto; }

/* Controls inside table cells: compact boxes without the inner label. */
table.grid input[type=text],
table.grid input[type=number],
table.grid select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: 0;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  -moz-appearance: textfield;
}
table.grid select { appearance: none; -webkit-appearance: none; padding-right: 28px; background: var(--field) var(--arrow) no-repeat right 9px center; cursor: pointer; }
table.grid input:focus, table.grid select:focus { border-color: var(--accent); }
table.grid input:disabled, table.grid select:disabled { opacity: 0.35; cursor: not-allowed; }
table.grid input[type=text] { font-family: var(--mono); font-size: 12.5px; }

/* ---------- statuses, badges ---------- */

.status { display: none; font-size: 13px; margin-top: 10px; }
.status.show { display: flex; gap: 8px; align-items: baseline; }
.status.ok, .status.info { color: var(--muted); }
.status.ok::before { content: '✓'; color: var(--accent); font-weight: 900; }
.status.info::before { content: '•'; color: var(--muted); }
.status.warn, .status.err { padding: 10px 12px; border-radius: var(--radius); }
.status.warn { background: rgba(255, 153, 0, 0.12); color: #ffc266; box-shadow: inset 3px 0 0 var(--warn); }
.status.err { background: rgba(255, 93, 108, 0.12); color: #ffa3ab; box-shadow: inset 3px 0 0 var(--bad); }
.status-row { display: flex; flex-wrap: wrap; gap: 0 24px; }

.badge { display: inline-flex; align-items: center; font-family: var(--sans); font-size: 12px; font-weight: 900; line-height: 1; padding: 4px 8px; border-radius: var(--radius); background: var(--tile); color: #fff; white-space: nowrap; }
.badge.ok { background: rgba(43, 205, 168, 0.18); color: var(--accent); }
.badge.warn { background: rgba(255, 153, 0, 0.89); color: #fff; }
.badge.bad { background: rgba(255, 93, 108, 0.85); color: #fff; }

details > summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸'; color: var(--muted); transition: transform 0.1s; }
details[open] > summary::before { transform: rotate(90deg); }

/* The finished files: one row each, a filename and its button. */
.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.downloads li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: center; padding: 8px 8px 8px 16px; border-radius: var(--radius); background: var(--row); }
.downloads li:nth-child(even) { background: var(--row-alt); }
.downloads .what { font-weight: 700; }
.downloads .name { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.downloads .size { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .downloads li { grid-template-columns: minmax(0, 1fr) auto; }
  .downloads .what, .downloads .name { grid-column: 1 / -1; }
}

/* A dropdown you can type in (combo.js). */
.combo-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: -1px; right: -1px; max-height: min(420px, 60vh); margin: 0; padding: 4px; overflow: auto; list-style: none; border-radius: var(--radius); background: var(--menu); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
.combo-list[hidden] { display: none; }
.combo-list li { padding: 7px 10px; border-radius: 3px; cursor: pointer; }
.combo-list li:hover, .combo-list li.active { background: var(--field-hover); }
.combo-list li.current { font-weight: 700; color: var(--accent); }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }

/* ---------- checklist: what a preset will get, one line per part ---------- */

.checklist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: grid; grid-template-columns: 22px 110px minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding: 11px 16px; border-radius: var(--radius); background: var(--row); }
.checklist li:nth-child(even) { background: var(--row-alt); }
.checklist li::before { content: '✓'; color: var(--accent); font-weight: 900; }
.checklist li.warn::before { content: '!'; color: var(--warn); }
.checklist li.info::before { content: '•'; color: var(--muted); }
.checklist .what { font-weight: 700; }
.checklist .value { overflow-wrap: anywhere; }
.checklist .value.mono { font-family: var(--mono); font-size: 12.5px; }
.checklist li.warn .value { color: #ffc266; }
.checklist .value-note { color: var(--accent); }
/* The stream destinations, under the checklist's Streams line. */
.destinations { grid-column: 2 / -1; width: 100%; margin-top: 8px; border-collapse: collapse; }
.destinations th { padding: 0 16px 4px 0; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); }
.destinations td { padding: 6px 16px 6px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.destinations td:last-child, .destinations th:last-child { padding-right: 0; }
.destinations .name { width: 190px; font-weight: 700; white-space: nowrap; }
.destinations .url, .destinations .stream-key { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.destinations .stream-key { width: 30%; color: var(--accent); }
.destinations .why { color: #ffc266; }
/* The pre-recorded talks, under the checklist's Pre-recorded line. */
.talks .talk { width: 34%; font-weight: 700; }
.talks .speakers { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.talks .file { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.checklist.loading, .card.loading { opacity: 0.45; transition: opacity 0.15s; }
.card.loading { pointer-events: none; }
@media (max-width: 560px) {
  .checklist li { grid-template-columns: 22px minmax(0, 1fr); }
  .checklist .value { grid-column: 2; }
  .destinations thead { display: none; }
  .destinations, .destinations tbody, .destinations tr, .destinations td { display: block; width: auto; }
  .destinations td { padding: 2px 0; border: 0; }
  .destinations tr { padding: 6px 0; border-top: 1px solid var(--line); }
  .talks .talk { width: auto; }
}

#listStatus.show { margin: 0 0 16px; }
