/* Olano dashboard showcase — the auto-advancing tour of real dashboard
 * captures, shared verbatim by olano.ai (static site), olano.ai/studio and
 * cloud.olano.ai (Next.js console landing). One implementation, three hosts:
 * behaviour lives in dash-showcase.js next to this file.
 *
 * Every color reads the design tokens both properties already share
 * (styles.css and @olano/ui globals.css define the same names); the few
 * static-site-only tokens carry literal fallbacks so the cloud app renders
 * identically without them. */

.dash-showcase {
  --dsc-radius: var(--r-lg, 0.75rem);
}

/* ── Frame ─────────────────────────────────────────────────────────────── */

.dash-showcase .dsc-frame {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--dsc-radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg, 0 24px 80px -32px rgba(0, 0, 0, 0.55));
  overflow: hidden;
}

.dash-showcase .dsc-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.dash-showcase .dsc-bar span.dsc-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.dash-showcase .dsc-light-r { background: color-mix(in srgb, var(--danger) 50%, transparent); }
.dash-showcase .dsc-light-y { background: color-mix(in srgb, var(--warn) 50%, transparent); }
.dash-showcase .dsc-light-g { background: color-mix(in srgb, var(--success) 50%, transparent); }

.dash-showcase .dsc-bar-label {
  margin-left: 10px;
  font-size: 12px;
  color: var(--text-3, var(--text-2));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 560px) {
  .dash-showcase .dsc-bar-label { display: none; }
}

/* ── Stage: stacked slides, crossfaded ─────────────────────────────────── */

.dash-showcase .dsc-stage {
  position: relative;
  aspect-ratio: 8 / 5;
  width: 100%;
}

.dash-showcase .dsc-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.dash-showcase .dsc-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  will-change: opacity;
}

.dash-showcase .dsc-slide.is-shown {
  opacity: 1;
  pointer-events: auto;
}

/* The server-rendered first frame (no-JS fallback + LCP); the script adopts
 * the stage and this layer becomes slide one. */
.dash-showcase .dsc-boot {
  position: absolute;
  inset: 0;
}

/* ── Caption + controls ────────────────────────────────────────────────── */

.dash-showcase .dsc-foot {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 640px) {
  .dash-showcase .dsc-foot {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

/* Reserve the tallest caption per breakpoint so rotation never shifts the
 * controls or the content below the section. */
.dash-showcase .dsc-caption {
  min-height: 7.5rem;
  min-width: 0;
  max-width: 36rem;
  text-align: left;
}

@media (min-width: 640px) {
  .dash-showcase .dsc-caption { min-height: 4.75rem; }
}

.dash-showcase .dsc-caption-inner {
  animation: dsc-caption-in 300ms ease-out;
}

.dash-showcase .dsc-caption h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.dash-showcase .dsc-caption p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.dash-showcase .dsc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex: none;
}

.dash-showcase .dsc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dash-showcase .dsc-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dash-showcase .dsc-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-showcase .dsc-btn:focus-visible,
.dash-showcase .dsc-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg, transparent), 0 0 0 4px var(--border-focus, var(--accent));
}

.dash-showcase .dsc-pause { margin-left: 4px; }

/* Dots: the active one widens into a pill whose fill paces the autoplay. */
.dash-showcase .dsc-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px;
}

.dash-showcase .dsc-dot {
  position: relative;
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--surface-4, var(--border));
  cursor: pointer;
  overflow: hidden;
  transition: width 0.25s ease, background-color 0.15s ease;
}

.dash-showcase .dsc-dot:hover { background: var(--text-3, var(--text-2)); }

.dash-showcase .dsc-dot[aria-selected="true"] {
  width: 20px;
  background: var(--accent-soft, var(--surface-4));
}

.dash-showcase .dsc-dot-fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left center;
}

.dash-showcase .dsc-dot-fill.is-running {
  animation: dsc-dot-fill var(--dsc-interval, 5000ms) linear forwards;
}

@keyframes dsc-dot-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes dsc-caption-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-showcase .dsc-slide { transition: none; }
  .dash-showcase .dsc-dot-fill.is-running { animation: none; }
  .dash-showcase .dsc-caption-inner { animation: none; }
}
