/* Timeline Window Text Boxes editor — Launchpad panel styles.
 *
 * Ported from scottwagner/site/admin/css/timeline.css (the standalone editor)
 * into the Launchpad CREATE panel. Scott's .twe__ BEM survives intact; only
 * the tokens swap from his Bondi/Saffron public-site palette to the Launchpad
 * shell's dark theme + red accent.
 *
 * The Launchpad shell uses raw hex (not CSS vars), so this file does too —
 * keeps tokens consistent with admin.html's inline styles + launchpad-shell.css.
 *
 * Scoped under `[data-panel="create-timeline-windows"]` so .twe__ class rules
 * never leak out of the panel and clash with other Launchpad surfaces.
 */

[data-panel="create-timeline-windows"] .twe {
  max-width: 880px;
  margin: 18px 0 0;
  padding: 0;
}

[data-panel="create-timeline-windows"] .twe__diag {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #888;
}

[data-panel="create-timeline-windows"] .twe__picker {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 22px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
}

[data-panel="create-timeline-windows"] .twe__form { margin: 0; }

[data-panel="create-timeline-windows"] .twe__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

[data-panel="create-timeline-windows"] .twe__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-panel="create-timeline-windows"] .twe__row--full {
  grid-column: 1 / -1;
}

[data-panel="create-timeline-windows"] .twe__fieldset {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  padding: 16px 18px 20px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,0,0,0.03);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

[data-panel="create-timeline-windows"] .twe__fieldset legend {
  padding: 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #FF0000;
}

[data-panel="create-timeline-windows"] .twe__fieldset .twe__row--full {
  grid-column: 1 / -1;
}

[data-panel="create-timeline-windows"] .twe__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aaa;
}

[data-panel="create-timeline-windows"] .twe__input,
[data-panel="create-timeline-windows"] .twe__textarea {
  width: 100%;
  padding: 10px 12px;
  background: #0a0a0e;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.15s, background-color 0.15s;
  box-sizing: border-box;
}

[data-panel="create-timeline-windows"] .twe__input:focus,
[data-panel="create-timeline-windows"] .twe__textarea:focus {
  outline: none;
  border-color: #FF0000;
  background: #0e0e14;
}

[data-panel="create-timeline-windows"] .twe__textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

[data-panel="create-timeline-windows"] .twe__hint {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

/* ── Hero photo upload ──────────────────────────────────────── */
[data-panel="create-timeline-windows"] .twe__hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(0,127,134,0.04);
}

[data-panel="create-timeline-windows"] .twe__hero-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0e center/cover no-repeat;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.18s;
}

[data-panel="create-timeline-windows"] .twe__hero-preview[data-empty="false"] {
  border-color: rgba(0,127,134,0.55);
  box-shadow: 0 0 0 1px rgba(0,127,134,0.18);
}

[data-panel="create-timeline-windows"] .twe__hero-placeholder {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

[data-panel="create-timeline-windows"] .twe__hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

[data-panel="create-timeline-windows"] .twe__hero-pick {
  cursor: pointer;
  margin: 0;
}

[data-panel="create-timeline-windows"] .twe__hero-status {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-panel="create-timeline-windows"] .twe__hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 1px 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  font-size: 11px;
}

[data-panel="create-timeline-windows"] .twe__actions {
  margin: 22px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

[data-panel="create-timeline-windows"] .twe__btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 140ms;
  font-family: 'Montserrat', system-ui, sans-serif;
  border: 1px solid transparent;
}

/* Publish — GREEN (advance / save). Brett-lock: green means go.
 * Matches the existing inline-form Publish button (#27AE60) so the action
 * affordance is consistent with the rest of the Launchpad. */
[data-panel="create-timeline-windows"] .twe__btn--primary {
  background: #27AE60;
  border-color: #27AE60;
  color: #fff;
  box-shadow: 0 2px 8px rgba(39,174,96,0.35);
}

[data-panel="create-timeline-windows"] .twe__btn--primary:hover {
  background: #2ec76d;
  border-color: #2ec76d;
}

[data-panel="create-timeline-windows"] .twe__btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 10px 18px;
}

