/* ═══════════════════════════════════════════════
   demo.css — Apex Systematic
   Shared foundation for all demo pages.
   Load after style.css.
   ═══════════════════════════════════════════════ */


/* ── 1. Demo-specific variables ─────────────────
   Override / extend style.css variables for demos.
   --radius comes from style.css (2px) — sharp edges.
   Demo-only vars that style.css doesn't have.
─────────────────────────────────────────────── */
:root {
  --bg-card:     #13181F;
  --bg-input:    #1A2030;
  --bg-msg-user: #1E2535;
  --border-gold: rgba(201, 168, 76, 0.35);
  --gold-dim:    rgba(201, 168, 76, 0.08);
  --green:       #2ECC71;
  --green-dim:   rgba(46, 204, 113, 0.1);
  --red:         #E74C3C;
  --red-dim:     rgba(231, 76, 60, 0.1);
}


/* ── 2. Base overrides ───────────────────────────
   style.css sets h3 to --font-body and a { color: inherit }.
   Demos use --font-display for all headings, and gold
   for content-area links.
─────────────────────────────────────────────── */
body {
  min-height: 100vh;
}

.page-wrapper h3 {
  font-family: var(--font-display);
  font-weight: 400;
}

.page-wrapper a:not(.btn):not(.btn-primary):not(.btn-ghost),
.cta-section a:not(.btn):not(.btn-primary):not(.btn-ghost) {
  color: var(--gold);
}


/* ── 3. Page layout ──────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 100px 24px 80px;
}


/* ── 4. Header ───────────────────────────────── */
.page-wrapper header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 0 40px;
  text-align: center;
  border-bottom: none;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  text-decoration: none;
}

.logo-wrap svg {
  width: 240px;
  height: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.page-wrapper h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 14px;
}

.page-wrapper h1 em {
  font-style: italic;
  color: var(--gold);
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.65;
}


/* ── 5. Divider ──────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 36px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

.divider-icon {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}


/* ── 6. Cards ────────────────────────────────── */
.card,
.form-card,
.output-card,
.panel-card,
.chat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

/* Gold top-line accent */
.card::before,
.form-card::before,
.output-card::before,
.chat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.card-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-body {
  padding: 20px;
}


/* ── 7. Form elements ────────────────────────── */
.page-wrapper .form-group.full {
  grid-column: 1 / -1;
}

.page-wrapper .form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.page-wrapper .form-group:last-of-type {
  margin-bottom: 0;
}

.page-wrapper label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-wrapper input,
.page-wrapper select,
.page-wrapper textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.page-wrapper input::placeholder,
.page-wrapper textarea::placeholder {
  color: var(--text-dim);
}

.page-wrapper input:focus,
.page-wrapper select:focus,
.page-wrapper textarea:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.07);
}

.page-wrapper select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B8D96' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.page-wrapper select option {
  background: var(--bg-input);
  color: var(--white);
}

.page-wrapper textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}


/* ── 8. Generate / Submit buttons ────────────── */
.generate-btn,
.submit-btn {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.generate-btn:hover,
.submit-btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.25);
}

.generate-btn:disabled,
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* ── 9. Spinner ──────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(14, 17, 23, 0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

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


/* ── 10. Pipeline bar ────────────────────────── */
.pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px 24px;
  overflow-x: auto;
}

.pipe-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 90px;
}

.pipe-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid var(--border);
  background: var(--bg);
  transition: all 0.35s;
}

.pipe-icon.active {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

.pipe-icon.done {
  border-color: var(--green);
  background: var(--green-dim);
}

.pipe-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  transition: color 0.3s;
  max-width: 80px;
}

.pipe-label.active { color: var(--gold); }
.pipe-label.done   { color: var(--text-muted); }

.pipe-arrow {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 4px;
  flex-shrink: 0;
  padding-bottom: 20px;
}


/* ── 11. Empty state ─────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  min-height: 460px;
}

.empty-icon {
  width: 56px;
  height: 56px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
  max-width: 280px;
  line-height: 1.6;
}


/* ── 12. Status pill ─────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.status-pill.generated {
  background: var(--green-dim);
  border: 1px solid rgba(46, 204, 113, 0.25);
  color: var(--green);
}

.status-pill.generating {
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}


/* ── 13. CTA section ─────────────────────────── */
.cta-section {
  margin-top: 40px;
  padding: 36px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.cta-section h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.cta-section p {
  font-size: 15px;
  margin-bottom: 24px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-pricing-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem;
  text-decoration: none;
}

/* CTA buttons use .btn .btn-primary / .btn .btn-ghost from style.css — no overrides needed. */


/* ── 14. Footer ──────────────────────────────── */
/* (site footer is injected by components.js and styled by style.css — no overrides here) */


/* ── 15. Shared animations ───────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 16. Utility ─────────────────────────────── */
.hidden { display: none !important; }
.gold   { color: var(--gold); }
.mono   { font-family: monospace; font-size: 12px; }


/* ── 17. Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .cta-section { padding: 28px 20px; }
  .two-col { grid-template-columns: 1fr; }
}
