/* 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) ── */
.dp-geo-widget  { margin: 2rem 0; }
.dp-geo-title   { font-size: 24px; font-weight: 700; margin-bottom: 1.25rem; color: var(--dp-pin-title, #111827) !important; }
.dp-geo-layout  { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--dp-border); border-radius: var(--dp-radius); overflow: hidden; margin-bottom: 1rem; }
.dp-geo-map-wrap { height: 520px; background: #f3f4f6; }
.dp-geo-map     { width: 100%; height: 100%; }
.dp-no-map-msg  { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--dp-gray); font-size: 15px; background: #f9fafb; }
.dp-geo-pins-wrap { border-left: 1px solid var(--dp-border); height: 520px; overflow-y: auto; }
.dp-geo-pins-list { display: flex; flex-direction: column; }
.dp-geo-pin-card  { border-bottom: 1px solid var(--dp-pin-card-border, var(--dp-border)); padding: 1rem 1.25rem; transition: background .1s; background: var(--dp-pin-card-bg, transparent); }
.dp-geo-pin-card:last-child { border-bottom: none; }
.dp-geo-pin-card:hover { background: var(--dp-gray-lt); }
.dp-geo-pin-service { font-size: 14px; font-weight: 600; color: var(--dp-pin-service, #111); margin-bottom: 3px; }
.dp-geo-pin-service a { color: var(--dp-pin-service, #111); text-decoration: none; }
.dp-geo-pin-service a:hover { color: var(--dp-pin-link, var(--dp-blue)); text-decoration: underline; }
.dp-geo-pin-meta  { font-size: 12px; color: var(--dp-pin-meta, var(--dp-gray)); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.dp-geo-pin-notes { font-size: 13px; color: var(--dp-pin-notes, #374151); line-height: 1.5; margin-bottom: 6px; }
.dp-geo-pin-link  { font-size: 12px; color: var(--dp-pin-link, var(--dp-blue)); text-decoration: none; font-weight: 500; }
.dp-geo-pin-link:hover { text-decoration: underline; }
.dp-pin-count { font-size: 14px; color: var(--dp-pin-count, var(--dp-gray)); margin-top: 0.75rem; }
.dp-no-pins   { color: var(--dp-gray); 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; }
  .dp-geo-map-wrap { height: 260px; }
  .dp-geo-pins-wrap { height: auto; border-left: none; border-top: 1px solid var(--dp-border); }
  .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); }
}
