/* ══════════════════════════════════════════════════════════════════════
   DEFLOCK NWA — Custom Styles
   Dark-mode surveillance tracker aesthetic
   ══════════════════════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scrollbar-color: #27272a #09090b;
}

body {
  background-color: #09090b;
  color: #f5f5f5;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: rgba(16, 185, 129, 0.3);
  color: #f5f5f5;
}

/* ── Status Pill ──────────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a3a3a3;
  border: 1px solid #27272a;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 12px rgba(16, 185, 129, 0.9); }
}

/* ── Metric Cards ─────────────────────────────────────────────────── */
.metric-card {
  border: 1px solid #27272a;
  background: #0a0a0c;
  padding: 1.5rem;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.metric-card:hover {
  border-color: #3f3f46;
  background: #111113;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #f5f5f5;
}

.metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #737373;
  margin-top: 0.5rem;
}

/* ── Map ──────────────────────────────────────────────────────────── */
#map {
  height: 520px;
  border: 1px solid #27272a;
  background: #0a0a0c;
}

@media (max-width: 768px) {
  #map {
    height: 380px;
  }
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  background: #18181b !important;
  color: #f5f5f5 !important;
  border: 1px solid #27272a !important;
  border-radius: 4px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.75rem !important;
}

.leaflet-popup-tip {
  background: #18181b !important;
  border: 1px solid #27272a !important;
}

.leaflet-popup-close-button {
  color: #737373 !important;
}

.leaflet-popup-close-button:hover {
  color: #f5f5f5 !important;
}

.popup-header {
  font-weight: 700;
  font-size: 0.8rem;
  color: #10b981;
  margin-bottom: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
  border-bottom: 1px solid #27272a;
  gap: 1rem;
}

.popup-row:last-child {
  border-bottom: none;
}

.popup-key {
  color: #737373;
  white-space: nowrap;
}

.popup-val {
  color: #d4d4d4;
  text-align: right;
}

.popup-link {
  display: block;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #27272a;
  color: #10b981;
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.popup-link:hover {
  color: #34d399;
  text-decoration: underline;
}

/* Leaflet controls */
.leaflet-control-zoom a {
  background: #18181b !important;
  color: #a3a3a3 !important;
  border-color: #27272a !important;
}

.leaflet-control-zoom a:hover {
  background: #27272a !important;
  color: #f5f5f5 !important;
}

.leaflet-control-attribution {
  background: rgba(9, 9, 11, 0.85) !important;
  color: #525252 !important;
  font-size: 0.6rem !important;
}

.leaflet-control-attribution a {
  color: #737373 !important;
}

/* ── Section Headers ──────────────────────────────────────────────── */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #10b981;
  margin-bottom: 0.75rem;
}

/* ── FOIA Section ─────────────────────────────────────────────────── */
.foia-textarea {
  background: #0a0a0c;
  border: 1px solid #27272a;
  color: #d4d4d4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  resize: none;
  width: 100%;
  padding: 1.25rem;
  transition: border-color 150ms ease;
}

.foia-textarea:focus {
  outline: none;
  border-color: #10b981;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #09090b;
  background: #10b981;
  border: 1px solid #10b981;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: #059669;
  border-color: #059669;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4d4d4;
  background: transparent;
  border: 1px solid #3f3f46;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: #f5f5f5;
  color: #f5f5f5;
}

/* ── Copy Feedback ────────────────────────────────────────────────── */
.copy-btn {
  position: relative;
}

.copy-btn.copied {
  background: #059669;
  border-color: #059669;
}

.copy-feedback {
  display: none;
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #10b981;
  white-space: nowrap;
  pointer-events: none;
}

.copy-btn.copied .copy-feedback {
  display: block;
  animation: fade-up 1.5s ease forwards;
}

@keyframes fade-up {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  20% { opacity: 1; transform: translateX(-50%) translateY(-4px); }
  80% { opacity: 1; transform: translateX(-50%) translateY(-8px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}

/* ── Analysis Section ─────────────────────────────────────────────── */
.data-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #1a1a1e;
}

.data-field:last-child {
  border-bottom: none;
}

.data-field-icon {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

/* ── Contact Cards ────────────────────────────────────────────────── */
.contact-card {
  border: 1px solid #27272a;
  background: #0a0a0c;
  padding: 1.25rem;
  transition: border-color 150ms ease;
}

.contact-card:hover {
  border-color: #3f3f46;
}

/* ── Email Form ───────────────────────────────────────────────────── */
.email-input {
  background: #0a0a0c;
  border: 1px solid #27272a;
  color: #f5f5f5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.65rem 1rem;
  width: 100%;
  transition: border-color 150ms ease;
}

.email-input:focus {
  outline: none;
  border-color: #10b981;
}

.email-input::placeholder {
  color: #525252;
}

/* ── Scanline Background Effect ───────────────────────────────────── */
.scanline-bg {
  position: relative;
}

.scanline-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.008) 2px,
    rgba(255, 255, 255, 0.008) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Divider ──────────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid #1a1a1e;
  margin: 0;
}

/* ── Responsive Adjustments ───────────────────────────────────────── */
@media (max-width: 640px) {
  .metric-value {
    font-size: 1.35rem;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

/* ── Nav Link Active States ───────────────────────────────────────── */
.nav-link {
  position: relative;
  color: #737373;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: #f5f5f5;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #10b981;
  transition: width 200ms ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ── FOIA Select ──────────────────────────────────────────────────── */
.foia-select {
  appearance: none;
  background: #0a0a0c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  border: 1px solid #27272a;
  color: #d4d4d4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  padding: 0.65rem 2.5rem 0.65rem 1rem;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.foia-select:focus {
  outline: none;
  border-color: #10b981;
}

.foia-select option {
  background: #18181b;
  color: #d4d4d4;
}

/* ── Alert Badge ──────────────────────────────────────────────────── */
.alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.2rem 0.6rem;
  background: rgba(239, 68, 68, 0.08);
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer-link {
  color: #737373;
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-link:hover {
  color: #10b981;
}
