/* === Page-specific styles for n8n-templates === */

/* Agentic Stack (3-column) */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.stack-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transition: transform 0.3s;
  text-align: center;
}
.stack-card:hover { transform: translateY(-4px); }
.stack-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; font-weight: 700; }
.stack-card .stack-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.stack-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.stack-icon-agent {
  background: rgba(99,102,241,0.1);
  color: var(--accent);
}
.stack-icon-rag {
  background: rgba(34,197,94,0.1);
  color: var(--green);
}
.stack-icon-mcp {
  background: rgba(168,85,247,0.1);
  color: var(--purple);
}

/* Category sections */
.cat-section {
  margin-bottom: 6rem;
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  font-weight: 700;
}
.cat-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.cat-header .cat-price {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  background: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.cat-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Workflow diagram */
.workflow-diagram {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  overflow: visible;
}
.workflow-diagram svg {
  width: 100%;
  height: auto;
}
.agentic-diagram {
  padding: 1rem 1.5rem;
}

/* Template grid */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.tpl-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  position: relative;
}
.tpl-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}
.tpl-id {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
.tpl-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.tpl-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.tpl-card p strong { color: var(--text); font-weight: 600; }

/* Category colors */
.cat-ai { background: rgba(99,102,241,0.15); color: var(--accent); }
.cat-know { background: rgba(34,197,94,0.15); color: var(--green); }
.cat-spec { background: rgba(168,85,247,0.15); color: var(--purple); }
.cat-dom { background: rgba(245,158,11,0.15); color: var(--orange); }
.cat-rev { background: rgba(6,182,212,0.15); color: var(--cyan); }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.price-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  position: relative;
  overflow: visible;
}
.price-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}
.price-card.featured {
  border: 2px solid var(--accent);
  position: relative;
}
.price-card.featured::before {
  content: attr(data-badge);
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  padding: 0.3rem 1.2rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 3;
  letter-spacing: 0.03em;
}
.price-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; font-weight: 700; }
.price-amount {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 1rem 0 0.25rem;
  letter-spacing: -0.03em;
}
.price-period { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem; }
.price-desc { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; }

/* Sub-workflows */
.sw-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.sw-tag {
  background: #fff;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transition: all 0.3s;
}
.sw-tag:hover {
  transform: translateY(-2px);
}

/* Terminal overrides (page-specific) */
.terminal-output {
  background: var(--bg-dark);
  max-width: 650px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.terminal-header {
  gap: 8px;
  padding: 1rem 1.25rem;
  align-items: center;
}
.terminal-dot { width: 12px; height: 12px; }
.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.terminal-body {
  padding: 1.5rem 1.75rem;
  font-size: 0.85rem;
  line-height: 1.9;
}
.t-prompt { color: var(--green); }
.t-comment { color: #444; }
.typing-cursor {
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

/* How it works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.step-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }

/* Scroll-linked pricing rotation */
.price-card.reveal {
  opacity: 0;
  transform: perspective(1200px) rotateY(40deg);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.price-card.reveal.visible {
  opacity: 1;
  transform: perspective(1200px) rotateY(0);
}
.price-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.price-card.reveal:nth-child(3) { transition-delay: 0.2s; }
.price-card.reveal:nth-child(4) { transition-delay: 0.3s; }

/* Category fly-in from depth */
.cat-section.reveal {
  opacity: 0;
  transform: perspective(1200px) translateZ(-100px) translateY(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat-section.reveal.visible {
  opacity: 1;
  transform: perspective(1200px) translateZ(0) translateY(0);
}

/* Step unwrap */
.step-card.reveal {
  opacity: 0;
  transform: perspective(1200px) rotateX(30deg) translateY(40px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.step-card.reveal.visible {
  opacity: 1;
  transform: perspective(1200px) rotateX(0) translateY(0);
}
.step-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.step-card.reveal:nth-child(3) { transition-delay: 0.2s; }
.step-card.reveal:nth-child(4) { transition-delay: 0.3s; }

@media (max-width: 768px) {
  .hero-wrapper { padding: 6rem 0 4rem; }
  .stat-number { font-size: 1.8rem; }
  .stack-grid { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .cat-header { flex-wrap: wrap; }
  .cat-header .cat-price { margin-left: 0; }
  .agentic-diagram { overflow-x: auto; }
  .agentic-diagram svg { min-width: 600px; }
}
@media (max-width: 640px) {
  .hero { padding: 0 1.5rem; }
  .steps-grid { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; gap: 1rem; }
}