[data-panel="create-timeline-windows"] .twe__btn--ghost:hover {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
}

[data-panel="create-timeline-windows"] .twe__saved {
  font-size: 12px;
  color: #aaa;
  letter-spacing: 0.02em;
}

[data-panel="create-timeline-windows"] .twe__status {
  margin: 10px 0 0;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.02em;
}

[data-panel="create-timeline-windows"] .twe__published {
  margin: 14px 0 0;
  display: inline-block;
  padding: 8px 14px;
  background: rgba(39,174,96,0.12);
  border: 1px solid rgba(39,174,96,0.4);
  border-radius: 4px;
  color: #6ad79a;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
}

[data-panel="create-timeline-windows"] .twe__published span {
  font-weight: 600;
  opacity: 0.8;
  letter-spacing: normal;
  text-transform: none;
  margin-left: 10px;
}

/* ── Bulk import / export ────────────────────────────────────── */
[data-panel="create-timeline-windows"] .twe__bulk {
  margin: 32px 0 0;
  padding: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
}

[data-panel="create-timeline-windows"] .twe__bulk summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  list-style: none;
}

[data-panel="create-timeline-windows"] .twe__bulk summary::marker { display: none; }
[data-panel="create-timeline-windows"] .twe__bulk summary::-webkit-details-marker { display: none; }

[data-panel="create-timeline-windows"] .twe__bulk[open] summary {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

[data-panel="create-timeline-windows"] .twe__bulk-hint {
  margin: 16px 18px 12px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.55;
  max-width: 620px;
}

[data-panel="create-timeline-windows"] .twe__bulk-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 1px 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  font-size: 11px;
}

[data-panel="create-timeline-windows"] .twe__bulk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 18px 12px;
}

[data-panel="create-timeline-windows"] .twe__textarea--bulk {
  min-height: 220px;
  margin: 0 18px;
  width: calc(100% - 36px);
}

[data-panel="create-timeline-windows"] .twe__bulk-status {
  margin: 10px 18px 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #aaa;
}

[data-panel="create-timeline-windows"] .twe__bulk-log {
  margin: 8px 18px 18px;
  padding: 10px 12px;
  background: #0a0a0e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #aaa;
  white-space: pre;
}

/* ──────────────────────────────────────────────────────────────────────────
 * Admin Timeline Strip — visual picker that replaces the static "Timeline
 * Window Text Boxes" header. Lifted from scott's public scott-timeline rules
 * in css/tickers.css, adapted for the Launchpad admin context:
 *   - position: relative (inline-flow in the panel, not fixed at top of page)
 *   - bounded height, fits inside the panel layout
 *   - scott Bondi/Saffron palette declared locally on the panel root so we
 *     don't need to import the public tickers.css inside the admin shell
 *   - click opens the editor form below; no public media-card popover
 * ────────────────────────────────────────────────────────────────────────── */

/* Scoped brand tokens — keep scott's palette inside the editor panel without
 * leaking into the rest of the Launchpad shell. */
[data-panel="create-timeline-windows"] {
  --bondi: #007f86;
  --saffron: #d9763d;
  --coral: #ff5a4e;
  --ink: #0c2126;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin {
  position: relative;
  width: 100%;
  height: 130px;
  margin: 4px 0 14px;
  border: 1px solid rgba(0,127,134,0.28);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,127,134,0.06) 0%, rgba(12,33,38,0.18) 100%),
    #0c0c10;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .scott-timeline__viewport {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,127,134,0.55) transparent;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .scott-timeline__viewport.is-dragging {
  cursor: grabbing;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .scott-timeline__viewport::-webkit-scrollbar {
  height: 4px;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .scott-timeline__viewport::-webkit-scrollbar-thumb {
  background: rgba(0,127,134,0.55);
  border-radius: 2px;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .scott-timeline__track {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 100%;
  padding: 0 40px;
  white-space: nowrap;
}

/* Horizontal spine line running through the node dots. */
[data-panel="create-timeline-windows"] .scott-timeline--admin .scott-timeline__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,0.22);
  z-index: 0;
}

