/* Local Pins Widget v4.0 */
:root {
  --dp-blue: #1a56db;
  --dp-blue-lt: #eff4ff;
  --dp-green: #0f7b3e;
  --dp-green-lt: #ecfdf5;
  --dp-red: #b91c1c;
  --dp-gray: #6b7280;
  --dp-gray-lt: #f9fafb;
  --dp-border: #e5e7eb;
  --dp-radius: 10px;
  --dp-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

/* ── Base ── */
#datapins-logger-app, .dp-geo-widget {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: #111827;
}
#datapins-logger-app { max-width: 960px; margin: 0 auto; }

/* ── Cards ── */
.dp-card {
  background: #fff;
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--dp-shadow);
}

/* ── Login ── */
#dp-login { max-width: 360px; margin: 3rem auto; text-align: center; }
#dp-login input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--dp-border); border-radius: 8px;
  font-size: 15px; margin: 12px 0 8px; font-family: inherit;
}
#dp-login input:focus { outline: none; border-color: var(--dp-blue); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.dp-logo { font-size: 18px; font-weight: 700; color: #111; letter-spacing: -.02em; }
.dp-sub  { font-size: 13px; color: var(--dp-gray); margin-top: 4px; }
.dp-error { color: var(--dp-red); font-size: 13px; margin-top: 10px; font-weight: 500; }

/* ── Header ── */
.dp-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.dp-stats  { display: flex; gap: 10px; flex-wrap: wrap; }
.dp-stat   { background: var(--dp-gray-lt); border: 1px solid var(--dp-border); border-radius: 8px; padding: 8px 14px; text-align: center; min-width: 68px; }
.dp-stat-val { display: block; font-size: 20px; font-weight: 700; color: #111; }
.dp-stat-lbl { display: block; font-size: 11px; color: var(--dp-gray); margin-top: 2px; }

/* ── Tabs ── */
.dp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--dp-border); margin-bottom: 1.25rem; }
.dp-tab  { padding: 9px 18px; font-size: 14px; font-weight: 500; background: none; border: none; border-bottom: 2px solid transparent; color: var(--dp-gray); cursor: pointer; margin-bottom: -1px; transition: color .12s; font-family: inherit; }
.dp-tab:hover  { color: #374151; }
.dp-tab.active { color: var(--dp-blue); border-bottom-color: var(--dp-blue); }
.dp-panel      { display: none; }
.dp-panel.active { display: block; }

/* ── Location panel ── */
.dp-loc-panel { border: 1px solid var(--dp-border); border-radius: 8px; overflow: hidden; margin-bottom: 1.25rem; }
.dp-loc-header { display: flex; align-items: center; gap: 10px; background: var(--dp-gray-lt); padding: 9px 14px; font-size: 13px; color: var(--dp-gray); border-bottom: 1px solid var(--dp-border); }
.dp-loc-methods { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--dp-border); }
.dp-loc-method { padding: 1rem; border-right: 1px solid var(--dp-border); }
.dp-loc-method:last-child { border-right: none; }
.dp-loc-method-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #374151; margin-bottom: 4px; }
.dp-loc-method-desc  { font-size: 12px; color: var(--dp-gray); line-height: 1.4; margin-bottom: 10px; }
.dp-loc-lookup-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dp-loc-lookup-row input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--dp-border); border-radius: 6px; font-size: 13px; font-family: inherit; color: #111; background: #fff; }
.dp-loc-lookup-row input:focus { outline: none; border-color: var(--dp-blue); box-shadow: 0 0 0 2px rgba(26,86,219,.1); }
.dp-loc-confirmed { display: flex; align-items: center; gap: 10px; background: var(--dp-green-lt); padding: 9px 14px; font-size: 13px; color: var(--dp-green); font-weight: 500; }
.dp-lookup-searching { font-size: 12px; color: var(--dp-gray); margin-top: 6px; }
.dp-lookup-ok  { font-size: 12px; color: var(--dp-green); margin-top: 6px; }
.dp-lookup-err { font-size: 12px; color: var(--dp-red);   margin-top: 6px; }
@media (max-width: 700px) {
  .dp-loc-methods { grid-template-columns: 1fr; }
  .dp-loc-method  { border-right: none; border-bottom: 1px solid var(--dp-border); }
  .dp-loc-method:last-child { border-bottom: none; }
}

