/* Bot Army SRE Theme - RICED TO THE MAX
   Technical Operations Excellence Presentation Suite
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* =============================================================================
   BASE COLORS - Dark mode foundation with depth
   ============================================================================= */
:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f35;
  --bg-card: #132237;
  --bg-card-hover: #1a3a52;
  --bg-code: #0d1926;

  /* PRIMARY ACCENT: Teal (Reliability/Stability/Trust) */
  --accent-primary: #14b8a6;
  --accent-primary-light: #5eead4;
  --accent-primary-dark: #0d9488;
  --accent-primary-glow: rgba(20, 184, 166, 0.4);
  --accent-primary-subtle: rgba(20, 184, 166, 0.1);

  /* SECONDARY ACCENTS - Semantic Colors */
  --accent-blue: #38bdf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;
  --accent-violet: #a78bfa;
  --accent-cyan: #22d3ee;

  /* THEME-SPECIFIC COLORS (One per topic area) */
  --theme-foundations: #14b8a6;
  --theme-observability: #38bdf8;
  --theme-resilience: #a78bfa;
  --theme-incidents: #fb7185;
  --theme-release: #34d399;
  --theme-infrastructure: #f59e0b;
  --theme-ai: #8b5cf6;
  --theme-agentic: #06b6d4;
  --theme-culture: #ec4899;
  --theme-industry: #84cc16;
  --theme-chaos: #f97316;
  --theme-security: #ef4444;
  --theme-performance: #eab308;

  /* TEXT COLORS */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: var(--accent-primary);

  /* GRADIENTS - The magic */
  --gradient-hero: linear-gradient(135deg, #0a1628 0%, #132237 50%, #14b8a6 150%);
  --gradient-card: linear-gradient(180deg, rgba(19, 34, 55, 0.9) 0%, rgba(10, 22, 40, 0.95) 100%);
  --gradient-accent: linear-gradient(90deg, #14b8a6 0%, #38bdf8 100%);
  --gradient-hot: linear-gradient(90deg, #fb7185 0%, #f59e0b 100%);
  --gradient-cool: linear-gradient(90deg, #38bdf8 0%, #a78bfa 100%);
  --gradient-success: linear-gradient(90deg, #34d399 0%, #14b8a6 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, hsla(174deg, 83%, 40%, 0.15) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(200deg, 94%, 60%, 0.1) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(274deg, 76%, 72%, 0.1) 0px, transparent 50%);

  /* GLOW EFFECTS - Neon accents */
  --glow-teal: 0 0 20px rgba(20, 184, 166, 0.5), 0 0 40px rgba(20, 184, 166, 0.3);
  --glow-blue: 0 0 20px rgba(56, 189, 248, 0.5), 0 0 40px rgba(56, 189, 248, 0.3);
  --glow-rose: 0 0 20px rgba(251, 113, 133, 0.5), 0 0 40px rgba(251, 113, 133, 0.3);
  --glow-emerald: 0 0 20px rgba(52, 211, 153, 0.5), 0 0 40px rgba(52, 211, 153, 0.3);
  --glow-subtle: 0 0 10px rgba(20, 184, 166, 0.2);

  /* SHADOWS & DEPTH */
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 30px rgba(20, 184, 166, 0.15);
  --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);

  /* BORDERS & DIVIDERS */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.05);
  --border-accent: 2px solid var(--accent-primary);
  --border-glow: 1px solid rgba(20, 184, 166, 0.3);
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
}

/* =============================================================================
   PAGE SETUP - One-Pager Optimized
   ============================================================================= */
@page {
  size: letter;
  margin: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  width: 100%;
  background: var(--bg-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-size: 10pt;
  line-height: 1.5;

  /* Center the one-pager in viewport */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* =============================================================================
   ONE-PAGER CONTAINER
   ============================================================================= */
.one-pager {
  width: 100%;
  max-width: 8.5in;
  height: 11in;
  max-height: 11in;
  padding: 0.22in;
  display: flex;
  flex-direction: column;
  gap: 0.08in;
  background: var(--bg-primary);
  background-image: var(--gradient-mesh);
  position: relative;
  overflow: hidden;
}

.one-pager::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* =============================================================================
   HEADER SECTION
   ============================================================================= */
.header {
  text-align: center;
  padding: 0.12in 0.2in;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(20, 184, 166, 0.05) 50%, var(--bg-card) 100%);
  border-radius: var(--border-radius-lg);
  border-bottom: 3px solid var(--accent-primary);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header h1 {
  font-size: 20pt;
  font-weight: 900;
  color: var(--accent-primary);
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}

.header .subtitle {
  font-size: 10pt;
  color: var(--accent-blue);
  font-weight: 500;
}

.header .tagline {
  font-size: 7pt;
  color: var(--text-secondary);
  margin-top: 3px;
  font-style: italic;
}

/* =============================================================================
   STATS ROW - Key Metrics
   ============================================================================= */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 0.12in;
  padding: 0.06in 0;
}

.stat-box {
  text-align: center;
  padding: 0.06in 0.15in;
  background: var(--gradient-card);
  border: var(--border-glow);
  border-radius: var(--border-radius-md);
  min-width: 1in;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  box-shadow: var(--glow-teal);
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(20, 184, 166, 0.5);
}

.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18pt;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 6pt;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
  font-weight: 600;
}

/* =============================================================================
   TWO COLUMN LAYOUT
   ============================================================================= */
.two-col {
  display: flex;
  gap: 0.12in;
  flex: 1;
  align-items: stretch;
}

.column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05in;
  justify-content: space-between;
}

/* =============================================================================
   SECTION CARDS
   ============================================================================= */
.section {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 0.06in 0.1in;
  border: var(--border-subtle);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
}

.section:hover {
  border-color: rgba(20, 184, 166, 0.3);
  transform: scale(1.005);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Theme-specific section borders */
.section[data-theme="foundations"]::before { background: var(--theme-foundations); }
.section[data-theme="observability"]::before { background: var(--gradient-cool); }
.section[data-theme="resilience"]::before { background: var(--theme-resilience); }
.section[data-theme="incidents"]::before { background: var(--gradient-hot); }
.section[data-theme="release"]::before { background: var(--gradient-success); }
.section[data-theme="infrastructure"]::before { background: var(--theme-infrastructure); }
.section[data-theme="ai"]::before { background: var(--theme-ai); }
.section[data-theme="agentic"]::before { background: var(--theme-agentic); }
.section[data-theme="culture"]::before { background: var(--theme-culture); }
.section[data-theme="industry"]::before { background: var(--theme-industry); }
.section[data-theme="chaos"]::before { background: var(--theme-chaos); }
.section[data-theme="security"]::before { background: var(--theme-security); }
.section[data-theme="performance"]::before { background: var(--theme-performance); }

.section-title {
  font-size: 8pt;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.04in;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--bg-card-hover);
  white-space: nowrap;
}

/* =============================================================================
   LISTS
   ============================================================================= */
.section ul {
  list-style: none;
  padding: 0;
}

.section li {
  padding: 2px 0;
  padding-left: 12px;
  position: relative;
  font-size: 7.5pt;
  color: var(--text-secondary);
  line-height: 1.35;
}

.section li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
  font-size: 7pt;
}

