/* ==========================================================================
   App styles — layered on top of Tailwind (loaded via CDN).
   Only the things Tailwind utilities can't express cleanly live here.
   ========================================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
}

html, body { font-family: var(--font-sans); }
.font-display { font-family: var(--font-display); }

/* Reusable form control (used across the drawing form) */
.form-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: rgb(30 41 59);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: rgb(52 211 153);
  box-shadow: 0 0 0 3px rgb(209 250 229);
}

/* ---- Leaflet look & feel ---- */
.leaflet-container { font-family: var(--font-sans); background: #eef2f6; }
.leaflet-popup-content-wrapper {
  border-radius: 0.9rem;
  box-shadow: 0 12px 40px -12px rgb(15 23 42 / 0.35);
  padding: 2px;
}
.leaflet-popup-content { margin: 0.85rem 1rem; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a {
  border-radius: 0 !important;
  color: rgb(51 65 85);
}
.leaflet-control-zoom { border: none !important; box-shadow: 0 4px 16px -6px rgb(15 23 42 / 0.3); border-radius: 0.6rem; overflow: hidden; }

/* Custom divIcon markers */
.res-marker {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px -2px rgb(15 23 42 / 0.5);
  display: grid; place-items: center;
  transition: transform .12s ease;
}
.res-marker::after {
  content: ''; width: 7px; height: 7px; background: #fff; border-radius: 50%;
  transform: rotate(45deg);
}
.res-marker-wrap:hover .res-marker { transform: rotate(-45deg) scale(1.15); }
.res-marker-wrap.is-active .res-marker { transform: rotate(-45deg) scale(1.3); z-index: 1000; }

/* Project-plot point markers — a diamond so drawn plots stand out clearly
   from the round resource pins and are easy to spot on the Map Explorer. */
.plot-marker {
  width: 22px; height: 22px;
  border-radius: 5px;
  transform: rotate(45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px -2px rgb(15 23 42 / 0.55);
  display: grid; place-items: center;
  transition: transform .12s ease;
}
.plot-marker::after {
  content: ''; width: 6px; height: 6px; background: #fff; border-radius: 2px;
}
.plot-marker-wrap:hover .plot-marker { transform: rotate(45deg) scale(1.18); }
.plot-marker-wrap.is-active .plot-marker { transform: rotate(45deg) scale(1.35); z-index: 1000; }

/* Always-on name label for project plots */
.leaflet-tooltip.plot-tip {
  background: #0f172a; color: #fff; border: 0; font-weight: 600; font-size: 11px;
  padding: 2px 8px; border-radius: 7px; box-shadow: 0 2px 8px -2px rgb(15 23 42 / 0.5);
}
.leaflet-tooltip-top.plot-tip::before { border-top-color: #0f172a; }
.leaflet-tooltip-bottom.plot-tip::before { border-bottom-color: #0f172a; }
.leaflet-tooltip-left.plot-tip::before { border-left-color: #0f172a; }
.leaflet-tooltip-right.plot-tip::before { border-right-color: #0f172a; }

/* ---- Leaflet-Geoman toolbar polish ---- */
.leaflet-pm-toolbar .leaflet-pm-icon {
  background-size: 60% 60%;
}
.leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button {
  border-radius: 0 !important;
  transition: background .12s;
}
.leaflet-pm-toolbar .button-container:first-child a.leaflet-buttons-control-button { border-top-left-radius: 0.6rem !important; border-top-right-radius: 0.6rem !important; }
.leaflet-pm-toolbar .button-container:last-child a.leaflet-buttons-control-button { border-bottom-left-radius: 0.6rem !important; border-bottom-right-radius: 0.6rem !important; }
.leaflet-pm-toolbar .button-container a.leaflet-buttons-control-button:hover { background-color: #ecfdf5; }
.leaflet-pm-toolbar .leaflet-pm-actions-container a {
  background: rgb(15 23 42);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.leaflet-pm-toolbar .leaflet-pm-actions-container a:hover { background: rgb(5 150 105); }
/* Active drawing tool highlight */
.leaflet-pm-toolbar .leaflet-buttons-control-button.pm-active,
.leaflet-pm-toolbar .active .leaflet-buttons-control-button { background-color: #d1fae5 !important; }

/* Basemap switcher active state */
.basemap-btn { color: rgb(100 116 139); }
.basemap-btn.basemap-active { background: rgb(16 185 129); color: #fff; }

/* Advanced coordinate-entry geometry-type toggle */
.coord-type-btn { color: rgb(71 85 105); }
.coord-type-btn.coord-type-active {
  background: rgb(16 185 129);
  color: #fff;
  border-color: rgb(16 185 129);
  box-shadow: inset 0 0 0 1px rgb(16 185 129);
}

/* Pulsing "you are here" dot */
.gps-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #2563eb; border: 3px solid #fff;
  box-shadow: 0 0 0 rgb(37 99 235 / 0.4);
  animation: gps-pulse 1.8s infinite;
}
@keyframes gps-pulse {
  0% { box-shadow: 0 0 0 0 rgb(37 99 235 / 0.5); }
  70% { box-shadow: 0 0 0 18px rgb(37 99 235 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(37 99 235 / 0); }
}

/* Rich editor toolbar buttons */
.rte-btn {
  padding: 0.35rem 0.5rem; border-radius: 0.5rem; color: rgb(71 85 105);
}
.rte-btn:hover { background: rgb(241 245 249); }
.rte-content {
  min-height: 90px; border: 1px solid rgb(226 232 240); border-radius: 0.75rem;
  padding: 0.65rem 0.8rem; font-size: 0.875rem; outline: none; line-height: 1.5;
}
.rte-content:focus { border-color: rgb(52 211 153); box-shadow: 0 0 0 3px rgb(209 250 229); }
.rte-content:empty::before { content: attr(data-placeholder); color: rgb(148 163 184); }
.rte-content ul { list-style: disc; padding-left: 1.25rem; }
.rte-content b { font-weight: 700; }

/* Toast */
#toast-stack { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: rgb(15 23 42); color: #fff; padding: 0.65rem 1rem; border-radius: 0.75rem;
  font-size: 0.85rem; box-shadow: 0 12px 30px -8px rgb(15 23 42 / 0.5);
  animation: toast-in .2s ease; max-width: 90vw;
}
.toast.is-success { background: rgb(5 150 105); }
.toast.is-error { background: rgb(220 38 38); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Thin scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgb(203 213 225); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184); }
