/**
 * D10 311 Requests Map — Styles
 *
 * Blue theme. All rules scoped under .d10r to avoid WP theme conflicts.
 */

/* ── Layout ──────────────────────────────────────────────────────────────── */

.d10r {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.d10r *, .d10r *::before, .d10r *::after {
  box-sizing: border-box;
}

.d10r-map {
  flex: 1;
  min-height: 0;
}

.d10r-sidebar {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .d10r {
    flex-direction: column;
  }
  .d10r-map {
    height: 400px;
  }
  .d10r-sidebar {
    width: 100%;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid #e5e7eb;
  }
}

/* ── Sidebar Sections ────────────────────────────────────────────────── */

.d10r-sb-section {
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.d10r-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.d10r-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.d10r-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 8px;
}

/* ── Timeframe Buttons ───────────────────────────────────────────────── */

.d10r-tf-group {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}

.d10r-tf-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.d10r-tf-btn:hover {
  color: #374151;
}

.d10r-tf-btn.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Category Checkboxes ─────────────────────────────────────────────── */

.d10r-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.d10r-cat-header .d10r-label {
  margin-bottom: 0;
}

.d10r-link-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
}

.d10r-link-btn:hover {
  color: #1d4ed8;
}

.d10r-divider {
  color: #d1d5db;
  margin: 0 4px;
  font-size: 12px;
}

.d10r-cat-list {
  max-height: 160px;
  overflow-y: auto;
}

.d10r-cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  cursor: pointer;
  font-size: 13px;
  color: #4b5563;
}

.d10r-cat-item:hover span {
  color: #111827;
}

.d10r-cat-item input[type="checkbox"] {
  border-radius: 3px;
  border: 1px solid #d1d5db;
  accent-color: #2563eb;
}

.d10r-cat-info {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

/* ── Area Search ─────────────────────────────────────────────────────── */

.d10r-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.d10r-bb-coords {
  font-size: 12px;
  color: #4b5563;
  background: #eff6ff;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  font-family: monospace;
}

.d10r-btn-row {
  display: flex;
  gap: 8px;
}

.d10r-btn {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.d10r-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.d10r-btn-primary {
  flex: 1;
  background: #2563eb;
  color: #fff;
}

.d10r-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.d10r-btn-secondary {
  background: #f3f4f6;
  color: #4b5563;
}

.d10r-btn-secondary:hover {
  background: #e5e7eb;
}

/* ── Detail Results ──────────────────────────────────────────────────── */

.d10r-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eff6ff;
  padding: 6px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
}

.d10r-clear-results {
  color: #2563eb !important;
}

.d10r-results-scroll {
  max-height: 260px;
  overflow-y: auto;
}

.d10r-record {
  padding: 8px 20px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12px;
}

.d10r-record:hover {
  background: #f9fafb;
}

.d10r-field {
  line-height: 1.5;
}

.d10r-field-label {
  color: #9ca3af;
  margin-right: 4px;
}

/* ── Download ────────────────────────────────────────────────────────── */

.d10r-download {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}

.d10r-download:hover {
  background: #dbeafe;
}

/* ── Count Summary ───────────────────────────────────────────────────── */

.d10r-summary {
  padding: 16px 20px;
}

.d10r-count-box {
  background: #eff6ff;
  border-radius: 8px;
  padding: 16px;
}

.d10r-count-label {
  color: #2563eb !important;
}

.d10r-count-value {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 700;
  color: #1d4ed8;
}

/* ── Loading / Spinner ───────────────────────────────────────────────── */

.d10r-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #2563eb;
}

.d10r-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #93c5fd;
  border-top-color: transparent;
  border-radius: 50%;
  animation: d10r-spin 0.6s linear infinite;
}

@keyframes d10r-spin {
  to { transform: rotate(360deg); }
}

/* ── Error ────────────────────────────────────────────────────────────── */

.d10r-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0;
}