.section li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* =============================================================================
   TABLES
   ============================================================================= */
.section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
}

.section th {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  text-align: left;
  font-size: 6.5pt;
}

.section td {
  padding: 2px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* Zebra striping */
.section tbody tr:nth-child(even) td,
.section tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.section tr:hover td {
  background: rgba(20, 184, 166, 0.08);
}

/* =============================================================================
   QUOTE BOX
   ============================================================================= */
.quote-box {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(20, 184, 166, 0.05) 100%);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  padding: 0.06in 0.08in 0.06in 0.18in;
  position: relative;
  margin-top: 2px;
}

.quote-box::before {
  content: '"';
  font-size: 16pt;
  color: var(--accent-primary);
  opacity: 0.4;
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: Georgia, serif;
  line-height: 1;
}

.quote-box .quote {
  font-size: 7.5pt;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.35;
}

.quote-box .attribution {
  margin-top: 3px;
  font-size: 6pt;
  color: var(--accent-primary);
  font-weight: 600;
  text-align: right;
}

/* =============================================================================
   VISION/HIGHLIGHT BOX
   ============================================================================= */
.vision-box {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(20, 184, 166, 0.15) 50%, rgba(56, 189, 248, 0.1) 100%);
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-md);
  padding: 0.08in;
  text-align: center;
  box-shadow: var(--glow-teal), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.vision-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.vision-box .headline {
  font-size: 9pt;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
  position: relative;
}

