/*
 * Sukud design system - feedback
 * Callouts, banners, toasts, progress (bar, ring, steps), empty states.
 * Status blocks carry their tone as a wash plus a full 1px border, never
 * as a coloured stripe down one edge.
 */

/* ======================================================================
 * Callout
 * ====================================================================== */
.sk-callout {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--t-border);
  border-radius: 14px;
  background: var(--t-subtle);
  color: var(--sk-fg);
  font-size: var(--sk-text-md);
  line-height: 1.5;
  animation: sk-rise var(--sk-dur-slow) var(--sk-ease-out);
}
/* Icon and title share the first row; text and actions sit underneath. */
.sk-callout__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sk-callout__icon { display: inline-flex; flex-shrink: 0; color: var(--t-text); }
.sk-callout__icon .sk-icon { width: 18px; height: 18px; }
.sk-callout__title { flex: 1; min-width: 0; font-weight: var(--sk-weight-semibold); color: var(--t-text-strong); }
.sk-callout__head > .sk-callout__text { flex: 1; min-width: 0; }
.sk-callout__text { color: var(--sk-fg-muted); }
.sk-callout__text a { color: var(--t-text); font-weight: var(--sk-weight-semibold); text-decoration: underline; text-underline-offset: 2px; }
.sk-callout__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.sk-callout__close { margin: -4px -6px -4px auto; }
.sk-callout--solid { background: var(--t-solid); border-color: transparent; color: var(--t-on); }
.sk-callout--solid :is(.sk-callout__title, .sk-callout__text, .sk-callout__icon, .sk-callout__close) { color: inherit; }
.sk-callout--compact { padding: 9px 12px; font-size: var(--sk-text-sm); }
.sk-callout.is-leaving { animation: sk-scale-out var(--sk-dur-base) var(--sk-ease-in) forwards; }

/* ======================================================================
 * Banner (full-width strip: tour mode, maintenance, announcements)
 * ====================================================================== */
.sk-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 48px 8px 16px;
  background: var(--t-solid);
  background-image: linear-gradient(100deg, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / 0.12) 50%, rgb(255 255 255 / 0) 70%);
  background-size: 250% 100%;
  color: var(--t-on);
  font-size: var(--sk-text-sm);
  font-weight: var(--sk-weight-medium);
  text-align: center;
  animation: sk-shimmer 6s linear infinite;
}
.sk-banner .sk-icon { width: 16px; height: 16px; }
.sk-banner a, .sk-banner__action { font-weight: var(--sk-weight-bold); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.sk-banner__close { position: absolute; right: 8px; top: 50%; translate: 0 -50%; color: inherit; }
.sk-banner--soft { background: var(--t-soft); color: var(--t-text-strong); animation: none; }

/* ======================================================================
 * Toasts
 * ====================================================================== */
.sk-toaster {
  position: fixed;
  z-index: var(--sk-z-toast);
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
@media (max-width: 639.98px) {
  .sk-toaster {
    left: 12px; right: 12px;
    bottom: calc(12px + var(--sk-safe-bottom) + var(--sk-toaster-offset, 0px));
    width: auto;
  }
}
.sk-toast {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--sk-border);
  border-radius: 16px;
  background: var(--sk-surface-raised);
  box-shadow: var(--sk-shadow-lg), var(--sk-bevel);
  color: var(--sk-fg);
  pointer-events: auto;
  overflow: hidden;
  touch-action: pan-y;
  animation: sk-toast-in var(--sk-dur-slow) var(--sk-ease-spring);
  transition: transform var(--sk-dur-base) var(--sk-ease-out), opacity var(--sk-dur-base);
}
@keyframes sk-toast-in { from { opacity: 0; transform: translateY(16px) scale(0.94); } }
.sk-toast.is-leaving { animation: sk-toast-out var(--sk-dur-base) var(--sk-ease-in) forwards; }
@keyframes sk-toast-out { to { opacity: 0; transform: translateX(var(--swipe, 24px)) scale(0.96); } }
.sk-toast__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sk-toast__icon { display: inline-flex; flex-shrink: 0; color: var(--t-text); }
.sk-toast__icon .sk-icon { width: 18px; height: 18px; }
.sk-toast__title { flex: 1; min-width: 0; font-weight: var(--sk-weight-semibold); line-height: 1.3; }
.sk-toast__text { font-size: var(--sk-text-sm); color: var(--sk-fg-muted); line-height: 1.45; padding-right: 8px; }
.sk-toast__action { margin-top: 4px; align-self: flex-start; }
.sk-toast__close { margin: -4px -4px -4px auto; }
.sk-toast__progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 2.5px;
  width: 100%;
  background: var(--t-solid);
  opacity: 0.55;
  transform-origin: left;
  animation: sk-toast-timer var(--duration, 5s) linear forwards;
}
.sk-toast:hover .sk-toast__progress, .sk-toast:focus-within .sk-toast__progress { animation-play-state: paused; }
@keyframes sk-toast-timer { to { transform: scaleX(0); } }

