/* ============================================
   PolyStrike Tool Pages
   Unique backgrounds + feature sections for each tool
   ============================================ */

/* --- Tool page shared structure --- */
.tool-page-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
  z-index: 1;
}

.tool-page-hero .section-header {
  margin-bottom: 0;
}

.tool-page-hero .hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 36px;
}

/* Tool feature layout (also used in features.html) */
.tool-feature {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}

.tool-feature-reverse {
  direction: rtl;
}

.tool-feature-reverse > * {
  direction: ltr;
}

.tool-feature-content .step-tool {
  display: inline-block;
  margin-bottom: 20px;
}

.tool-feature-content h2 {
  margin-bottom: 16px;
}

.tool-feature-content > p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  font-size: 14px;
  color: var(--text-dim);
  padding: 8px 0 8px 24px;
  position: relative;
  line-height: 1.6;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(77,107,254,0.3);
  border: 1px solid rgba(77,107,254,0.5);
}

/* Workflow flow visualization */
.workflow-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 28px;
  background: rgba(147, 166, 255, 0.03);
  border: 1px solid rgba(147, 166, 255, 0.08);
  border-radius: var(--radius-md);
  min-width: 120px;
  transition: all 0.3s;
}

.flow-step:hover,
.flow-step-active {
  border-color: rgba(77, 107, 254, 0.3);
  background: rgba(77, 107, 254, 0.06);
  box-shadow: 0 8px 32px rgba(77,107,254,0.1);
}

.flow-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  opacity: 0.6;
}

.flow-step-active .flow-icon,
.flow-step:hover .flow-icon {
  opacity: 1;
}

.flow-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.flow-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.flow-arrow {
  font-size: 20px;
  color: var(--text-dim);
  opacity: 0.3;
}

/* --- Cross-tool link section --- */
.cross-tool-link {
  text-align: center;
  padding: 60px 0;
  position: relative;
  z-index: 1;
}

.cross-tool-link p {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.cross-tool-link .btn-secondary {
  font-size: 15px;
}

/* --- Tool accent colors for list bullets --- */
.tool-page--backtester .feature-list li::before {
  background: rgba(167,139,250,0.3);
  border-color: rgba(167,139,250,0.5);
}

.tool-page--builder .feature-list li::before {
  background: rgba(245,158,11,0.3);
  border-color: rgba(245,158,11,0.5);
}

.tool-page--designer .feature-list li::before {
  background: rgba(16,185,129,0.3);
  border-color: rgba(16,185,129,0.5);
}

.tool-page--autohedger .feature-list li::before {
  background: rgba(239,68,68,0.3);
  border-color: rgba(239,68,68,0.5);
}

/* --- Tool accent colors for step-tool label --- */
.tool-page--backtester .step-tool { color: #A78BFA; }
.tool-page--builder .step-tool { color: #F59E0B; }
.tool-page--designer .step-tool { color: #10B981; }
.tool-page--autohedger .step-tool { color: #EF4444; }

/* --- Tool accent CTA buttons --- */
.tool-page--backtester .btn-primary {
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
}
.tool-page--backtester .btn-primary:hover {
  background: linear-gradient(135deg, #C4B5FD 0%, #8B5CF6 100%);
  box-shadow: 0 4px 20px rgba(167,139,250,0.35);
}

.tool-page--builder .btn-primary {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}
.tool-page--builder .btn-primary:hover {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  box-shadow: 0 4px 20px rgba(245,158,11,0.35);
}

.tool-page--designer .btn-primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}
.tool-page--designer .btn-primary:hover {
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  box-shadow: 0 4px 20px rgba(16,185,129,0.35);
}

.tool-page--autohedger .btn-primary {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}
.tool-page--autohedger .btn-primary:hover {
  background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
  box-shadow: 0 4px 20px rgba(239,68,68,0.35);
}

/* ============================================
   UNIQUE BACKGROUNDS
   Each tool has its own CSS-only animated background
   ============================================ */

/* --- BACKTESTER: Time Machine (violet) --- */
.tool-bg-backtester {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(167,139,250,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 70% 80%, rgba(139,92,246,0.10) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 40%, rgba(124,58,237,0.06) 0%, transparent 50%);
}

.tool-bg-backtester::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 60px,
    rgba(167,139,250,0.04) 60px,
    rgba(167,139,250,0.04) 61px
  );
  animation: timelineScan 8s linear infinite;
}

.tool-bg-backtester::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(167,139,250,0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 20%, transparent 70%);
}

@keyframes timelineScan {
  0% { transform: translateY(0); }
  100% { transform: translateY(60px); }
}

/* Backtester orb overrides */
.tool-page--backtester .orb-1 { background: rgba(167, 139, 250, 0.12); }
.tool-page--backtester .orb-2 { background: rgba(139, 92, 246, 0.08); }
.tool-page--backtester .orb-3 { background: rgba(196, 181, 253, 0.06); }

/* --- BUILDER: Forge (amber/gold) --- */
.tool-bg-builder {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 30% 15%, rgba(245,158,11,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 75% 75%, rgba(251,191,36,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(217,119,6,0.05) 0%, transparent 50%);
}

.tool-bg-builder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(245,158,11,0.04) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(245,158,11,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: blueprintDrift 30s linear infinite;
}

.tool-bg-builder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245,158,11,0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 20%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 20%, transparent 65%);
}

@keyframes blueprintDrift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 48px 48px, -48px 48px; }
}

