/* ═══════════════════════════════════════════
   AAR Viewer — After Action Review Panel
   ═══════════════════════════════════════════ */

#aar-viewer {
  position: fixed;
  left: 0; top: 0;
  width: 360px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card, rgba(22,27,34,0.96));
  border-right: 1px solid rgba(255,255,255,0.08);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 1200;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  backdrop-filter: blur(12px);
}
#aar-viewer.aar-visible { transform: translateX(0); }

/* Header */
.aar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.aar-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; color: #FF9100;
}
.aar-close {
  background: none; border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-dim); width: 24px; height: 24px;
  border-radius: 4px; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.aar-close:hover { border-color: #FF1744; color: #FF1744; }

/* Sections */
.aar-section { padding: 10px 14px; }
.aar-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; color: var(--text-dim);
  margin-bottom: 8px;
}

/* Buttons */
.aar-btn {
  padding: 6px 12px; font-size: 9px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary); border-radius: 4px;
  cursor: pointer; margin-right: 6px;
}
.aar-btn:hover { background: rgba(255,255,255,0.08); }
.aar-btn-primary { border-color: rgba(255,145,0,0.4); color: #FF9100; }
.aar-btn-primary:hover { background: rgba(255,145,0,0.1); }

.aar-status {
  font-size: 8px; color: var(--text-dim);
  margin-top: 6px; opacity: 0.7;
}

/* Timeline */
.aar-slider {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.1); border-radius: 2px;
  outline: none; cursor: pointer;
}
.aar-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: #FF9100; border-radius: 50%; cursor: grab;
}
.aar-time-row {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
}

/* Controls */
.aar-controls {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
}
.aar-ctrl-btn {
  width: 32px; height: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; cursor: pointer;
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.aar-ctrl-btn:hover { background: rgba(255,255,255,0.1); }
.aar-ctrl-play {
  width: 40px;
  border-color: rgba(255,145,0,0.4);
  color: #FF9100; font-size: 14px;
}
.aar-speed-select {
  margin-left: auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary); font-size: 9px;
  border-radius: 4px; padding: 4px 6px;
}
.aar-speed-select option { background: #161B22; }

/* Info grid */
.aar-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.aar-info-cell {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 4px; padding: 6px 8px;
  text-align: center;
}
.aar-info-label {
  display: block; font-size: 7px;
  color: var(--text-dim); letter-spacing: 0.05em;
}
.aar-info-value {
  display: block; font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

/* Heatmap toggle */
.aar-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 9px; color: var(--text-secondary); cursor: pointer;
}
.aar-toggle input { accent-color: #FF9100; }

/* Echelon stats cards */
.aar-echelon-stats {
  display: flex; flex-direction: column; gap: 8px;
}
.aar-ech-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid;
  border-radius: 4px; padding: 8px 10px;
}
.aar-ech-name {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; margin-bottom: 6px;
}
.aar-ech-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}
.aar-ech-stat { text-align: center; }
.aar-ech-val {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.aar-ech-label {
  display: block; font-size: 7px;
  color: var(--text-dim);
}

/* Events */
.aar-event-list {
  max-height: 150px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.aar-event-item {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 4px; font-size: 8px;
}
.aar-event-time {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim); min-width: 36px;
}
.aar-event-type {
  font-weight: 600; font-size: 7px;
  padding: 1px 4px; border-radius: 2px;
  background: rgba(255,255,255,0.06);
}
.aar-event-phase { color: #AA00FF; }
.aar-event-engagement { color: #FF1744; }
.aar-event-msg { color: var(--text-secondary); }

/* Drone markers in replay */
.aar-drone-marker {
  pointer-events: none;
}

@media (max-width: 767px) {
  #aar-viewer { width: 90vw; }
}
