/* Chinese Word Formation — RT-EDU-012
   Widget styling. Form shell + ad/section styling come from the platform tool
   layout; this file scopes the wf-* result components. INDIGO education theme
   (accent #4338CA). Loaded automatically by show.blade.php when present. */

.wf-form { display: flex; flex-direction: column; gap: 14px; }

.wf-helper {
  padding: 10px 14px; background: #eef2ff; border-left: 3px solid #6366f1;
  border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--rt-ink-muted); line-height: 1.5;
}

.wf-input-row { display: flex; flex-direction: column; gap: 6px; }
.wf-input-row label {
  font-family: var(--rt-font-mono); font-size: 11px; color: var(--rt-ink-muted);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}

.wf-char-field { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.wf-char-field input {
  padding: 12px 16px; border: 1px solid var(--rt-hairline); border-radius: 8px;
  font-size: 28px; background: #fff; width: 92px; text-align: center; font-family: var(--rt-font-sans);
}
.wf-char-field input:focus {
  outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}

.wf-actions { display: flex; gap: 8px; align-items: center; }
.wf-btn {
  padding: 12px 20px; font-size: 13px; border-radius: 6px; cursor: pointer;
  font-family: var(--rt-font-mono); text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.wf-btn-go { background: #4338CA; color: #fff; border: 1px solid #3730a3; }
.wf-btn-go:hover { background: #3730a3; }
.wf-btn-sample { background: #fff; color: #4338CA; border: 1px solid rgba(67,56,202,.4); }

/* Quick-pick common-character row */
.wf-quickpick { display: flex; flex-direction: column; gap: 8px; }
.wf-quickpick:empty { display: none; }
.wf-quickpick-title {
  font-family: var(--rt-font-mono); font-size: 10.5px; color: var(--rt-ink-muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.wf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-chip {
  min-width: 38px; padding: 6px 10px; font-size: 17px; font-family: var(--rt-font-sans);
  background: #fff; color: #312e81; border: 1px solid rgba(67,56,202,.28);
  border-radius: 8px; cursor: pointer; line-height: 1.2; transition: background 120ms ease, border-color 120ms ease;
}
.wf-chip:hover { background: #eef2ff; border-color: #6366f1; }

/* Empty / message states */
.wf-empty { padding: 18px; text-align: center; color: var(--rt-ink-muted); font-style: italic; }
.wf-note {
  padding: 9px 13px; background: #eef2ff; border-radius: 6px; margin-bottom: 12px;
  font-size: 12.5px; color: #4338CA; line-height: 1.5;
}

/* Result header — the looked-up character + total count */
.wf-result-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 12px;
  background: var(--rt-result-bg); color: var(--rt-result-ink);
  border: 1px solid rgba(67,56,202,.22); border-radius: 10px;
}
.wf-result-char {
  font-family: var(--rt-font-sans); font-size: 38px; line-height: 1; color: var(--rt-result-ink);
}
.wf-result-meta {
  margin-left: auto; font-family: 'SF Mono', Menlo, monospace; font-size: 13px;
  color: var(--rt-result-muted); font-variant-numeric: tabular-nums;
}

/* Length-grouped word blocks */
.wf-groups { display: flex; flex-direction: column; gap: 14px; }
.wf-group { background: var(--rt-surface-2); border: 1px solid var(--rt-hairline); border-radius: 10px; padding: 14px 16px; }
.wf-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wf-group-name {
  font-family: var(--rt-font-mono); font-size: 11px; color: var(--rt-ink-muted);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.wf-group-count {
  font-family: 'SF Mono', Menlo, monospace; font-size: 11px; color: #4338CA;
  background: #eef2ff; border-radius: 999px; padding: 1px 9px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wf-word-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px;
}
.wf-word {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 8px; background: #fff; border: 1px solid var(--rt-hairline);
  border-radius: 8px; text-align: center;
}
.wf-word-han { font-family: var(--rt-font-sans); font-size: 19px; color: var(--rt-ink); line-height: 1.25; }
.wf-word-py {
  font-family: 'SF Mono', Menlo, monospace; font-size: 11.5px; color: #6366f1;
  letter-spacing: .01em; word-break: break-word;
}

@media (max-width: 480px) {
  .wf-word-list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .wf-char-field input { width: 78px; font-size: 24px; }
}
