/**
 * Elite Showcase Pro — Starter template skins & Phase 3 layouts
 */

/* Light mode overrides */
.esp-showcase.esp-theme--light {
  color-scheme: light;
}

.esp-theme--light .esp-card__glass {
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

.esp-theme--light .esp-fx--noise { opacity: 0.02; }

/* Template: Brand Accordion */
.esp-template--brand-accordion.esp-theme--light {
  background: var(--esp-bg);
}

.esp-template--brand-accordion .esp-accordion-slide__play {
  background: var(--esp-primary);
}

.esp-template--brand-accordion .esp-accordion-slide.is-active {
  box-shadow: 0 28px 70px color-mix(in srgb, var(--esp-primary) 18%, transparent);
}

/* Template: Ironclad */
.esp-template--ironclad-stories .esp-card__content.esp-quote-animate {
  font-style: italic;
  font-size: 1.05rem;
  border-left: 2px solid var(--esp-primary);
  padding-left: 1rem;
}

.esp-template--ironclad-stories .esp-media-nav__frame {
  border-radius: 8px;
}

.esp-template--ironclad-stories .esp-card__eyebrow {
  color: var(--esp-accent);
}

/* Template: Stripe */
.esp-template--stripe-features .esp-tabs__item.is-active .esp-tabs__title {
  color: var(--esp-text);
}

.esp-template--stripe-features .esp-tabs__tab-progress-fill {
  background: linear-gradient(90deg, var(--esp-primary), var(--esp-accent));
}

/* Template: Apple */
.esp-template--apple-walkthrough .esp-device-mockup {
  border-radius: 28px;
  padding: 12px;
  background: linear-gradient(145deg, #2a2a2e, #0a0a0a);
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
}

.esp-template--apple-walkthrough .esp-walkthrough__screen.is-active .esp-walkthrough__media {
  transform: scale(1.02);
}

/* Template: Linear timeline */
.esp-linear-layout {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 2rem;
  position: relative;
  z-index: 3;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

.esp-linear__track {
  position: relative;
  width: 48px;
}

.esp-linear__line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
}

.esp-linear__line-progress {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 0%;
  background: linear-gradient(180deg, var(--esp-primary), var(--esp-accent));
  transform: translateX(-50%);
  transition: height 0.6s var(--esp-ease-premium, cubic-bezier(0.16, 1, 0.3, 1));
}

.esp-linear__items { display: flex; flex-direction: column; gap: 2.5rem; }

.esp-linear__item {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 320px);
  gap: 2rem;
  align-items: center;
  opacity: 0.4;
  transition: opacity 0.45s;
}

.esp-linear__item.is-active { opacity: 1; }

.esp-linear__trigger {
  all: unset;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.esp-linear__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--esp-muted);
  margin-top: 6px;
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.esp-linear__item.is-active .esp-linear__dot {
  background: var(--esp-primary);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--esp-primary) 25%, transparent);
}

.esp-linear__date {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--esp-accent);
  display: block;
}

.esp-linear__title {
  font-size: 1.25rem;
  font-weight: 650;
  margin: 0.25rem 0;
  color: var(--esp-text);
}

.esp-linear__desc {
  font-size: 0.9rem;
  color: var(--esp-muted);
  margin: 0;
  line-height: 1.5;
}

.esp-linear__float {
  border-radius: var(--esp-radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: translateY(12px);
  opacity: 0.6;
  transition: transform 0.6s, opacity 0.6s;
}

.esp-linear__item.is-active .esp-linear__float {
  transform: translateY(0);
  opacity: 1;
}

.esp-linear__float .esp-media { width: 100%; display: block; }

/* Logo grid */
.esp-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  position: relative;
  z-index: 3;
  padding: 1rem 0;
}

.esp-logo-cell { position: relative; }

.esp-logo-cell__btn {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
}

.esp-logo-cell__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/10;
  padding: 1.5rem;
  background: var(--esp-card-bg);
  border: 1px solid rgba(128, 128, 128, 0.15);
  border-radius: calc(var(--esp-radius) * 0.6);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.esp-logo-cell:hover .esp-logo-cell__mark,
.esp-logo-cell.is-open .esp-logo-cell__mark {
  transform: translateY(-4px);
  border-color: var(--esp-primary);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--esp-primary) 20%, transparent);
}

.esp-logo-cell__img {
  max-width: 100%;
  max-height: 48px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.7);
  transition: filter 0.35s;
}

.esp-logo-cell:hover .esp-logo-cell__img,
.esp-logo-cell.is-open .esp-logo-cell__img {
  filter: none;
}

.esp-logo-popup {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 260px;
  z-index: 20;
}

.esp-logo-popup__inner {
  padding: 1rem;
  background: var(--esp-card-bg);
  backdrop-filter: blur(16px);
  border-radius: 12px;
}

.esp-logo-popup h4 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.esp-logo-popup__tag { font-size: 0.7rem; color: var(--esp-accent); font-weight: 600; }
.esp-logo-popup p { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--esp-muted); }

/* Product tour */
.esp-tour {
  position: relative;
  z-index: 3;
  max-width: 900px;
  margin: 0 auto;
}

.esp-tour__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.esp-tour__progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.esp-tour__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--esp-primary), var(--esp-accent));
  transition: width 0.5s var(--esp-ease-premium, ease);
}

.esp-tour__step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--esp-muted);
  white-space: nowrap;
}

.esp-tour__stage {
  position: relative;
  min-height: 380px;
}

.esp-tour__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.esp-tour__panel.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.esp-tour__tooltip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--esp-primary);
  color: #fff;
  margin-bottom: 0.75rem;
}

.esp-tour__media {
  position: relative;
  border-radius: var(--esp-radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.esp-tour__highlight {
  position: absolute;
  inset: 20% 15%;
  border: 2px dashed var(--esp-accent);
  border-radius: 8px;
  animation: esp-pulse 2s ease infinite;
}

@keyframes esp-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.esp-tour__copy h3 { margin: 0 0 0.5rem; font-size: 1.35rem; }
.esp-tour__copy p { color: var(--esp-muted); margin: 0; line-height: 1.6; }

.esp-tour__nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 1rem;
}

/* Metrics & compare */
.esp-metrics {
  display: flex;
  flex-direction: column;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: calc(var(--esp-radius) * 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.esp-metrics__value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--esp-primary), var(--esp-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.esp-metrics__label {
  font-size: 0.8rem;
  color: var(--esp-muted);
  margin-top: 0.25rem;
}

.esp-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 1rem 0;
}

.esp-compare__item span {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--esp-muted);
  margin-bottom: 6px;
}

.esp-compare__item img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

/* Video wall layout */
.esp-video-layout--wall {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: var(--esp-gap, 1.5rem);
  align-items: start;
}

.esp-video-layout--wall .esp-video__thumbs {
  flex-direction: column;
  margin-top: 0;
}

.esp-video-layout--wall .esp-video__thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
}

.esp-video-layout--wall .esp-video__thumb.is-active {
  box-shadow: 0 0 0 2px var(--esp-primary);
}

/* Motion presets */
/* Legacy motion classes — superseded by esp-design-system.css */

@media (max-width: 900px) {
  .esp-linear__item { grid-template-columns: 1fr; }
  .esp-linear__float { order: -1; }
  .esp-video-layout--wall { grid-template-columns: 1fr; }
  .esp-video-layout--wall .esp-video__thumbs { flex-direction: row; flex-wrap: wrap; }
}
