/* AIStrikeMap — Dark Theme */
:root {
  --bg-dark: #1a1a2e;
  --bg-surface: #16213e;
  --bg-surface-hover: #1c2a4a;
  --accent: #e94560;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --link: #4fc3f7;
  --success: #66bb6a;
  --severity-1: #3498db;
  --severity-2: #f39c12;
  --severity-3: #e67e22;
  --severity-4: #e74c3c;
  --severity-5: #8e44ad;
  --phase-infrastructure: #3498db;
  --phase-doctrine: #f39c12;
  --phase-event: #e74c3c;
  --phase-consequences: #8e44ad;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: Consolas, "Courier New", monospace;
  --radius: 6px;
  --transition: 0.2s ease;
}

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

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: var(--font-base);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  flex-shrink: 0;
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.site-header__logo:hover {
  text-decoration: none;
}

.site-header__logo .logo-accent {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Main Map Container */
.map-wrapper {
  flex: 1;
  position: relative;
  display: flex;
}

#map {
  flex: 1;
  z-index: 1;
}

/* Filter Panel */
.filter-panel {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 1rem;
  width: 260px;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition);
}

.filter-panel.collapsed .filter-panel__body {
  display: none;
}

.filter-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.filter-panel__header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.filter-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.125rem;
}

.filter-section {
  margin-bottom: 1rem;
}

.filter-section__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
  accent-color: var(--link);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.severity-slider {
  width: 100%;
  margin: 0.5rem 0;
  accent-color: var(--accent);
}

.severity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.filter-reset-btn {
  width: 100%;
  padding: 0.4rem;
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.filter-reset-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* Detail Panel */
.detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1000;
  width: 400px;
  height: 100%;
  background: var(--bg-surface);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.detail-panel__title {
  font-size: 1.1rem;
  font-weight: 700;
  padding-right: 1rem;
}

.detail-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.detail-close-btn:hover {
  color: var(--text-primary);
}

.detail-panel__body {
  padding: 1.25rem;
  flex: 1;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge--severity-1 { background: var(--severity-1); color: #fff; }
.badge--severity-2 { background: var(--severity-2); color: #1a1a2e; }
.badge--severity-3 { background: var(--severity-3); color: #fff; }
.badge--severity-4 { background: var(--severity-4); color: #fff; }
.badge--severity-5 { background: var(--severity-5); color: #fff; }

.badge--verification {
  background: rgba(102, 187, 106, 0.15);
  color: var(--success);
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.badge--actor {
  background: rgba(79, 195, 247, 0.1);
  color: var(--link);
  border: 1px solid rgba(79, 195, 247, 0.2);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section__title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Actors */
.actor-list {
  list-style: none;
}

.actor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.actor-item:last-child {
  border-bottom: none;
}

.actor-systems {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Reverse Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item__dot {
  position: absolute;
  left: -1.2rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
}

.timeline-item__dot--infrastructure {
  border-color: var(--phase-infrastructure);
  background: var(--phase-infrastructure);
}

.timeline-item__dot--doctrine {
  border-color: var(--phase-doctrine);
  background: var(--phase-doctrine);
}

.timeline-item__dot--event {
  border-color: var(--phase-event);
  background: var(--phase-event);
}

.timeline-item__dot--consequences {
  border-color: var(--phase-consequences);
  background: var(--phase-consequences);
}

.timeline-item__phase {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.timeline-item__phase--infrastructure { color: var(--phase-infrastructure); }
.timeline-item__phase--doctrine { color: var(--phase-doctrine); }
.timeline-item__phase--event { color: var(--phase-event); }
.timeline-item__phase--consequences { color: var(--phase-consequences); }

.timeline-item__date {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.timeline-item__title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.2rem 0;
}

.timeline-item__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-item__sources {
  margin-top: 0.3rem;
}

.timeline-item__sources a {
  font-size: 0.7rem;
  margin-right: 0.5rem;
}

/* Sources List */
.source-list {
  list-style: none;
}

.source-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.source-item:last-child {
  border-bottom: none;
}

.source-item__publisher {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 1rem;
  background: var(--bg-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--text-secondary);
  z-index: 1000;
  flex-shrink: 0;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* Page Layout (for subpages) */
.page-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.page-content h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.page-content h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.page-content h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-primary);
}

.page-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.page-content ul, .page-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.page-content li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

/* AI Disclosure Banner */
.ai-disclosure {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

  .filter-panel {
    width: 220px;
    top: 0.5rem;
    left: 0.5rem;
    max-height: calc(100vh - 7rem);
  }

  .detail-panel {
    width: 100%;
    height: 55%;
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .detail-panel.open {
    transform: translateY(0);
  }

  .site-footer {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    padding: 0.5rem;
  }
}