/* ======================================================================
 * Progress bar
 * ====================================================================== */
.sk-progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sk-progress__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--sk-text-sm); }
.sk-progress__label { font-weight: var(--sk-weight-medium); color: var(--sk-fg); }
.sk-progress__value { font-weight: var(--sk-weight-semibold); color: var(--sk-fg-muted); font-variant-numeric: tabular-nums; }
.sk-progress__track {
  --ph: 8px;
  position: relative;
  height: var(--ph);
  border-radius: 99px;
  background: var(--sk-surface-active);
  overflow: hidden;
}
.sk-progress--sm .sk-progress__track { --ph: 5px; }
.sk-progress--lg .sk-progress__track { --ph: 12px; }
.sk-progress__fill {
  position: absolute; inset: 0 auto 0 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background-color: var(--t-solid);
  background-image: linear-gradient(90deg, rgb(255 255 255 / 0), rgb(255 255 255 / 0.22));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
  transition: width var(--sk-dur-slower) var(--sk-ease-out);
  animation: sk-progress-grow 900ms var(--sk-ease-out) both;
}
@keyframes sk-progress-grow { from { width: 0; } }
.sk-progress--striped .sk-progress__fill {
  background-image: linear-gradient(45deg, rgb(255 255 255 / 0.18) 25%, transparent 25%, transparent 50%, rgb(255 255 255 / 0.18) 50%, rgb(255 255 255 / 0.18) 75%, transparent 75%);
  background-size: 14px 14px;
  animation: sk-progress-grow 900ms var(--sk-ease-out) both, sk-stripes 0.8s linear infinite;
}
@keyframes sk-stripes { to { background-position: 14px 0; } }
.sk-progress--indeterminate .sk-progress__fill { width: 40%; animation: sk-indeterminate 1.3s var(--sk-ease-in-out) infinite; }
@keyframes sk-indeterminate { from { left: -40%; } to { left: 100%; } }

/* Segmented progress (quiz questions, onboarding steps) */
.sk-segments { display: flex; gap: 4px; }
.sk-segments__item { flex: 1; height: 6px; border-radius: 99px; background: var(--sk-surface-active); overflow: hidden; position: relative; }
.sk-segments__item::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--t-solid); transform: scaleX(0); transform-origin: left; transition: transform var(--sk-dur-slow) var(--sk-ease-out); }
.sk-segments__item.is-done::after { transform: scaleX(1); }
.sk-segments__item.is-current::after { transform: scaleX(0.5); }
.sk-segments__item.is-correct::after { transform: scaleX(1); background: var(--sk-green-9); }
.sk-segments__item.is-wrong::after { transform: scaleX(1); background: var(--sk-red-9); }

/* ======================================================================
 * Progress ring
 * ====================================================================== */