/* Builder orb overrides */
.tool-page--builder .orb-1 { background: rgba(245, 158, 11, 0.12); }
.tool-page--builder .orb-2 { background: rgba(251, 191, 36, 0.08); }
.tool-page--builder .orb-3 { background: rgba(217, 119, 6, 0.06); }

/* --- DESIGNER: Neural Network (emerald) --- */
.tool-bg-designer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(16,185,129,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 25% 70%, rgba(52,211,153,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(5,150,105,0.05) 0%, transparent 50%);
}

.tool-bg-designer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 2px at 15% 12%, rgba(16,185,129,0.25) 50%, transparent 50%),
    radial-gradient(circle 2px at 42% 28%, rgba(52,211,153,0.20) 50%, transparent 50%),
    radial-gradient(circle 1.5px at 68% 18%, rgba(16,185,129,0.22) 50%, transparent 50%),
    radial-gradient(circle 2px at 85% 45%, rgba(52,211,153,0.18) 50%, transparent 50%),
    radial-gradient(circle 1.5px at 28% 55%, rgba(16,185,129,0.20) 50%, transparent 50%),
    radial-gradient(circle 2px at 55% 72%, rgba(52,211,153,0.15) 50%, transparent 50%),
    radial-gradient(circle 1.5px at 78% 82%, rgba(16,185,129,0.18) 50%, transparent 50%),
    radial-gradient(circle 2px at 10% 85%, rgba(52,211,153,0.12) 50%, transparent 50%);
  animation: constellationDrift 20s ease-in-out infinite;
}

.tool-bg-designer::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(16,185,129,0.3) 50%, transparent 100%);
  animation: scanLine 6s ease-in-out infinite;
}

@keyframes constellationDrift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(8px, -6px); }
  66% { transform: translate(-5px, 8px); }
}

@keyframes scanLine {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Designer orb overrides */
.tool-page--designer .orb-1 { background: rgba(16, 185, 129, 0.12); }
.tool-page--designer .orb-2 { background: rgba(52, 211, 153, 0.08); }
.tool-page--designer .orb-3 { background: rgba(5, 150, 105, 0.06); }

/* --- AUTO-HEDGER: Circuit Board (red + cyan) --- */
.tool-bg-autohedger {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 10%, rgba(239,68,68,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(125,211,252,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 80% 60%, rgba(239,68,68,0.06) 0%, transparent 50%);
}

.tool-bg-autohedger::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(239,68,68,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239,68,68,0.03) 1px, transparent 1px);
  background-size: 80px 80px;
}

