/* components.css — Holo primitives (GlassDesignSystem.swift) */

/* ── LivingAurora ── */
.living-aurora { position: absolute; inset: 0; overflow: hidden; }
.living-aurora canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }

/* ── StatusDot ── */
.status-dot {
  display: inline-block;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--s) * 1) var(--dot);
  transition: background 0.35s ease;
}
.status-dot.live { animation: status-pulse 1s var(--ease-in-out) infinite alternate; }
@keyframes status-pulse {
  from { transform: scale(1); box-shadow: 0 0 calc(var(--s) * 1) var(--dot); }
  to   { transform: scale(1.35); box-shadow: 0 0 calc(var(--s) * 2.2) var(--dot); }
}

/* ── SendButton / StopButton ── */
.send-button, .stop-button {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  transition: background var(--dur-settle) var(--ease-settle), box-shadow var(--dur-settle) var(--ease-settle), transform var(--dur-settle) var(--ease-settle);
}
.send-button {
  background: rgb(var(--wash-rgb) / calc(0.05 * var(--wash-k)));
  box-shadow: inset 0 0 0 0.5px rgb(var(--wash-rgb) / calc(0.12 * var(--wash-k)));
}
.send-button.armed {
  background: var(--accent);
  box-shadow: 0 0 calc(var(--s) * 0.4) rgb(var(--accent-rgb) / 0.55);
}
.send-button .sf { transition: color var(--dur-settle) var(--ease-settle); }
.send-button.firing { animation: send-fire 0.42s var(--ease-settle); }
@keyframes send-fire { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }
.send-button.armed:active { transform: scale(1.08); }
.stop-button {
  background: rgb(var(--wash-rgb) / calc(0.06 * var(--wash-k)));
  box-shadow: inset 0 0 0 0.5px rgb(var(--wash-rgb) / calc(0.12 * var(--wash-k)));
}
.stop-button:active { transform: scale(0.94); }

/* ── HoloCaret ── */
.holo-caret {
  display: inline-block;
  width: 7px;
  border-radius: 1.5px;
  background: var(--accent);
  box-shadow: 0 0 10px rgb(var(--accent-rgb) / 0.7);
  vertical-align: text-bottom;
  animation: caret-blink 0.62s var(--ease-in-out) infinite alternate;
}
@keyframes caret-blink { from { opacity: 1; } to { opacity: 0.12; } }

/* ── OrbitingBloom ── */
.orbiting-bloom { position: relative; display: inline-block; flex: none; }
.bloom-core, .bloom-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.bloom-core { background: var(--accent); }
.bloom-spark { background: rgb(var(--accent-rgb) / 0.9); }

/* ── ShimmerText ── */
.shimmer-text { position: relative; display: inline-block; white-space: nowrap; line-height: 1.2; }
.shimmer-base { color: var(--ink-faint); }
.shimmer-band {
  position: absolute;
  inset: 0;
  color: transparent;
  background-image: linear-gradient(90deg, transparent 0%, var(--accent) 25%, #fff 50%, var(--accent) 75%, transparent 100%);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer-sweep 2.2s linear infinite;
}
@keyframes shimmer-sweep { from { background-position: -150% 0; } to { background-position: 250% 0; } }
.pm-app[data-reduce-motion="true"] .shimmer-band { display: none; }
.pm-app[data-reduce-motion="true"] .shimmer-base { color: var(--ink-soft); }

.thinking-indicator { display: flex; align-items: center; gap: 12px; height: 26px; }

/* ── iOS 26 switch ── */
.ios-toggle {
  position: relative;
  width: 63px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  background: rgb(120 120 128 / 0.36);
  transition: background 0.25s ease;
  touch-action: manipulation;
}
.pm-app[data-appearance="light"] .ios-toggle { background: rgb(120 120 128 / 0.16); }
.ios-toggle.on { background: var(--tint); }
.ios-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 37px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.15), 0 1px 1px rgb(0 0 0 / 0.16);
  transition: transform 0.36s var(--ease-snappy), width 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.ios-toggle.on .ios-toggle-thumb { transform: translateX(22px); }
.ios-toggle.pressed .ios-toggle-thumb {
  width: 43px;
  background: rgb(255 255 255 / 0.28);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.7), inset 0 1px 2px rgb(255 255 255 / 0.6), 0 4px 12px rgb(0 0 0 / 0.2);
  -webkit-backdrop-filter: blur(2px) saturate(1.6);
  backdrop-filter: blur(2px) saturate(1.6);
}
.ios-toggle.on.pressed .ios-toggle-thumb { transform: translateX(16px); }
.ios-toggle.mini { transform: scale(0.72); transform-origin: right center; }
.ios-toggle:disabled { opacity: 0.4; }

/* ── iOS 26 slider ── */
.ios-slider { position: relative; height: 30px; width: 100%; cursor: pointer; touch-action: none; }
.ios-slider.disabled { opacity: 0.4; pointer-events: none; }
.ios-slider-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 3px;
  background: rgb(120 120 128 / 0.36);
  overflow: hidden;
}
.pm-app[data-appearance="light"] .ios-slider-track { background: rgb(120 120 128 / 0.2); }
.ios-slider-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f) * 100%); background: var(--tint); border-radius: 3px; }
.ios-slider-thumb {
  position: absolute;
  top: 50%;
  left: calc(var(--f) * (100% - 38px));
  width: 38px;
  height: 24px;
  margin-top: -12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.18), 0 1px 2px rgb(0 0 0 / 0.14);
  transition: transform 0.25s var(--ease-snappy), background 0.2s ease, box-shadow 0.2s ease;
}
.ios-slider.dragging .ios-slider-thumb {
  transform: scale(1.3, 1.25);
  background: rgb(255 255 255 / 0.22);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.75), inset 0 1px 2px rgb(255 255 255 / 0.6), 0 6px 16px rgb(0 0 0 / 0.22);
  -webkit-backdrop-filter: blur(1.5px) saturate(1.8);
  backdrop-filter: blur(1.5px) saturate(1.8);
}
.ios-slider:focus-visible { outline: none; }
.ios-slider:focus-visible .ios-slider-thumb { box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.5); }