.vision-box .subhead {
  font-size: 7pt;
  color: var(--text-secondary);
  position: relative;
  line-height: 1.3;
}

/* =============================================================================
   METRIC CALLOUT
   ============================================================================= */
.metric-callout {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0.04in 0.06in;
  background: var(--accent-primary-subtle);
  border-radius: var(--border-radius-sm);
  border: var(--border-glow);
}

.metric-callout-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12pt;
  font-weight: 700;
  color: var(--accent-primary);
}

.metric-callout-label {
  font-size: 6pt;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =============================================================================
   PILLAR CARDS
   ============================================================================= */
.pillars {
  display: flex;
  gap: 0.06in;
}

.pillar-card {
  flex: 1;
  background: var(--bg-card);
  border-left: 3px solid var(--pillar-color, var(--accent-primary));
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  padding: 0.04in 0.06in;
  transition: all 0.2s ease;
}

.pillar-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(2px);
}

.pillar-card h4 {
  font-size: 7pt;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pillar-card p {
  font-size: 6pt;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* =============================================================================
   MATURITY BAR
   ============================================================================= */
.maturity-bar {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-sm);
}

.maturity-level {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.maturity-level.filled {
  background: linear-gradient(90deg, var(--accent-emerald) 0%, var(--accent-primary) 100%);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.maturity-level.current {
  background: var(--accent-primary);
  box-shadow: var(--glow-teal);
  animation: pulse 2s ease-in-out infinite;
}

/* =============================================================================
   COMPARE GRID
   ============================================================================= */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.05in;
}

.compare-col {
  padding: 0.04in;
  border-radius: var(--border-radius-sm);
}

.compare-col.before {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.compare-col.after {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.compare-title {
  font-size: 6pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.before .compare-title { color: var(--accent-rose); }
.after .compare-title { color: var(--accent-emerald); }

/* =============================================================================
   SOURCES / REFERENCES
   ============================================================================= */
.sources {
  font-size: 5.5pt;
  color: var(--text-muted);
  padding: 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sources sup {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Superscript in stat labels */
.stat-label sup {
  color: var(--accent-primary);
  font-size: 5pt;
  margin-left: 1px;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.08in;  /* Increased for better visual separation */
  margin-top: 0.04in;   /* Additional spacing above footer */
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 5.5pt;
  color: var(--text-muted);
}

.footer .brand {
  font-weight: 600;
  color: var(--text-secondary);
}

.footer .cta {
  color: var(--accent-primary);
  font-weight: 600;
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s ease-out forwards;
}

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

.live-indicator {
  animation: pulse 2s ease-in-out infinite;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */
@media print {
  html, body {
    padding: 0;
    margin: 0;
    background: var(--bg-primary) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .one-pager {
    width: 8.5in;
    height: 11in;
    max-width: 8.5in;
    max-height: 11in;
    overflow: hidden;
    background: var(--bg-primary) !important;
    background-image: var(--gradient-mesh) !important;
    padding: 0.22in;
    margin: 0;
    box-shadow: none;
  }

  .one-pager::before {
    display: none; /* Hide grid pattern in print */
  }

  .section {
    break-inside: avoid;
    box-shadow: none;
  }

  .stat-box {
    box-shadow: none;
    border: 1px solid var(--accent-primary);
  }

  .vision-box {
    box-shadow: none;
  }

  .maturity-level.current {
    animation: none;
  }

  .no-print {
    display: none !important;
  }

  /* Ensure colors print correctly */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* =============================================================================
   LIGHT MODE
   Use: Add class="light-mode" to <html> or <body>, or use ?theme=light in URL
   ============================================================================= */
.light-mode,
[data-theme-mode="light"] {
  /* Base colors - Light mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #fff;
  --bg-card-hover: #f1f5f9;
  --bg-code: #f1f5f9;

  /* Text colors - Light mode */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Adjusted accent colors for better contrast on light */
  --accent-primary: #0d9488;
  --accent-primary-light: #14b8a6;
  --accent-primary-dark: #0f766e;
  --accent-primary-glow: rgba(13, 148, 136, 0.3);
  --accent-primary-subtle: rgba(13, 148, 136, 0.1);

  /* Adjusted secondary accents */
  --accent-blue: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-violet: #7c3aed;
  --accent-cyan: #0891b2;

  /* Adjusted gradients */
  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #ccfbf1 150%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%);
  --gradient-mesh: radial-gradient(at 40% 20%, rgba(13, 148, 136, 0.08) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, rgba(2, 132, 199, 0.06) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, rgba(124, 58, 237, 0.06) 0px, transparent 50%);

  /* Adjusted glows - more subtle on light */
  --glow-teal: 0 0 15px rgba(13, 148, 136, 0.25), 0 0 30px rgba(13, 148, 136, 0.15);
  --glow-subtle: 0 0 8px rgba(13, 148, 136, 0.15);

  /* Adjusted shadows */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.1);

  /* Adjusted borders */
  --border-subtle: 1px solid rgba(0, 0, 0, 0.08);
  --border-glow: 1px solid rgba(13, 148, 136, 0.3);
}

/* Light mode specific overrides */
.light-mode .one-pager::before,
[data-theme-mode="light"] .one-pager::before {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

.light-mode .section th,
[data-theme-mode="light"] .section th {
  background: rgba(13, 148, 136, 0.1);
}

.light-mode .section tbody tr:nth-child(even) td,
.light-mode .section tr:nth-child(even) td,
[data-theme-mode="light"] .section tbody tr:nth-child(even) td,
[data-theme-mode="light"] .section tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.light-mode .section tr:hover td,
[data-theme-mode="light"] .section tr:hover td {
  background: rgba(13, 148, 136, 0.06);
}

.light-mode .maturity-bar,
[data-theme-mode="light"] .maturity-bar {
  background: rgba(0, 0, 0, 0.05);
}

.light-mode .maturity-level,
[data-theme-mode="light"] .maturity-level {
  background: rgba(0, 0, 0, 0.1);
}

/* Auto light mode based on system preference */
@media (prefers-color-scheme: light) {
  html:not(.dark-mode, [data-theme-mode="dark"]) {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #fff;
    --bg-card-hover: #f1f5f9;
    --bg-code: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-primary: #0d9488;
    --accent-blue: #0284c7;
    --border-subtle: 1px solid rgba(0, 0, 0, 0.08);
  }
}

/* =============================================================================
   LIGHT MODE PRINT STYLES
   ============================================================================= */
@media print {
  .light-mode,
  [data-theme-mode="light"] {
    --bg-primary: #fff !important;
    --bg-card: #fff !important;
  }

  .light-mode .one-pager,
  [data-theme-mode="light"] .one-pager {
    background: #fff !important;
    background-image: none !important;
  }

  .light-mode .stat-box,
  [data-theme-mode="light"] .stat-box {
    border: 1px solid var(--accent-primary) !important;
    background: #fff !important;
  }

  .light-mode .section,
  [data-theme-mode="light"] .section {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
  }

  .light-mode .header,
  [data-theme-mode="light"] .header {
    background: #fff !important;
  }
}
