/**
 * chx-phase-tutor.css · v1 · 2026-05-24
 * ============================================================
 * Styles für das wiederverwendbare Phase-Tutor-Component.
 * Hue per --pt-hue (gesetzt vom JS aus data-hue-var).
 * Brand-Linie: gleiche illuminated-panel-Konstruktion wie
 * granularity-coach (radial-gradient + double-border + shimmer).
 * Funktioniert auf allen 4 Modul-Sites über [data-context].
 */

.chx-phase-tutor {
  --pt-hue: var(--accent-magenta, #d194d4);
  --pt-hue-soft: color-mix(in oklab, var(--pt-hue) 18%, transparent);
  --pt-hue-glow: color-mix(in oklab, var(--pt-hue) 55%, transparent);
  position: relative;
  margin: 2.4rem 0 1.6rem;
  padding: 1.8rem 1.6rem 1.4rem;
  background:
    radial-gradient(ellipse at top left,    var(--pt-hue-soft) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, color-mix(in oklab, var(--accent-gold, #c9a961) 5%, transparent) 0%, transparent 55%),
    color-mix(in oklab, var(--base-deep, #1a121a) 90%, transparent);
  border: 1px solid color-mix(in oklab, var(--pt-hue) 22%, var(--base-line, rgba(255,255,255,.08)));
  border-radius: var(--chx-radius-lg, 14px);
  container-type: inline-size;
  isolation: isolate;
}
.chx-phase-tutor::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 0.5px solid color-mix(in oklab, var(--pt-hue) 14%, transparent);
  border-radius: calc(var(--chx-radius-lg, 14px) - 6px);
  pointer-events: none;
}
.chx-phase-tutor[data-state="thinking"]::after,
.chx-phase-tutor[data-state="streaming"]::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, var(--pt-hue) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: pt-shimmer 1.6s linear infinite;
  border-radius: var(--chx-radius-lg, 14px) var(--chx-radius-lg, 14px) 0 0;
}
@keyframes pt-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Head ────────────────────────────────────────────────── */
.pt-head {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  margin-bottom: 1rem;
}
.pt-head-icon {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--pt-hue);
  filter: drop-shadow(0 2px 6px var(--pt-hue-glow));
}
.pt-head-text { flex: 1; min-width: 0; }
.pt-head-tag {
  font: 500 .66rem/1 'JetBrains Mono', monospace;
  color: var(--text-faded, rgba(255,255,255,.55));
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.pt-head-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  color: var(--text-bright, #f4ecf2);
  margin: 0 0 .35rem;
  line-height: 1.2;
}
.pt-head-lede {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--text-warm, rgba(255,255,255,.82));
  margin: 0;
}

/* ── Starters ────────────────────────────────────────────── */
.pt-starters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .9rem 0 1rem;
}
.pt-starter {
  appearance: none;
  font: inherit;
  font-size: .82rem;
  background: color-mix(in oklab, var(--base-night, #0c0810) 80%, var(--pt-hue) 8%);
  border: 1px solid color-mix(in oklab, var(--pt-hue) 28%, var(--base-line, rgba(255,255,255,.08)));
  color: var(--text-bright, #f4ecf2);
  padding: .5rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s var(--chx-ease-out-quint, ease), background .2s, box-shadow .2s;
}
.pt-starter:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--base-night, #0c0810) 60%, var(--pt-hue) 18%);
  box-shadow: 0 4px 14px var(--pt-hue-glow);
}
.pt-starter:focus-visible {
  outline: 2px solid var(--pt-hue);
  outline-offset: 2px;
}

/* ── Result + Turn ──────────────────────────────────────── */
.pt-result { display: flex; flex-direction: column; gap: 1.2rem; margin: .4rem 0 1rem; }
.pt-turn { display: flex; flex-direction: column; gap: .6rem; }
.pt-q {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .6rem .8rem;
  background: color-mix(in oklab, var(--base-deep, #1a121a) 60%, var(--pt-hue) 6%);
  border-left: 2px solid var(--pt-hue);
  border-radius: 0 8px 8px 0;
}
.pt-q-tag {
  font: 500 .62rem/1 'JetBrains Mono', monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pt-hue);
  flex-shrink: 0;
}
.pt-q-text {
  font-size: .92rem;
  line-height: 1.5;
  color: var(--text-bright, #f4ecf2);
}
.pt-frame-target { min-height: 60px; }
.pt-plain {
  padding: .6rem .8rem;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--text-warm, rgba(255,255,255,.86));
  background: color-mix(in oklab, var(--base-deep, #1a121a) 75%, transparent);
  border-radius: 8px;
}

/* ── Input ──────────────────────────────────────────────── */
.pt-input-form {
  display: flex;
  gap: .6rem;
  margin-top: .4rem;
}
.pt-input-field {
  flex: 1;
  appearance: none;
  font: inherit;
  font-size: .92rem;
  padding: .7rem .9rem;
  background: color-mix(in oklab, var(--base-night, #0c0810) 70%, transparent);
  border: 1px solid color-mix(in oklab, var(--pt-hue) 18%, var(--base-line, rgba(255,255,255,.08)));
  color: var(--text-bright, #f4ecf2);
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
  min-height: 44px;
}
.pt-input-field::placeholder { color: var(--text-faded, rgba(255,255,255,.5)); }
.pt-input-field:focus {
  outline: none;
  border-color: var(--pt-hue);
  box-shadow: 0 0 0 3px var(--pt-hue-soft);
}
.pt-input-field:disabled { opacity: .5; cursor: not-allowed; }
.pt-input-btn {
  appearance: none;
  font: inherit;
  font-size: .88rem;
  letter-spacing: .04em;
  font-weight: 500;
  padding: 0 1.2rem;
  background: linear-gradient(135deg,
    var(--pt-hue) 0%,
    color-mix(in oklab, var(--pt-hue) 60%, var(--accent-gold, #c9a961)) 100%);
  color: var(--base-deep, #1a121a);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  min-width: 64px;
  transition: transform .2s, box-shadow .2s;
}
.pt-input-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--pt-hue-glow);
}
.pt-input-btn:focus-visible {
  outline: 2px solid var(--pt-hue);
  outline-offset: 3px;
}

/* ── Reset + Limit ──────────────────────────────────────── */
.pt-reset {
  appearance: none;
  font: 500 .72rem/1 'JetBrains Mono', monospace;
  letter-spacing: .08em;
  background: transparent;
  border: none;
  color: var(--text-faded, rgba(255,255,255,.5));
  cursor: pointer;
  margin-top: .8rem;
  padding: .3rem 0;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.pt-reset:hover { color: var(--pt-hue); }
.pt-reset:focus-visible {
  outline: 2px solid var(--pt-hue);
  outline-offset: 2px;
  border-radius: 4px;
}
.pt-limit {
  padding: .8rem 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: .98rem;
  color: var(--text-warm, rgba(255,255,255,.82));
  background: color-mix(in oklab, var(--base-deep, #1a121a) 70%, var(--pt-hue) 6%);
  border-left: 2px solid var(--pt-hue);
  border-radius: 0 8px 8px 0;
}

/* ── ChxAiStreamFrame Slots (mounted innerhalb pt-frame-target) ─ */
/* Drei-Schichten-Look: Labels mit Glyphen-Stamp */
.pt-turn .chx-ai-frame {
  background: color-mix(in oklab, var(--base-deep, #1a121a) 70%, transparent);
  border-radius: 10px;
  padding: .9rem 1rem;
  border: 1px solid color-mix(in oklab, var(--pt-hue) 10%, transparent);
}
.pt-turn .chx-ai-slots {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.pt-turn .chx-ai-slot {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .5rem 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--pt-hue) 12%, transparent);
}
.pt-turn .chx-ai-slot:last-child { border-bottom: none; padding-bottom: 0; }
.pt-turn .chx-ai-slot-label {
  font: 500 .7rem/1 'JetBrains Mono', monospace;
  letter-spacing: .1em;
  color: var(--pt-hue);
  text-transform: none;
}
.pt-turn .chx-ai-slot-content {
  font-size: .94rem;
  line-height: 1.6;
  color: var(--text-warm, rgba(255,255,255,.88));
}
.pt-turn .chx-ai-slot-skeleton {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.pt-turn .chx-ai-skel-line {
  display: block;
  width: var(--w, 80%);
  height: .7rem;
  border-radius: 4px;
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--pt-hue) 5%, transparent) 0%,
    color-mix(in oklab, var(--pt-hue) 15%, transparent) 50%,
    color-mix(in oklab, var(--pt-hue) 5%, transparent) 100%);
  background-size: 200% 100%;
  animation: pt-skel-pulse 1.4s linear infinite;
}
@keyframes pt-skel-pulse {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.pt-turn .chx-ai-slot[data-filled="true"] .chx-ai-slot-skeleton { display: none; }

/* Tool-Pane (Glasspane) — collapsed default */
.pt-turn .chx-ai-toolpane {
  margin-top: .7rem;
  font: 500 .72rem/1.4 'JetBrains Mono', monospace;
  color: var(--text-faded, rgba(255,255,255,.55));
}
.pt-turn .chx-ai-toolpane-summary {
  cursor: pointer;
  padding: .35rem 0;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.pt-turn .chx-ai-toolpane[open] .chx-ai-toolpane-summary { color: var(--pt-hue); }
.pt-turn .chx-ai-toolpane-list {
  list-style: none;
  margin: .3rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.pt-turn .chx-ai-toolpane-item {
  padding: .4rem .6rem;
  background: color-mix(in oklab, var(--pt-hue) 6%, transparent);
  border-radius: 6px;
  border-left: 2px solid var(--pt-hue);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .chx-phase-tutor { padding: 1.4rem 1.1rem 1.2rem; }
  .pt-input-form { flex-direction: column; }
  .pt-input-form > * { width: 100%; }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .chx-phase-tutor::after { animation: none !important; }
  .pt-turn .chx-ai-skel-line { animation: none !important; opacity: .4; }
  .pt-starter, .pt-input-btn { transition: none !important; }
}
