/* ═══════════════════ Accidents Page ═══════════════════ */

.acc-hero {
  background: linear-gradient(135deg, #8B0000 0%, #4a0000 100%);
  color: #fff; padding: 1.5rem 1rem; text-align: center;
}
.acc-hero h1 { font-size: 1.5rem; margin: 0; color: #fff; }
.acc-hero p { font-size: 0.88rem; opacity: 0.8; margin: 0.2rem 0 0.75rem; }
.acc-hero-stats {
  display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
  font-size: 0.82rem; opacity: 0.9;
}
.acc-hero-stats strong { font-size: 1.1rem; }

.acc-container {
  max-width: 1200px; margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.acc-heading {
  font-size: 1rem; color: #8B0000; margin: 0 0 0.75rem;
}

/* Filters */
.acc-filters {
  display: flex; gap: 0.5rem; align-items: center;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.acc-filter-btn {
  font-size: 0.82rem; font-weight: 600;
  padding: 0.3rem 0.7rem; border-radius: 5px;
  border: 1px solid #e2e8f0; background: #fff;
  color: #4a5568; text-decoration: none; transition: all 0.15s;
}
.acc-filter-btn:hover { border-color: #8B0000; color: #8B0000; }
.acc-filter-btn.active { background: #8B0000; color: #fff; border-color: #8B0000; }

/* Accident Table */
.acc-list {
  max-height: 500px; overflow-y: auto;
  border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 1.5rem;
}
.acc-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.acc-table thead th {
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.acc-table th {
  text-align: left; padding: 0.5rem; border-bottom: 2px solid #e0e0e0;
  font-size: 0.78rem; color: #888; text-transform: uppercase; letter-spacing: 0.03em;
}
.acc-sortable {
  cursor: pointer; user-select: none; white-space: nowrap;
}
.acc-sortable:hover { color: #1E3A7B; }
.sort-arrow { font-size: 0.65rem; color: #1E3A7B; }
.acc-table td {
  padding: 0.5rem; border-bottom: 1px solid #f0f0f0;
}
.acc-table tr.fatal-row { background: #fef2f2; }
.acc-table tr:hover { background: #f8f9fa; }

.acc-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 4px;
}
.acc-badge.fatal { background: #fdecea; color: #c0392b; }
.acc-badge.serious { background: #fef5e7; color: #d4922e; }
.acc-badge.minor { background: #e6f4ec; color: #27ae60; }

.acc-view-btn {
  font-size: 0.78rem; font-weight: 600; color: #1E3A7B;
  text-decoration: none; white-space: nowrap;
}
.acc-view-btn:hover { color: #8B0000; }

/* Cause Cards */
.acc-causes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
  max-width: 900px; margin-left: auto; margin-right: auto;
}
.acc-cause {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 1rem; border-left: 4px solid;
}
.acc-cause__count {
  font-size: 1.8rem; font-weight: 800; margin: 0 0 0.15rem; line-height: 1;
}
.acc-cause__title { font-weight: 700; font-size: 0.92rem; margin: 0 0 0.25rem; }
.acc-cause__desc { font-size: 0.82rem; color: #4a5568; margin: 0; line-height: 1.5; }

/* Resource Links */
.acc-resources-split {
  display: flex; justify-content: center; align-items: stretch;
  gap: 1.5rem; margin-bottom: 1.5rem;
}
.acc-resources-group {
  display: flex; flex-direction: column; gap: 0.6rem;
  flex: 1; max-width: 320px;
}
.acc-resources-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #a0aec0;
}
.acc-resources-divider {
  width: 1px; background: #e2e8f0; align-self: stretch;
}
.acc-resource {
  display: block; padding: 0.75rem; border: 1px solid #e2e8f0;
  border-radius: 8px; text-decoration: none; transition: box-shadow 0.15s;
  border-left: 4px solid #8B0000;
}
.acc-resource:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.acc-resource strong { display: block; font-size: 0.88rem; color: #1E3A7B; }
.acc-resource span { font-size: 0.78rem; color: #888; }
.acc-resource.cpa { border-left-color: #1E3A7B; background: #f0f4fa; }

@media (max-width: 768px) {
  .acc-resources-split { flex-direction: column; align-items: center; }
  .acc-resources-divider { width: 80%; height: 1px; }
}

/* Fullscreen map */
.acc-fullscreen-btn {
  background: #1E3A7B; color: #fff; border: none;
  border-radius: 5px; padding: 0.3rem 0.6rem;
  font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.acc-fullscreen-btn:hover { background: #142954; }
.acc-map-wrap { position: relative; margin-bottom: 1.5rem; }
.acc-map-wrap.acc-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999; background: #fff;
  margin: 0; padding: 0;
}
.acc-map-wrap.acc-fullscreen #acc-map {
  height: 100vh !important;
  border-radius: 0;
}
.acc-map-legend {
  display: flex; gap: 1rem; justify-content: center;
  padding: 0.4rem 0; font-size: 0.78rem; color: #666;
}
.acc-legend-item { display: flex; align-items: center; gap: 0.3rem; }
.acc-legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid #fff; box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.acc-disclaimer {
  font-size: 0.72rem; color: #a0aec0; text-align: center;
  border-top: 1px solid #e2e8f0; padding-top: 0.75rem; line-height: 1.5;
}

/* ═══════ Detail / Case Study View ═══════ */
.acc-back {
  display: inline-block; font-size: 0.85rem; color: #1E3A7B;
  text-decoration: none; margin-bottom: 1rem; font-weight: 600;
}
.acc-back:hover { color: #8B0000; }

.acc-detail {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; overflow: hidden;
}
.acc-detail-header {
  background: linear-gradient(135deg, #8B0000 0%, #6b0000 100%);
  color: #fff; padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.acc-detail-header h2 { font-size: 1.1rem; margin: 0; color: #fff; }
.acc-detail-meta { font-size: 0.78rem; color: rgba(255,255,255,0.75); margin-top: 0.2rem; }
.acc-detail-header .acc-badge { font-size: 0.82rem; padding: 0.25rem 0.7rem; }
.acc-detail-header .acc-badge.fatal { background: rgba(255,255,255,0.2); color: #fff; }

.acc-section {
  padding: 1rem 1.25rem; border-bottom: 1px solid #f0f0f0;
}
.acc-section:last-child { border-bottom: none; }
.acc-section h3 {
  font-size: 0.92rem; color: #8B0000; margin: 0 0 0.5rem;
}

.acc-narrative {
  font-size: 0.85rem; line-height: 1.7; color: #333;
  padding: 0.75rem; background: #fafbfc; border-radius: 6px; border: 1px solid #e2e8f0;
}
.acc-disclaimer-banner {
  background: #fef3c7; border: 1px solid #f59e0b; border-radius: 6px;
  padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.82rem;
  color: #92400e; line-height: 1.5;
}
.acc-disclaimer-banner strong { color: #78350f; }

.acc-findings {
  margin: 0; padding: 0 0 0 1.25rem;
  font-size: 0.82rem; color: #4a5568; line-height: 1.6;
}
.acc-findings li { margin-bottom: 0.4rem; }

.acc-detail-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.acc-detail-table td {
  padding: 0.35rem 0.5rem; border-bottom: 1px solid #f0f0f0;
}
.acc-detail-table td:first-child { color: #888; width: 140px; }
.acc-detail-table a { color: #1E3A7B; font-weight: 600; }

/* Case Study */
.acc-case-study {
  font-size: 0.88rem; line-height: 1.7; color: #333;
  padding: 0.75rem; background: #fafbfc; border-radius: 6px; border: 1px solid #e2e8f0;
}
.acc-case-study h3 { font-size: 0.95rem; }
.acc-case-study ul { margin: 0.3rem 0 0.5rem 1.25rem; }
.acc-case-study li { margin-bottom: 0.3rem; }
.acc-case-loading {
  display: flex; align-items: center; gap: 0.6rem;
  color: #888; font-size: 0.85rem; font-style: italic; padding: 1rem;
}
.acc-spinner {
  width: 18px; height: 18px;
  border: 3px solid #e2e8f0; border-top-color: #8B0000;
  border-radius: 50%;
  animation: acc-spin 0.8s linear infinite;
}
@keyframes acc-spin { to { transform: rotate(360deg); } }

.acc-cta {
  display: inline-block; font-size: 0.88rem; font-weight: 600;
  color: #fff; background: #1E3A7B;
  padding: 0.5rem 1.25rem; border-radius: 6px; text-decoration: none;
}
.acc-cta:hover { background: #142954; color: #fff; }

/* Responsive */
@media (max-width: 768px) {
  .acc-causes { grid-template-columns: 1fr; }
  .acc-detail-header { flex-direction: column; }
}

/* ── Missing NTSB narrative ──────────────────────────────────────────────
   Two different absences, and they should not look the same. A pending
   report is a gap that will close on its own; an unpublished one never
   will. Amber reads as "wait", grey as "this is the end of the record". */
.acc-no-data {
  border-radius: 6px; padding: 0.75rem 1rem;
  font-size: 0.82rem; line-height: 1.55;
}
.acc-no-data p { margin: 0.35rem 0 0; }
.acc-no-data strong { display: block; font-size: 0.85rem; }

.acc-no-data--pending {
  background: #fef3c7; border: 1px solid #f59e0b; color: #92400e;
}
.acc-no-data--pending strong { color: #78350f; }

.acc-no-data--unpublished {
  background: #f1f5f9; border: 1px solid #cbd5e1; color: #475569;
}
.acc-no-data--unpublished strong { color: #334155; }

/* The same distinction, shrunk to fit a table cell. */
.acc-no-data-tag {
  display: inline-block; margin-left: 0.4rem;
  font-size: 0.66rem; font-weight: 700; white-space: nowrap;
  padding: 0.1rem 0.4rem; border-radius: 4px;
}
.acc-no-data-tag--pending { background: #fef3c7; color: #92400e; }
.acc-no-data-tag--unpublished { background: #f1f5f9; color: #64748b; }

/* The action column carries a tag now, so let it wrap on a narrow screen
   rather than forcing the table wider than the phone it is being read on. */
@media (max-width: 768px) {
  .acc-no-data-tag { margin-left: 0; margin-top: 0.2rem; display: block; }
}