/* Empty / loading message inside the track. */
[data-panel="create-timeline-windows"] .twe-strip-empty {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

/* Node — single timeline entry, rendered as a <button>. */
[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 22px;
  min-width: 158px;
  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
  transition: transform 0.18s ease;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node:hover {
  transform: translateY(-1px);
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node:focus-visible {
  outline: 2px solid var(--bondi);
  outline-offset: 2px;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--bondi);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.4);
  z-index: 2;
  transform: translate(20px, -1px);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

/* Status colour treatments — match public site (past=Bondi, present=yellow
 * with glow, future=Saffron). */
[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node--past .tl-node__dot {
  background: var(--bondi);
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node--present .tl-node__dot {
  background: #ffd83a;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 12px rgba(255,216,58,0.7);
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node--future .tl-node__dot {
  background: var(--saffron);
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node__date {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 4px;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node__name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node:hover .tl-node__name {
  color: var(--bondi);
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node__subtitle {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node__detail {
  font-size: 9px;
  font-weight: 400;
  opacity: 0.65;
  margin-top: 1px;
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Media hotspot — events with Vimeo overlays.
 * Yellow-well + ▶ glyph, mirroring the public strip. */
[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node--media .tl-node__dot {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: #ffd83a;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 16px rgba(0,127,134,0.85);
  animation: twe-strip-media-pulse 2.4s ease-in-out infinite;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node--media .tl-node__media-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + 20px), calc(-50% - 1px));
  font-size: 9px;
  line-height: 1;
  color: #0c2126;
  z-index: 3;
  pointer-events: none;
}

[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node--media:hover .tl-node__dot {
  box-shadow: 0 0 0 3px rgba(0,0,0,0.65), 0 0 24px rgba(0,127,134,1);
}

@keyframes twe-strip-media-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 16px rgba(0,127,134,0.85); }
  50%      { box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 22px rgba(0,127,134,1); }
}

/* Click feedback — quick scale pulse + ring ripple when a node is clicked.
 * Triggered by adding .is-clicking class via JS on pointerdown. */
[data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node.is-clicking .tl-node__dot {
  animation: twe-strip-click 0.42s ease-out;
}

@keyframes twe-strip-click {
  0%   { transform: translate(20px, -1px) scale(1);   box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 0 0  rgba(0,127,134,0.65); }
  50%  { transform: translate(20px, -1px) scale(1.6); box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 0 12px rgba(0,127,134,0); }
  100% { transform: translate(20px, -1px) scale(1);   box-shadow: 0 0 0 3px rgba(0,0,0,0.55), 0 0 0 0  rgba(0,127,134,0); }
}

/* Right-arrow scroll button — pinned inside the strip on the right edge.
 * Click → scroll viewport forward by ~70%. Fades to 0 + pointer-events:none
 * when the user reaches the end. */
[data-panel="create-timeline-windows"] .tl-arrow--admin {
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 12px;
  background: rgba(0,127,134,0.85);
  border: 1px solid rgba(255,255,255,0.32);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
  z-index: 4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  box-shadow: -4px 0 14px rgba(0,0,0,0.4);
  transition: opacity 0.32s ease, background-color 0.15s, transform 0.18s ease;
}

[data-panel="create-timeline-windows"] .tl-arrow--admin:hover {
  background: rgba(0,127,134,1);
  transform: translateX(-4px);
}

[data-panel="create-timeline-windows"] .tl-arrow--admin:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

[data-panel="create-timeline-windows"] .tl-arrow--admin.is-disabled {
  opacity: 0;
  pointer-events: none;
}

/* Strip controls — sits below the timeline strip: hint + New event button + count. */
[data-panel="create-timeline-windows"] .twe__strip-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  flex-wrap: wrap;
}

[data-panel="create-timeline-windows"] .twe__strip-hint {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
  [data-panel="create-timeline-windows"] .scott-timeline--admin {
    height: 116px;
  }
  [data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node {
    min-width: 138px;
    padding: 8px 16px;
  }
  [data-panel="create-timeline-windows"] .scott-timeline--admin .tl-node__name {
    font-size: 12px;
  }
  [data-panel="create-timeline-windows"] .twe__grid,
  [data-panel="create-timeline-windows"] .twe__fieldset {
    grid-template-columns: 1fr;
  }
}
