/* Modern 9M BOTA stylesheet */
:root {
  --bg: #030a33;
  --bg-elevated: #061244;
  --bg-card: #0b1854;
  --bg-glass: rgba(11, 24, 84, 0.7);
  --text: #f9fafb;
  --text-muted: #b0c4f8;
  --amber: #e8c234;
  --amber-600: #c7a11d;
  --amber-glow: rgba(232, 194, 52, 0.25);
  --blue: #1d4ed8;
  --green: #10b981;
  --red: #c00b0c;
  --border: rgba(232, 194, 52, 0.2);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(232, 194, 52, 0.15);
  --max-width: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--amber);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(3, 10, 51, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.logo-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber);
}

.logo-text {
  color: var(--amber);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
  text-decoration: none;
}

.nav-install-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--amber);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-left: 0.5rem;
}

.nav-install-btn:hover {
  background: var(--amber-600);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 194, 52, 0.12), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(192, 11, 12, 0.1), transparent 35%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
  z-index: -1;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero-logo {
  display: block;
  width: 10rem;
  height: 10rem;
  object-fit: contain;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 30px rgba(232, 194, 52, 0.25));
}

.eyebrow {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(232, 194, 52, 0.12);
  color: var(--amber);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1rem;
}

.text-amber {
  color: var(--amber);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  min-width: 140px;
}

.stat strong {
  display: block;
  font-size: 1.75rem;
  color: var(--amber);
}

.stat span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--amber);
  color: var(--bg);
  border-color: var(--amber);
}

.btn-primary:hover {
  background: var(--amber-600);
  box-shadow: 0 0 20px var(--amber-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
}

.button-stack {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Sections */
.section {
  padding: 5rem 1.5rem;
}

.section-dark {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.text-center {
  text-align: center;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.card-glow {
  box-shadow: var(--shadow-glow);
}

.card-title {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--amber);
}

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.feature-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--amber);
  font-weight: 700;
}

.numbered-list {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.numbered-list li {
  margin-bottom: 0.75rem;
}

.prose p,
.prose h2,
.prose ul,
.prose ol {
  max-width: 760px;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.75rem;
}

.callout {
  background: var(--bg-card);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout h3 {
  margin-top: 0;
  color: var(--amber);
}

/* Page hero */
.page-hero {
  padding: 6rem 1.5rem 3rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 194, 52, 0.1), transparent 50%),
    var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.75rem;
}

.page-hero-list {
  text-align: left;
}

/* Bunker grid cards on home */
.bunker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.bunker-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.bunker-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.bunker-ref {
  display: inline-block;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(232, 194, 52, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.35rem;
  margin-bottom: 0.75rem;
}

.bunker-name {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.bunker-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.region-tag {
  background: var(--bg-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
}

.locator {
  font-family: monospace;
}

/* Bunker list page */
.section-list {
  background: var(--bg);
  padding-top: 2rem;
}

.list-controls {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.search-input,
.filter-select {
  width: 100%;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
}

.search-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.count {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.map-wrapper {
  margin-bottom: 2.5rem;
}

.map-title {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.map-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.bunker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.bunker-table th,
.bunker-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.bunker-table th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bunker-table tr.hidden {
  display: none;
}

.bunker-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.bunker-table .ref {
  font-family: monospace;
  font-weight: 700;
  color: var(--amber);
}

.bunker-table .region {
  font-size: 0.9rem;
}

.bunker-table .locator,
.bunker-table .coords {
  font-family: monospace;
  color: var(--text-muted);
}

.bunker-table .map-link {
  font-weight: 600;
}

.bunker-table .distance {
  font-family: monospace;
  color: var(--amber);
  font-size: 0.85rem;
  white-space: nowrap;
}

.distance-col {
  min-width: 80px;
}

.sort-nearest-btn {
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
}

.sort-nearest-btn.active {
  background: var(--amber);
  color: var(--bg);
  border-color: var(--amber);
}

.download-note {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--amber);
}

.footer p {
  margin: 0.25rem 0;
}

/* Map marker popup */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.leaflet-popup-content a {
  color: var(--amber);
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    border-radius: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-install-btn {
    width: 100%;
    margin: 0.75rem 0 0;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .list-controls {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .distance-col {
    display: none;
  }

  .bunker-table .distance {
    font-size: 0.8rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
  }

  .stat {
    width: 100%;
    max-width: 240px;
  }

  .section {
    padding: 3rem 1rem;
  }

  .page-hero {
    padding: 4rem 1rem 2rem;
  }
}

/* Utility */
.text-center {
  text-align: center;
}
