<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>PeerCortex Executive Summary - AS{{asn}}</title>
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      color: #333;
      line-height: 1.6;
      background: white;
    }
    .page { page-break-after: always; padding: 40px; min-height: 100vh; }
    .page:last-child { page-break-after: avoid; }
    h1 {
      font-size: 2.5em;
      margin-bottom: 0.5em;
      color: #1e40af;
    }
    h2 {
      font-size: 1.8em;
      margin-top: 1em;
      margin-bottom: 0.5em;
      color: #1e40af;
      border-bottom: 2px solid #e5e7eb;
      padding-bottom: 0.3em;
    }
    .title-page {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      min-height: 100vh;
    }
    .title-page h1 { font-size: 3.5em; margin-bottom: 0.2em; }
    .title-page .subtitle { font-size: 1.5em; color: #6b7280; margin-bottom: 2em; }
    .title-page .date { color: #9ca3af; font-size: 1em; }
    .score-card {
      background: #f3f4f6;
      border-left: 4px solid #3b82f6;
      padding: 20px;
      margin: 20px 0;
      border-radius: 4px;
    }
    .score-card .label { font-size: 0.9em; color: #6b7280; margin-bottom: 5px; }
    .score-card .value { font-size: 2.5em; font-weight: bold; color: #1e40af; }
    .summary-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
      margin: 20px 0;
    }
    .summary-item {
      background: #f9fafb;
      padding: 15px;
      border-radius: 4px;
      border: 1px solid #e5e7eb;
    }
    .summary-item .label { font-size: 0.85em; color: #6b7280; }
    .summary-item .value { font-size: 1.5em; font-weight: bold; color: #1e40af; margin-top: 5px; }
    .highlight {
      background: #fef3c7;
      border-left: 4px solid #f59e0b;
      padding: 15px;
      margin: 20px 0;
      border-radius: 4px;
    }
    ul { margin-left: 25px; margin-top: 10px; }
    li { margin-bottom: 8px; }
  </style>
</head>
<body>
  <div class="page title-page">
    <h1>PeerCortex Executive Summary</h1>
    <div class="subtitle">Autonomous System AS{{asn}}</div>
    <div class="subtitle">{{networkName}}</div>
    <div class="date">Generated: {{generatedAt}}</div>
  </div>

  <div class="page">
    <h2>Network Health Overview</h2>
    <div class="score-card">
      <div class="label">Overall Health Score</div>
      <div class="value">{{healthScore.overall}}/100</div>
    </div>
    <div class="summary-grid">
      <div class="summary-item">
        <div class="label">ASPA Adoption</div>
        <div class="value">{{healthScore.aspa}}</div>
      </div>
      <div class="summary-item">
        <div class="label">RPKI Compliance</div>
        <div class="value">{{healthScore.rpki}}</div>
      </div>
      <div class="summary-item">
        <div class="label">BGP Stability</div>
        <div class="value">{{healthScore.bgp_stability}}</div>
      </div>
      <div class="summary-item">
        <div class="label">Peering Health</div>
        <div class="value">{{healthScore.peering_health}}</div>
      </div>
    </div>
  </div>

  <div class="page">
    <h2>Key Findings</h2>
    <h3>Security Status</h3>
    <ul>
      <li>Recent hijacks detected: {{threats.recent_hijacks}}</li>
      <li>Network anomalies: {{threats.anomalies_detected}}</li>
      <li>RPKI invalid routes: {{threats.rpki_invalids}}</li>
      <li>MOAS events: {{threats.moas_events}}</li>
    </ul>

    <h3>Network Infrastructure</h3>
    <ul>
      <li>IXP connections: {{peering.ixp_connections}}</li>
      <li>Peer count: {{peering.peer_count}}</li>
      <li>Route exports: {{peering.route_exports}}</li>
    </ul>
  </div>

  <div class="page">
    <h2>Strategic Recommendations</h2>
    {{#each recommendations}}
    <div class="highlight">
      <strong>{{this}}</strong>
    </div>
    {{/each}}
  </div>

  <div class="page">
    <h2>Next Steps</h2>
    <p>Recommended actions for leadership:</p>
    <ul>
      <li>Review and address identified security threats</li>
      <li>Prioritize ASPA adoption for enhanced network security</li>
      <li>Evaluate peering relationships for optimization opportunities</li>
      <li>Schedule follow-up analysis in 90 days</li>
    </ul>
  </div>
</body>
</html>
