/* ==========================================================================
   Demo Page - Public workout builder demo
   ========================================================================== */

/* --------------------------------------------------------------------------
   Demo Hero
   -------------------------------------------------------------------------- */

.demo-hero {
  padding: 3rem 1.25rem 1.5rem;
  text-align: center;
}

.demo-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  color: var(--light-gray);
}

.demo-hero__subtitle {
  font-size: 1.125rem;
  color: oklch(75% 0.01 255);
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Example Buttons
   -------------------------------------------------------------------------- */

.demo-examples {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.demo-examples__label {
  font-size: 0.875rem;
  color: oklch(70% 0.01 255);
  white-space: nowrap;
}

.demo-examples__buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.demo-examples__btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid oklch(45% 0.01 255);
  border-radius: 4px;
  background: oklch(25% 0.01 255);
  color: oklch(85% 0.01 255);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.demo-examples__btn:hover {
  background: oklch(35% 0.01 255);
  border-color: var(--primary-color);
  color: var(--primary-color-light);
}

/* --------------------------------------------------------------------------
   Editor Section
   -------------------------------------------------------------------------- */

.demo-editor-section {
  padding: 0 1.25rem 3rem;
}

/* --------------------------------------------------------------------------
   Split Pane Layout
   -------------------------------------------------------------------------- */

.demo-split-pane {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.demo-pane {
  flex: 1;
  min-width: 0;
}

.demo-pane__heading {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(70% 0.01 255);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-pane__spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid oklch(40% 0.01 255);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: demo-spin 0.6s linear infinite;
}

.demo-pane__spinner.hidden {
  display: none;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

/* Textarea inside the syntax-highlight container */
.demo-pane--input .syntax-highlight-container {
  min-height: 240px;
  background: #1e1e2e;
  border: 1px solid oklch(35% 0.01 255);
  border-radius: 6px;
}

.demo-pane--input .syntax-highlight-overlay {
  color: #c6d0f5;
}

.demo-pane--input textarea {
  font-size: 0.9375rem;
  line-height: 1.6;
  min-height: 240px;
  caret-color: #c6d0f5;
  border: none;
}

.demo-pane--input textarea::placeholder {
  color: oklch(50% 0.01 255);
}

/* Dark-theme highlight colors for demo page */
.demo-pane--input .hl-header {
  color: #8ab4f8;
}

.demo-pane--input .hl-quantity {
  color: #f9a825;
}

.demo-pane--input .hl-element {
  color: #81c995;
}

.demo-pane--input .hl-condition {
  color: #c58af9;
}

.demo-pane--input .hl-rest {
  color: #9aa0a6;
}

.demo-pane--input .hl-rule {
  color: #9aa0a6;
}

.demo-pane--input .hl-scaling {
  color: #5eead4;
}

/* Preview pane */
.demo-preview-content {
  background: #ffffff;
  border: 1px solid oklch(35% 0.01 255);
  border-radius: 6px;
  padding: 1rem;
  min-height: 240px;
  overflow-y: auto;
  max-height: 500px;
  color: #212529;
}

/* Boost contrast for workout preview elements inside demo */
.demo-preview-content .workout-preview__scoring,
.demo-preview-content .workout-segment__ladder-pattern {
  color: #343a40;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   CTA Section
   -------------------------------------------------------------------------- */

.demo-cta {
  padding: 4rem 1.25rem;
  text-align: center;
  background: oklch(18% 0.005 255);
  border-top: 1px solid oklch(30% 0.01 255);
}

.demo-cta__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  color: var(--light-gray);
}

.demo-cta__text {
  font-size: 1.125rem;
  color: oklch(75% 0.01 255);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.demo-cta__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Desktop Layout (side-by-side split pane)
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .demo-hero {
    padding: 4rem 2rem 2rem;
  }

  .demo-editor-section {
    padding: 0 2rem 4rem;
  }

  .demo-split-pane {
    flex-direction: row;
    gap: 2rem;
  }

  .demo-pane {
    flex: 1 1 0;
  }

  .demo-preview-content {
    max-height: 600px;
  }

  .demo-cta {
    padding: 5rem 2rem;
  }
}
