/* ══════════════════════════════════════
   WOW SAMIACC — Visual Level Demos
   Sequential animated workflow overlay
   Drawing lines, sheen, confetti, hover particles
   ══════════════════════════════════════ */

/* ── Overlay ── */
.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(4,7,15,0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 24px;
}

.demo-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Container ── */
.demo-container {
  width: 100%;
  max-width: 580px;
  background: linear-gradient(160deg, rgba(10,18,35,0.98), rgba(7,10,21,0.99));
  border: 1px solid rgba(201,168,76,0.2);
  border-top: 3px solid rgba(201,168,76,0.5);
  border-radius: 16px;
  padding: 24px 24px 20px;
  transform: translateY(22px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.65), 0 0 60px rgba(201,168,76,0.06);
}

.demo-overlay.open .demo-container {
  transform: translateY(0) scale(1);
}

/* ── Header ── */
.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.demo-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-level-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border: 1px solid;
  border-radius: 20px;
}

.demo-level-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}

.demo-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.demo-close:hover {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.3);
  color: #c9a84c;
}

.demo-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 20px;
}

/* ── Timeline ── */
.demo-timeline {
  position: relative;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.2) transparent;
}

.demo-timeline::-webkit-scrollbar { width: 3px; }
.demo-timeline::-webkit-scrollbar-track { background: transparent; }
.demo-timeline::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.2); border-radius: 2px; }

/* ── Step row ── */
.demo-step {
  display: flex;
  gap: 12px;
  position: relative;
}

/* ── Left column ── */
.demo-step-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  flex-shrink: 0;
}

/* ── Dot ── */
.demo-step-dot {
  --demo-color: #c9a84c;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(4,7,15,0.9);
  border: 2px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transform: scale(0);
  transition: border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.demo-step-dot.popped {
  border-color: var(--demo-color);
  background: color-mix(in srgb, var(--demo-color) 14%, rgba(4,7,15,0.95));
  color: var(--demo-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--demo-color) 14%, transparent),
              0 0 16px color-mix(in srgb, var(--demo-color) 30%, transparent);
  animation: demoDotPop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes demoDotPop {
  0%  { transform: scale(0); }
  60% { transform: scale(1.18); }
  100%{ transform: scale(1); }
}

/* ── Connector line ── */
.demo-vline-wrap {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  margin: 2px 0;
}

.demo-vline-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0;
  border-radius: 2px;
  transition: height 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-vline-fill.drawn { height: 100%; }

.demo-vline-sheen {
  position: absolute;
  top: -100%; left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
  pointer-events: none;
}

.demo-vline-sheen.active {
  animation: demoSheenFlow 0.5s ease forwards;
}

@keyframes demoSheenFlow {
  0%   { top: -50%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 0.8; }
  100% { top: 110%; opacity: 0; }
}

/* ── Step content ── */
.demo-step-content {
  flex: 1;
  padding: 0 0 14px 2px;
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.32s ease, transform 0.32s ease,
              background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  --demo-color: #c9a84c;
  border-radius: 8px;
  padding: 8px 12px 10px;
  margin-bottom: 6px;
  cursor: default;
}

.demo-step-content.visible {
  opacity: 1;
  transform: translateX(0);
}

.demo-step-content:hover {
  background: rgba(255,255,255,0.04);
  border: 1px solid color-mix(in srgb, var(--demo-color) 28%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--demo-color) 10%, transparent);
}

.demo-step-num {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.demo-step-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-bottom: 3px;
  line-height: 1.3;
}

.demo-step-desc {
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  line-height: 1.45;
}

/* ── Footer ── */
.demo-footer {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  gap: 12px;
}

.demo-footer-price {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.demo-footer-price strong {
  color: #c9a84c;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .demo-container { padding: 18px 16px 16px; }
  .demo-footer { flex-direction: column; text-align: center; }
  .demo-level-name { font-size: 18px; }
}
