/* Module demos — video slots per product module (bionicadri.com/demos.html) */

.demo-page {
  --demo-radius: 14px;
  --demo-border: oklch(70% 0.03 255 / 0.16);
  --demo-surface: oklch(16% 0.02 255 / 0.72);
  --demo-ready: oklch(68% 0.12 155);
  --demo-pending: oklch(72% 0.1 75);
  --demo-accent: oklch(72% 0.09 230);
}

.demo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 1.75rem;
}

.demo-filters button {
  appearance: none;
  border: 1px solid var(--demo-border);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}

.demo-filters button:hover,
.demo-filters button.is-active {
  opacity: 1;
  border-color: var(--demo-accent);
  background: oklch(72% 0.09 230 / 0.1);
}

.demo-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 1.5rem;
}

.demo-status-bar strong {
  color: var(--demo-accent);
  font-variant-numeric: tabular-nums;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.demo-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--demo-border);
  border-radius: var(--demo-radius);
  background: var(--demo-surface);
  overflow: hidden;
  min-height: 100%;
  transition: border-color 0.15s, transform 0.15s;
}

.demo-card:hover {
  border-color: oklch(75% 0.05 230 / 0.4);
}

.demo-card.is-hidden {
  display: none;
}

.demo-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0c10;
  overflow: hidden;
}

.demo-media img,
.demo-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.demo-media video {
  background: #000;
}

.demo-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, transparent 40%, oklch(0% 0 0 / 0.55));
  cursor: pointer;
  color: #fff;
  padding: 0;
}

.demo-play:focus-visible {
  outline: 2px solid var(--demo-accent);
  outline-offset: -4px;
}

.demo-play__btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: grid;
  place-items: center;
  background: oklch(0% 0 0 / 0.45);
  backdrop-filter: blur(6px);
  transition: transform 0.15s, background 0.15s;
}

.demo-card:hover .demo-play__btn {
  transform: scale(1.06);
  background: oklch(0% 0 0 / 0.65);
}

.demo-play__btn svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.demo-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  z-index: 2;
}

.demo-badge--ready {
  background: oklch(30% 0.06 155 / 0.9);
  border-color: var(--demo-ready);
  color: oklch(92% 0.05 155);
}

.demo-badge--pending {
  background: oklch(28% 0.04 75 / 0.9);
  border-color: var(--demo-pending);
  color: oklch(92% 0.05 85);
}

.demo-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.05rem 1.15rem;
  flex: 1;
}

.demo-body h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.demo-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.78;
  flex: 1;
}

.demo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.75rem;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  opacity: 0.65;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.demo-actions a,
.demo-actions button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--demo-border);
  background: transparent;
  color: inherit;
}

.demo-actions a:hover,
.demo-actions button:hover {
  border-color: var(--demo-accent);
}

.demo-actions .is-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.demo-actions .is-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.demo-howto {
  border: 1px dashed var(--demo-border);
  border-radius: var(--demo-radius);
  padding: 1.25rem 1.35rem;
  margin: 0 0 3rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.demo-howto code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.84em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: oklch(100% 0 0 / 0.06);
}

.demo-howto pre {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border-radius: 8px;
  background: oklch(0% 0 0 / 0.35);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Lightbox */
.demo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: oklch(0% 0 0 / 0.82);
  backdrop-filter: blur(8px);
}

.demo-lightbox.is-open {
  display: flex;
}

.demo-lightbox__panel {
  width: min(960px, 100%);
  background: #0b1018;
  border: 1px solid var(--demo-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px oklch(0% 0 0 / 0.55);
}

.demo-lightbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--demo-border);
}

.demo-lightbox__head h2 {
  margin: 0;
  font-size: 1rem;
}

.demo-lightbox__close {
  appearance: none;
  border: 1px solid var(--demo-border);
  background: transparent;
  color: inherit;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.demo-lightbox__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
}

.demo-lightbox__empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .demo-card,
  .demo-play__btn {
    transition: none;
  }
}