/* ── iOS 26 segmented control ── */
.ios-segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  height: 32px;
  padding: 2px;
  border-radius: 999px;
  background: rgb(120 120 128 / 0.24);
  isolation: isolate;
}
.pm-app[data-appearance="light"] .ios-segmented { background: rgb(120 120 128 / 0.12); }
.ios-segmented-thumb {
  position: absolute;
  z-index: -1;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / var(--n));
  transform: translateX(calc(var(--i) * 100%));
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.12), inset 0 0.5px 0 rgb(255 255 255 / 0.3);
  transition: transform 0.4s var(--ease-snappy);
}
.pm-app[data-appearance="light"] .ios-segmented-thumb { background: #fff; box-shadow: 0 3px 8px rgb(0 0 0 / 0.12), 0 0 0 0.5px rgb(0 0 0 / 0.04); }
.ios-segment { font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: -0.08px; border-radius: 999px; white-space: nowrap; }
.ios-segment.on { font-weight: 600; }

/* ── Picker(.menu) ── */
.ios-menu-picker { display: inline-flex; align-items: center; gap: 5px; letter-spacing: -0.41px; max-width: 100%; }
.ios-menu-picker-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── ProgressView ── */
.ios-spinner { position: relative; display: inline-block; flex: none; }
.ios-spinner i {
  position: absolute;
  left: 50%;
  top: 0;
  width: 9%;
  height: 28%;
  margin-left: -4.5%;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 50% 178%;
  animation: spinner-fade 0.8s linear infinite;
}
@keyframes spinner-fade { from { opacity: 1; } to { opacity: 0.18; } }
.ios-progress { position: relative; display: inline-block; border-radius: 999px; background: rgb(120 120 128 / 0.24); overflow: hidden; vertical-align: middle; }
.ios-progress > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; transition: width 0.3s ease; }

/* ── DisclosureGroup ── */
.ios-disclosure-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; text-align: left; }
.ios-disclosure-label { flex: 1; min-width: 0; }
.ios-disclosure-chevron { display: grid; place-items: center; transition: transform 0.3s var(--ease-settle); }
.ios-disclosure.open .ios-disclosure-chevron { transform: rotate(90deg); }
.ios-disclosure-body { animation: disclosure-in 0.3s var(--ease-settle); }
@keyframes disclosure-in { from { opacity: 0; transform: translateY(-4px); } }

/* ── Sheet background ── */
.holo-sheet-bg { position: absolute; inset: 0; overflow: hidden; }

/* ── HoloDialog ── */
.holo-dialog { position: absolute; inset: 0; z-index: 80; display: flex; justify-content: center; }
.holo-dialog.center { align-items: center; }
.holo-dialog.bottom { align-items: flex-end; }
.holo-dialog-dimmer {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--dur-settle) var(--ease-settle);
}
.holo-dialog.shown .holo-dialog-dimmer { opacity: 1; }
.holo-dialog-panel-wrap {
  position: relative;
  width: 100%;
  transition: transform var(--dur-settle) var(--ease-settle), opacity var(--dur-settle) var(--ease-settle);
  opacity: 0;
}
.holo-dialog.center .holo-dialog-panel-wrap { max-width: 440px; padding: 0 28px; transform: scale(0.94); }
.holo-dialog.bottom .holo-dialog-panel-wrap { max-width: 520px; padding: 0 14px 18px; transform: translateY(110%); }
.holo-dialog.bottom .holo-dialog-panel-wrap { padding-bottom: calc(18px + var(--safe-bottom, 34px)); }
.holo-dialog.shown .holo-dialog-panel-wrap { opacity: 1; transform: none; }
.holo-dialog-body { display: flex; flex-direction: column; gap: 14px; }
.holo-dialog-title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.3px; line-height: 1.3; }
.holo-dialog-message { font-size: 13px; color: var(--ink-soft); line-height: 1.4; letter-spacing: -0.08px; }
.holo-dialog-buttons.row { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.holo-dialog-buttons.stacked { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.holo-dialog-button {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  color: var(--ink-soft);
  background: rgb(var(--wash-rgb) / calc(0.05 * var(--wash-k)));
  box-shadow: inset 0 0 0 0.7px rgb(var(--wash-rgb) / calc(0.10 * var(--wash-k)));
  transition: transform 0.15s ease, filter 0.15s ease;
}
.holo-dialog-button:active { transform: scale(0.97); filter: brightness(1.15); }
.holo-dialog-button.expands { width: 100%; font-size: 15px; padding: 13px 16px; }
.holo-dialog-button.primary { color: var(--on-accent); background: var(--accent); box-shadow: 0 0 16px rgb(var(--accent-rgb) / 0.45); }
.holo-dialog-button.destructive { color: var(--danger); box-shadow: inset 0 0 0 0.7px rgb(var(--danger-rgb) / 0.35); }
.holo-dialog-button.destructive.expands { background: rgb(var(--wash-rgb) / calc(0.08 * var(--wash-k))); }