/* ── GPS dot ── */
.dp-dot         { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.dp-dot.pending { background: #f59e0b; }
.dp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dp-field { display: flex; flex-direction: column; gap: 5px; }
.dp-field.dp-full { grid-column: 1 / -1; }
.dp-field label { font-size: 11px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .06em; }
.dp-field input, .dp-field select, .dp-field textarea {
  padding: 9px 12px; border: 1px solid var(--dp-border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: #111; background: #fff; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.dp-field input:focus, .dp-field select:focus, .dp-field textarea:focus { outline: none; border-color: var(--dp-blue); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.dp-field textarea { resize: vertical; }

/* ── Photo upload zone ── */
.dp-upload-zone {
  border: 2px dashed var(--dp-border); border-radius: 8px;
  padding: 1.5rem; text-align: center; cursor: pointer; background: var(--dp-gray-lt);
  transition: border-color .15s, background .15s;
}
.dp-upload-zone:hover { border-color: var(--dp-blue); background: var(--dp-blue-lt); }
.dp-upload-icon { font-size: 28px; color: var(--dp-gray); font-weight: 300; line-height: 1; margin-bottom: 6px; }
.dp-upload-text { font-size: 14px; font-weight: 500; color: #374151; }
.dp-upload-sub  { font-size: 12px; color: var(--dp-gray); margin-top: 3px; }
.dp-photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dp-photo-preview-item { position: relative; }
.dp-photo-preview-item img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--dp-border); }
.dp-photo-preview-item .dp-remove-photo { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--dp-red); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.dp-photo-uploading { opacity: .5; }

/* ── Buttons ── */
.dp-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 1.25rem; flex-wrap: wrap; }
.dp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border: 1px solid var(--dp-border); border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; background: #fff; color: #374151; font-family: inherit; transition: background .12s; white-space: nowrap; }
.dp-btn:hover { background: var(--dp-gray-lt); }
.dp-btn:active { transform: scale(.98); }
.dp-btn-primary { background: var(--dp-blue); color: #fff; border-color: var(--dp-blue); }
.dp-btn-primary:hover { background: #1648c2; border-color: #1648c2; }
.dp-btn-sm { padding: 5px 12px; font-size: 12px; }
.dp-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── Messages ── */
.dp-msg-ok  { background: var(--dp-green-lt); color: var(--dp-green); border: 1px solid #a7f3d0; border-radius: 8px; padding: 12px 16px; font-size: 14px; font-weight: 500; }
.dp-msg-err { background: #fee2e2; color: var(--dp-red); border: 1px solid #fca5a5; border-radius: 8px; padding: 12px 16px; font-size: 14px; font-weight: 500; }

/* ── Admin map view (50/50) ── */
.dp-map-container { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--dp-border); border-radius: var(--dp-radius); overflow: hidden; height: 540px; }
.dp-admin-map { width: 100%; height: 100%; }
.dp-map-pins-list { height: 100%; overflow-y: auto; border-left: 1px solid var(--dp-border); }

/* ── Recent pins ── */
.dp-filter-row { display: flex; gap: 8px; margin-bottom: 1rem; flex-wrap: wrap; }
.dp-filter-sel { padding: 7px 12px; border: 1px solid var(--dp-border); border-radius: 8px; font-size: 13px; background: #fff; color: #111; font-family: inherit; }
.dp-pin-item { background: #fff; border-bottom: 1px solid var(--dp-border); padding: 1rem 1.25rem; display: flex; gap: 12px; align-items: flex-start; }
.dp-pin-item:last-child { border-bottom: none; }
.dp-pin-item-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--dp-border); flex-shrink: 0; }
.dp-pin-item-body  { flex: 1; min-width: 0; }
.dp-pin-item-title { font-size: 14px; font-weight: 600; color: #111; margin-bottom: 3px; }
.dp-pin-item-meta  { font-size: 12px; color: var(--dp-gray); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.dp-pin-item-notes { font-size: 13px; color: #374151; line-height: 1.5; }
.dp-loading { text-align: center; padding: 2rem; color: var(--dp-gray); font-size: 14px; }
.dp-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--dp-blue-lt); color: var(--dp-blue); }

/* ── SEO panel ── */
.dp-seo-block { background: var(--dp-gray-lt); border: 1px solid var(--dp-border); border-radius: 8px; padding: 1rem; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; }
.dp-seo-mono  { font-family: 'Courier New', monospace; font-size: 12px; }

/* ── Public geo widget (50/50 map + pins) ── */
/* ── Geo Widget — redesigned ── */
/* ── [job_pins] shortcode widget ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');

.dp-geo-widget {
  margin: 2rem 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.dp-geo-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
  color: var(--dp-pin-title, #1c1917) !important;
  line-height: 1.15;
  margin: 0 0 .35rem;
  letter-spacing: -.02em;
}
.dp-geo-subtitle {
  font-size: 15px;
  color: #78716c;
  margin: 0 0 1.5rem;
  font-weight: 400;
}
.dp-geo-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 1.25rem;
  align-items: start;
}
.dp-geo-map-wrap {
  position: sticky;
  top: 20px;
  height: 520px;
  background: #f5f5f4;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e7e5e4;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.dp-geo-map { width: 100%; height: 100%; display: block; }
.dp-geo-map-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-no-map-msg {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #78716c; font-size: 15px;
  background: #fafaf9; border-radius: 14px;
}

/* Stats bar under the map */
.dp-geo-stats {
  display: flex;
  gap: 0;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  background: #fff;
}
.dp-geo-stat {
  flex: 1;
  text-align: center;
  padding: .65rem .5rem;
  border-right: 1px solid #e7e5e4;
}
.dp-geo-stat:last-child { border-right: none; }
.dp-geo-stat-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #1c1917;
  line-height: 1;
  margin-bottom: 2px;
}
.dp-geo-stat-lbl {
  display: block;
  font-size: 11px;
  color: #a8a29e;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Pins feed */
.dp-geo-pins-wrap {
  max-height: 580px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid #e7e5e4;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #e7e5e4 transparent;
}
.dp-geo-pins-wrap::-webkit-scrollbar { width: 5px; }
.dp-geo-pins-wrap::-webkit-scrollbar-thumb { background: #e7e5e4; border-radius: 3px; }

.dp-geo-pins-list { display: flex; flex-direction: column; }

/* Individual pin card */
.dp-geo-pin-card {
  border-bottom: 1px solid #f5f5f4;
  transition: background .15s;
  background: var(--dp-pin-card-bg, #fff);
  cursor: default;
}
.dp-geo-pin-card:last-child { border-bottom: none; }
.dp-geo-pin-card:hover { background: #fafaf9; }

/* Optional photo thumbnail */
.dp-geo-pin-photo {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-bottom: 1px solid #f5f5f4;
}
.dp-geo-pin-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.dp-geo-pin-card:hover .dp-geo-pin-photo img { transform: scale(1.03); }

.dp-geo-pin-body { padding: .875rem 1.125rem; }

.dp-geo-pin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

/* Service badge */
.dp-geo-pin-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.dp-geo-pin-date {
  font-size: 11px;
  color: #a8a29e;
  white-space: nowrap;
}

/* Area / neighborhood */
.dp-geo-pin-area {
  font-size: 13px;
  font-weight: 600;
  color: #1c1917;
  margin-bottom: .35rem;
  line-height: 1.35;
}

/* Notes snippet */
.dp-geo-pin-notes {
  font-size: 13px;
  color: var(--dp-pin-notes, #57534e);
  line-height: 1.6;
  margin-bottom: .6rem;
}

/* Link */
.dp-geo-pin-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--dp-pin-link, #B45309);
  text-decoration: none;
  letter-spacing: .01em;
  transition: color .15s;
}
.dp-geo-pin-link:hover { color: #92400e; }

/* Count line */
.dp-pin-count {
  font-size: 13px;
  color: var(--dp-pin-count, #a8a29e);
  margin-top: .75rem;
  font-family: 'DM Sans', sans-serif;
}
.dp-pin-count strong { color: #44403c; font-weight: 600; }
.dp-no-pins { color: #a8a29e; font-size: 14px; font-style: italic; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .dp-form-grid  { grid-template-columns: 1fr; }
  .dp-stats      { display: none; }
  .dp-geo-layout { grid-template-columns: 1fr; gap: 16px; }
  .dp-geo-map-wrap { height: 280px; border-radius: 10px; position: static; }
  .dp-geo-pins-wrap { max-height: none; border-radius: 10px; }
  .dp-geo-stats { display: none; }
  .dp-geo-pin-photo { height: 120px; }
  .dp-map-container { grid-template-columns: 1fr; height: auto; }
  .dp-admin-map { height: 300px; }
  .dp-map-pins-list { height: 300px; border-left: none; border-top: 1px solid var(--dp-border); }
}

/* Pin card action links */
.dp-pin-item-actions{display:flex;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid #f3f4f6}
.dp-pin-action{font-size:12px;font-weight:600;color:#1a56db;text-decoration:none;padding:3px 10px;border:1px solid #dbeafe;border-radius:5px;background:#eff6ff}
.dp-pin-action:hover{background:#dbeafe}

/* Recent Pins pagination */
#dp-pagination{display:flex;flex-direction:column;align-items:center;gap:8px;padding:1rem 0;border-top:1px solid #f3f4f6;margin-top:.5rem}
.dp-page-info{font-size:12px;color:#9ca3af}
.dp-page-btns{display:flex;gap:4px;flex-wrap:wrap;justify-content:center}
.dp-page-btn{background:#fff;border:1px solid #e5e7eb;border-radius:6px;padding:5px 10px;font-size:13px;font-weight:500;color:#374151;cursor:pointer;line-height:1}
.dp-page-btn:hover{background:#f3f4f6;border-color:#d1d5db}
.dp-page-btn-active{background:#1a56db !important;color:#fff !important;border-color:#1a56db !important}

/* Map view sidebar pagination */
#dp-map-pagination{padding:.75rem 1rem;border-top:1px solid #f3f4f6;background:#fafafa}

/* ── Layout variants ── */

/* Equal columns — map and feed same height, map is sticky */
.dp-layout-equal .dp-geo-layout { align-items: stretch; }
.dp-layout-equal .dp-geo-map-wrap { position: sticky; top: 20px; align-self: start; }
.dp-layout-equal .dp-geo-pins-wrap { max-height: none; overflow-y: visible; }

/* Stacked — full-width map, card grid below */
.dp-layout-stacked .dp-geo-layout { grid-template-columns: 1fr !important; }
.dp-layout-stacked .dp-geo-map-wrap { width: 100%; position: static !important; border-radius: 14px; }
.dp-layout-stacked .dp-geo-pins-wrap { max-height: none; border: none; background: transparent; }
.dp-layout-stacked .dp-geo-pins-wrap .dp-pagination { border: .5px solid #e7e5e4; border-radius: 10px; margin-top: 8px; background: #fff; }
.dp-geo-pins-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0 !important; }
.dp-geo-pins-grid .dp-geo-pin-card { border: .5px solid #e7e5e4; border-radius: 12px; background: #fff; }
.dp-geo-pins-grid .dp-geo-pin-card:last-child { border-bottom: .5px solid #e7e5e4; }

/* Locked height — both columns pinned to same height */
.dp-layout-locked .dp-geo-layout { align-items: stretch; }
.dp-layout-locked .dp-geo-map-wrap { position: static !important; align-self: stretch; }
.dp-layout-locked .dp-geo-pins-wrap { overflow-y: auto; max-height: none; }