.tool-bg-autohedger::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 3px at 10% 30%, rgba(239,68,68,0.25) 50%, transparent 50%),
    radial-gradient(circle 3px at 30% 30%, rgba(125,211,252,0.20) 50%, transparent 50%),
    radial-gradient(circle 3px at 50% 50%, rgba(239,68,68,0.20) 50%, transparent 50%),
    radial-gradient(circle 3px at 70% 70%, rgba(125,211,252,0.18) 50%, transparent 50%),
    radial-gradient(circle 3px at 90% 50%, rgba(239,68,68,0.15) 50%, transparent 50%);
  animation: circuitPulse 3s ease-in-out infinite;
}

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

/* Auto-Hedger orb overrides */
.tool-page--autohedger .orb-1 { background: rgba(239, 68, 68, 0.12); }
.tool-page--autohedger .orb-2 { background: rgba(125, 211, 252, 0.08); }
.tool-page--autohedger .orb-3 { background: rgba(239, 68, 68, 0.06); }

/* ============================================
   TOOL PAGE OVERLAYS
   Dark overlays tuned for each accent color
   ============================================ */
.tool-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(6,10,20,0.65) 0%,
    rgba(6,10,20,0.50) 30%,
    rgba(6,10,20,0.55) 60%,
    rgba(6,10,20,0.70) 100%);
}

/* ============================================
   SVG MOCKUP HELPERS
   ============================================ */
.mock-chart {
  width: 100%;
  display: block;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.chart-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.swatch {
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

.swatch-expiry { background: #22C55E; }
.swatch-now { background: #EF4444; }
.swatch-7d { background: #F59E0B; }
.swatch-14d { background: #93A6FF; }

/* ============================================
   TOOL-SPECIFIC MOCKUP COMPONENTS
   ============================================ */

/* CSS Mockup: URL Input */
.mock-input-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(17,27,48,0.6);
  border: 1px solid rgba(77,107,254,0.15);
  border-radius: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.mock-input-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--primary);
  animation: blink 1s step-end infinite;
}

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

/* CSS Mockup: Data Table */
.mock-table {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  width: 100%;
}

.mock-table-header {
  display: grid;
  gap: 1px;
  margin-bottom: 6px;
}

.mock-table-header > div {
  padding: 8px 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 1px;
}

.mock-table-row {
  display: grid;
  gap: 1px;
  background: rgba(77,107,254,0.04);
  border-radius: 8px;
  margin-bottom: 4px;
}

.mock-table-row:nth-child(even) {
  background: rgba(77,107,254,0.02);
}

.mock-table-row > div {
  padding: 10px;
}

/* CSS Mockup: Heatmap Grid */
.mock-heatmap {
  display: grid;
  gap: 3px;
  margin-top: 12px;
}

.mock-heatmap-cell {
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
}

.heat-green-strong { background: rgba(34,197,94,0.15); color: #22C55E; }
.heat-green { background: rgba(34,197,94,0.08); color: #22C55E; }
.heat-neutral { background: rgba(147,166,255,0.05); color: var(--text-dim); }
.heat-red { background: rgba(239,68,68,0.08); color: #EF4444; }
.heat-red-strong { background: rgba(239,68,68,0.15); color: #EF4444; }

/* CSS Mockup: Leg Diagram */
.mock-legs {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.mock-leg {
  padding: 16px 20px;
  background: rgba(17,27,48,0.6);
  border: 1px solid rgba(77,107,254,0.15);
  border-radius: 12px;
  text-align: center;
  min-width: 100px;
}

.mock-leg-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.mock-leg-detail {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.mock-leg-connector {
  font-size: 18px;
  color: var(--text-dim);
  opacity: 0.3;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .tool-feature,
  .tool-feature-reverse {
    grid-template-columns: 1fr;
    gap: 32px;
    direction: ltr;
  }

  .tool-page-hero {
    min-height: auto;
    padding: 120px 0 60px;
  }

  .tool-page-hero .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .workflow-flow {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .mock-legs {
    flex-direction: column;
  }

  .mock-leg-connector {
    transform: rotate(90deg);
  }
}

@media (max-width: 480px) {
  .tool-page-hero {
    padding: 100px 0 40px;
  }
}