.sk-ring { --size: 64px; --stroke: 6; position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex-shrink: 0; }
.sk-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.sk-ring__track { fill: none; stroke: var(--sk-surface-active); stroke-width: var(--stroke); }
.sk-ring__arc {
  fill: none;
  stroke: var(--t-solid);
  stroke-width: var(--stroke);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--value, 0));
  transition: stroke-dashoffset var(--sk-dur-slower) var(--sk-ease-out);
  animation: sk-ring-fill 1.1s var(--sk-ease-out) both;
  filter: drop-shadow(0 0 3px rgb(var(--t-rgb) / 0.35));
}
@keyframes sk-ring-fill { from { stroke-dashoffset: 100; } }
.sk-ring__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.sk-ring__value { font-family: var(--sk-font-display); font-weight: var(--sk-weight-bold); font-size: calc(var(--size) * 0.26); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sk-ring__label { font-size: max(9px, calc(var(--size) * 0.12)); color: var(--sk-fg-muted); font-weight: var(--sk-weight-semibold); }

/* ======================================================================
 * Steps (wizard progress)
 * ====================================================================== */
.sk-steps { display: flex; align-items: flex-start; gap: 0; counter-reset: sk-step; container-type: inline-size; }
.sk-step { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.sk-step::before, .sk-step::after {
  content: '';
  position: absolute;
  top: 14px; left: calc(-50% + 20px); right: calc(50% + 20px);
  height: 2px;
  border-radius: 2px;
  background: var(--sk-border);
}
.sk-step::after { background: var(--sk-brand-9); transform: scaleX(0); transform-origin: left; transition: transform var(--sk-dur-slower) var(--sk-ease-out); }
.sk-step:first-child::before, .sk-step:first-child::after { display: none; }
.sk-step.is-done::after, .sk-step.is-current::after { transform: scaleX(1); }
.sk-step__dot {
  position: relative;
  z-index: 1;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--sk-border);
  background: var(--sk-surface);
  color: var(--sk-fg-subtle);
  font-size: var(--sk-text-sm);
  font-weight: var(--sk-weight-bold);
  transition: background-color var(--sk-dur-base), border-color var(--sk-dur-base), color var(--sk-dur-base), transform var(--sk-dur-slow) var(--sk-ease-spring);
}
.sk-step__dot .sk-icon { width: 15px; height: 15px; stroke-width: 3; }
.sk-step.is-done .sk-step__dot { background: var(--sk-brand-9); border-color: var(--sk-brand-9); color: #fff; }
.sk-step.is-current .sk-step__dot { border-color: var(--sk-brand-9); color: var(--sk-brand-11); box-shadow: 0 0 0 4px rgb(var(--sk-brand-rgb) / 0.15); transform: scale(1.06); }
.sk-step__text { display: flex; flex-direction: column; gap: 1px; padding-inline: 4px; min-width: 0; }
.sk-step__title { font-size: var(--sk-text-sm); font-weight: var(--sk-weight-semibold); color: var(--sk-fg-muted); }
.sk-step.is-current .sk-step__title, .sk-step.is-done .sk-step__title { color: var(--sk-fg); }
.sk-step__desc { font-size: var(--sk-text-xs); color: var(--sk-fg-subtle); }
@container (max-width: 520px) {
  .sk-step__text { display: none; }
}

/* ======================================================================
 * Empty state
 * ====================================================================== */
.sk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
}
.sk-empty--compact { padding: 22px 16px; }
.sk-empty__picture { width: 150px; margin-bottom: 6px; }
.sk-empty--compact .sk-empty__picture { width: 110px; }
.sk-empty__picture .sk-ill { max-width: 100%; }
.sk-empty__art { position: relative; display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 10px; }
.sk-empty__art::before, .sk-empty__art::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--sk-radius-full);
  background: var(--t-soft);
  opacity: 0.6;
  animation: sk-pulse 3.4s var(--sk-ease-in-out) infinite;
}
.sk-empty__art::after { inset: 12px; background: var(--t-soft-hover); opacity: 1; animation: none; }
.sk-empty__art > .sk-icon { position: relative; z-index: 1; width: 32px; height: 32px; color: var(--t-text); animation: sk-float 3.4s var(--sk-ease-in-out) infinite; }
.sk-empty--compact .sk-empty__art { width: 60px; height: 60px; margin-bottom: 4px; }
.sk-empty--compact .sk-empty__art > .sk-icon { width: 24px; height: 24px; }
.sk-empty__title { font-family: var(--sk-font-display); font-size: var(--sk-text-xl); font-weight: var(--sk-weight-bold); letter-spacing: -0.015em; }
.sk-empty--compact .sk-empty__title { font-size: var(--sk-text-lg); }
.sk-empty__text { max-width: 40ch; color: var(--sk-fg-muted); font-size: var(--sk-text-md); line-height: 1.5; text-wrap: pretty; }
.sk-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
