/* CSS Keyframe Animation Generator — content styles.
   Prefix: --kf-  /  .kf-

   Reference point: a live preview stage above the controls, since seeing
   the actual motion is the entire point — not a code editor with the
   preview as an afterthought. Eleventh distinct developer-cluster layout
   this build loop: preview-first, controls-second, code-output-last.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css.
   Animation keyframes/timing are generated dynamically into #kfStyleTag —
   this file only styles the stage and controls around them. */

:root {
  --kf-surface: #ffffff;
  --kf-panel:   #f5f5f7;
  --kf-line:    #dcdce1;
  --kf-text:    #17171c;
  --kf-muted:   #5c5c66;
  --kf-mono:    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.kf-wrap {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Live preview stage ──────────────────────────────────────────────────── */

.kf-preview-panel {
  margin-bottom: 1rem;
}

.kf-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12rem;
  border: 1px solid var(--kf-line);
  border-radius: 2px;
  background: var(--kf-panel);
  background-image:
    linear-gradient(45deg, var(--kf-line) 25%, transparent 25%),
    linear-gradient(-45deg, var(--kf-line) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--kf-line) 75%),
    linear-gradient(-45deg, transparent 75%, var(--kf-line) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: var(--kf-panel);
  opacity: 1;
}

.kf-preview-el {
  width: 4rem;
  height: 4rem;
  border-radius: 2px;
  background: var(--tf-accent);
}

/* ── Controls ────────────────────────────────────────────────────────────── */

.kf-controls-panel {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--kf-line);
  border-radius: 2px;
  background: var(--kf-surface);
}

.kf-field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 34rem) {
  .kf-field-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 22rem) {
  .kf-field-grid { grid-template-columns: 1fr; }
}

.kf-field {
  display: grid;
  gap: 0.375rem;
}

.kf-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--kf-muted);
}

.kf-field select,
.kf-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--kf-text);
  background: var(--kf-surface);
  border: 1px solid var(--kf-line);
  border-radius: 2px;
}

.kf-field select:focus-visible,
.kf-field input:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

/* ── Primary action button ──────────────────────────────────────────────── */

.kf-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.kf-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.kf-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.kf-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Output ──────────────────────────────────────────────────────────────── */

.kf-output-panel {
  margin-bottom: 1.5rem;
}

.kf-panel-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kf-muted);
}

.kf-output-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kf-copy-btn {
  padding: 0.25rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--kf-text);
  background: var(--kf-panel);
  border: 1px solid var(--kf-line);
  border-radius: 2px;
  cursor: pointer;
}

.kf-copy-btn:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

.kf-output {
  margin: 0;
  padding: 0.875rem 1rem;
  max-height: 16rem;
  overflow: auto;
  font-family: var(--kf-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
  color: var(--kf-text);
  background: var(--kf-panel);
  border: 1px solid var(--kf-line);
  border-radius: 2px;
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.kf-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 44rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .kf-wrap,
  .kf-ad { padding-inline: 1rem; }
  .kf-controls-panel { padding: 1rem; }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --kf-surface: var(--tf-surface);
  --kf-panel: var(--tf-surface);
  --kf-line: var(--tf-rule);
  --kf-text: var(--tf-ink);
  --kf-muted: var(--tf-ink-soft);
}
