/* Prospect Map view -- ported from the standalone "Saevo Prospect Map" site into the merged
   single-page app. Every top-level selector is prefixed with #view-map so these rules can't
   leak into (or be leaked into by) the other views' identically-named classes
   (.profile-panel, .search-bar, .filters-row, .main-area, etc. all repeat across views).

   NOT ported here (now shared / lives in the shell instead):
   - .saevo-nav-edge/.saevo-nav-tab/.saevo-nav-flyout/.orb-*/.blob and their @keyframes
     (flow0-4, morph0-4, orbPulse) -- the orb-tab nav lives outside all view containers.
   - .stage-confirm-overlay/.stage-confirm-box/etc. -- now in shared/saevo-shared.css.
*/

#view-map .bg {
  position: relative;
  width: calc(100 * var(--rvw));
  height: calc(100 * var(--rvh));
  box-sizing: border-box;
  background-image: linear-gradient(to bottom, rgba(var(--c-ink), 0) 0%, rgba(var(--c-ink), 0.05) 100%),
    linear-gradient(rgb(var(--c-cream)), rgb(var(--c-cream)));
  background-size: 100% 200%;
  background-position: 0% 0%;
  animation: mapWaveShift 6.5s ease-in-out infinite alternate;
  overflow: hidden;
}

@keyframes mapWaveShift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 0% 50%; }
}

#view-map .bg-top-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(50 * var(--rvh));
  background: linear-gradient(to bottom, rgb(var(--c-cream)) 0%, rgb(var(--c-cream)) 40%, rgba(var(--c-cream), 0) 100%);
  pointer-events: none;
}

#view-map .logo {
  position: absolute;
  top: 20px;
  left: 48px;
  height: 60px;
  width: auto;
}

#view-map .phone-status {
  position: fixed;
  top: 26px;
  right: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

#view-map .phone-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(var(--c-success));
  box-shadow: 0 0 8px rgba(var(--c-success), 0.7);
}

#view-map .phone-status-label {
  font-size: 13px;
  color: rgb(var(--c-ink));
  letter-spacing: 0.2px;
}

#view-map .header-icon-btn {
  position: fixed;
  top: 62px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--c-accent), 0.3);
  background: rgba(var(--c-accent), 0.1);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

#view-map .header-icon-btn:hover {
  background: rgba(var(--c-accent), 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

#view-map .header-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: rgb(var(--c-accent));
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#view-map #headerCallBtn { right: 198px; }
#view-map #headerChatBtn { right: 148px; }
#view-map #headerCalendarBtn { right: 48px; }

#view-map .search-bar-wrap {
  position: absolute;
  top: 26px;
  left: 320px;
  right: 320px;
}

#view-map .search-bar {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(var(--c-ink), 0.15);
  background: rgb(var(--c-cream));
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  color: rgb(var(--c-ink));
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#view-map .search-bar:focus {
  border-color: rgba(var(--c-accent), 0.5);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(var(--c-accent), 0.12);
}

#view-map .search-bar::placeholder { color: #8A857C; }

#view-map .filters-row {
  position: absolute;
  top: 86px;
  left: 48px;
  display: flex;
  gap: 10px;
}

#view-map .filter-pill {
  position: relative;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(var(--c-ink), 0.18);
  background: rgb(var(--c-cream));
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  color: rgb(var(--c-ink));
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-map .filter-pill:hover { background: rgba(var(--c-accent), 0.1); box-shadow: var(--shadow-md); transform: translateY(-1px); }
#view-map .filter-pill.active { background: rgb(var(--c-accent)); border-color: rgb(var(--c-accent)); color: #ffffff; }

#view-map .filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(var(--c-cream), 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--c-accent), 0.4);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: none;
  z-index: 20;
}

#view-map .filter-dropdown.open { display: block; }

#view-map .filter-dropdown-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: rgb(var(--c-ink));
  cursor: pointer;
}

#view-map .filter-dropdown-option:hover { background: rgba(var(--c-accent), 0.12); }
#view-map .filter-dropdown-option.active { background: rgb(var(--c-accent)); color: #ffffff; }

#view-map .main-area {
  position: absolute;
  top: 140px;
  left: 48px;
  right: 48px;
  bottom: 30px;
  display: flex;
  gap: 20px;
}

#view-map .map-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: flex-basis 0.3s ease;
}

#view-map .map-frame {
  flex: 1 1 auto;
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(var(--c-accent), 0.14);
  background: #04121f;
  overflow: hidden;
}

#view-map #mapDiv {
  width: 100%;
  height: 100%;
  background: #04121f;
  filter: grayscale(1) sepia(0.4) brightness(0.8) contrast(1.15);
}

#view-map .map-markers-layer {
  position: absolute;
  inset: 0;
  z-index: 350;
  pointer-events: none;
  overflow: visible;
}

/* Targets Google Maps' own internally-generated DOM (copyright link/logo overlay). Google
   injects this markup directly into #mapDiv, which is itself inside #view-map, so the
   #view-map prefix still matches it correctly -- no scoping issue in practice. */
#view-map .gm-style-cc,
#view-map .gmnoprint,
#view-map a[href^="https://maps.google.com/maps"] {
  display: none !important;
}
#view-map .gm-style-cc + div,
#view-map .gm-style > div > div > a > div > img {
  display: none !important;
}

#view-map .map-zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
}

#view-map .map-zoom-controls button {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1.5px solid rgba(var(--c-accent), 0.85);
  background: rgba(var(--c-cream), 0.92);
  color: rgb(var(--c-accent));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#view-map .map-zoom-controls button:hover { background: rgba(var(--c-accent), 0.32); }

#view-map .map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 500;
}

#view-map .map-empty.hidden { display: none; }

/* A plain, static dot -- no pulse/ripple animation. That effect on the Site Activity map
   specifically signals "someone is on the site right now"; a prospect's address pin is a
   fixed location, not a live event, so it should just sit there. Sized to stay clearly
   visible against the map's muted sepia tone without being so big it crowds neighboring
   pins once a real list has hundreds of prospects in the same metro area. */
#view-map .map-pin-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgb(var(--c-accent-2));
  border: 1.5px solid #7A3A1F;
  box-shadow: 0 1px 3px rgba(var(--c-ink), 0.45);
  pointer-events: auto;
  cursor: pointer;
}

#view-map .map-pin-label {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 120px;
  padding: 7px 10px;
  border-radius: 9px;
  text-align: left;
  background: linear-gradient(135deg, rgba(var(--c-accent), 0.24), rgba(var(--c-accent), 0.07));
  backdrop-filter: blur(11px) saturate(1.4);
  -webkit-backdrop-filter: blur(11px) saturate(1.4);
  border: 1px solid rgba(var(--c-accent), 0.32);
  box-shadow: 0 6px 18px rgba(var(--c-ink), 0.3);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
  z-index: 5;
}

#view-map .map-pin-label .pin-title {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: #16181b;
  margin-bottom: 3px;
}

#view-map .map-pin-label .pin-line {
  display: block;
  font-size: 8.5px;
  font-weight: 600;
  color: rgba(18, 19, 22, 0.72);
  letter-spacing: 0.1px;
}

#view-map .map-pin-core:hover ~ .map-pin-label { opacity: 1; visibility: visible; }

#view-map .profile-col {
  flex: 0 0 0px;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: flex-basis 0.3s ease, opacity 0.25s ease;
}

#view-map .profile-col.open {
  flex: 0 0 46%;
  opacity: 1;
}

#view-map .profile-panel {
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 4px 16px 40px 4px;
}

#view-map .profile-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

#view-map .profile-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: rgb(var(--c-ink));
  margin: 4px 0 18px;
}

#view-map .profile-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--c-ink), 0.4);
  background: transparent;
  color: rgb(var(--c-ink));
  font-size: 15px;
  cursor: pointer;
  flex: 0 0 auto;
}

#view-map .profile-close-btn:hover { background: rgba(var(--c-ink), 0.08); }

#view-map .profile-id-card {
  background: rgb(var(--c-row));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 22px;
  text-align: center;
  margin-bottom: 22px;
}

#view-map .profile-id-label {
  font-size: 12px;
  color: rgba(var(--c-ink), 0.55);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

#view-map .profile-id-value {
  font-size: 20px;
  color: rgb(var(--c-ink));
  margin: 0 0 16px;
}

#view-map .profile-action-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}

#view-map .profile-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgb(var(--c-accent-2));
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-map .profile-icon-btn:hover { background: rgb(var(--c-accent)); box-shadow: var(--shadow-md); transform: translateY(-1px); }

#view-map .profile-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Not defined in the source page's own <style> block (it relied on styling that in practice
   never rendered, since the class name has no rule anywhere reachable by that page) -- ported
   from the merged app's Prospect List view (shared/view-prospects.css), which has the
   identical markup/behavior for these two buttons, so Mark Not Interested / Mark Deal Closed
   render styled here too instead of as bare unstyled buttons. */
#view-map .stage-action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
#view-map .stage-action-btn {
  flex: 1 1 50%;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
#view-map .stage-action-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
#view-map .stage-action-btn.lost {
  background: transparent;
  color: rgb(var(--c-ink));
  border: 1.5px solid rgba(var(--c-ink), 0.3);
  box-shadow: none;
}
#view-map .stage-action-btn.lost:hover { background: rgba(var(--c-ink), 0.08); }
#view-map .stage-action-btn.won {
  background: rgb(var(--c-accent-2));
  color: #ffffff;
}
#view-map .stage-action-btn.won:hover { background: rgb(var(--c-accent)); }

#view-map .profile-field-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(var(--c-ink), 0.25);
  font-size: 14px;
}

#view-map .profile-field-label { color: rgb(var(--c-ink)); font-weight: 600; }
#view-map .profile-field-value { color: rgb(var(--c-ink)); }
#view-map .profile-field-value a { color: #2b5fb0; }

#view-map .profile-boxes-row {
  display: flex;
  gap: 16px;
  margin-top: 22px;
}

#view-map .profile-box {
  flex: 1 1 50%;
  min-width: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#view-map .profile-box-header {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 10px 12px;
}

#view-map .profile-box.tasks .profile-box-header { background: rgba(var(--c-ink), 0.06); color: rgb(var(--c-ink)); }
#view-map .profile-box.emails .profile-box-header { background: rgba(var(--c-accent-2), 0.16); color: rgb(var(--c-accent-2)); }

#view-map .profile-box-list {
  border: none;
  background: rgba(var(--c-cream), 0.5);
}

#view-map .profile-box-item {
  padding: 8px 12px;
  font-size: 12px;
  color: rgb(var(--c-ink));
  border-bottom: 1px solid rgba(var(--c-ink), 0.12);
}

#view-map .profile-box-item:last-child { border-bottom: none; }

#view-map .task-add-row {
  padding: 8px 12px;
  font-size: 12px;
  color: rgb(var(--c-accent));
  cursor: pointer;
  font-weight: 600;
}

#view-map .task-add-row:hover { text-decoration: underline; }

#view-map .task-add-input {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid rgba(var(--c-ink), 0.3);
  background: transparent;
  font-size: 12px;
  padding: 4px 0;
  outline: none;
}

#view-map .task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#view-map .task-item-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: rgba(var(--c-ink), 0.4);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

#view-map .task-item-dismiss:hover { color: rgb(var(--c-accent)); }

#view-map .task-add-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

#view-map .task-add-form-row .task-add-input { flex: 1; width: auto; }

#view-map .task-add-submit-btn {
  flex-shrink: 0;
  border: 1px solid rgba(var(--c-accent), 0.6);
  background: transparent;
  color: rgb(var(--c-accent));
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

#view-map .task-add-submit-btn:hover { background: rgba(var(--c-accent), 0.12); }
#view-map .task-add-submit-btn:disabled { opacity: 0.5; cursor: default; }

#view-map .task-add-datetime-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 8px;
  flex-wrap: wrap;
  position: relative;
}

#view-map .task-add-date-picker { position: relative; flex: 1.4; min-width: 82px; }

#view-map .task-add-date-btn {
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid rgba(var(--c-ink), 0.3);
  background: transparent;
  font-size: 11px;
  color: rgba(var(--c-ink), 0.5);
  padding: 4px 2px;
  font-family: inherit;
  cursor: pointer;
}
#view-map .task-add-date-btn.has-value { color: rgb(var(--c-ink)); }

#view-map .task-add-date-cal {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  background: rgb(var(--c-cream));
  border: 1px solid rgba(var(--c-ink), 0.15);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(var(--c-ink), 0.18);
  padding: 8px;
  width: 190px;
}
#view-map .task-add-date-cal.open { display: block; }

#view-map .task-add-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: rgb(var(--c-ink));
  margin-bottom: 6px;
}
#view-map .task-add-cal-arrow {
  border: none;
  background: none;
  color: rgb(var(--c-accent));
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
#view-map .task-add-cal-dow,
#view-map .task-add-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
#view-map .task-add-cal-dow {
  font-size: 9px;
  color: rgba(var(--c-ink), 0.45);
  text-align: center;
  margin-bottom: 3px;
}
#view-map .task-add-cal-grid { gap: 2px; }
#view-map .task-add-cal-day {
  text-align: center;
  font-size: 10.5px;
  color: rgb(var(--c-ink));
  padding: 4px 0;
  border-radius: 4px;
  cursor: pointer;
}
#view-map .task-add-cal-day:hover:not(.disabled):not(.muted) { background: rgba(var(--c-accent), 0.15); }
#view-map .task-add-cal-day.selected { background: rgb(var(--c-accent)); color: #ffffff; }
#view-map .task-add-cal-day.disabled { color: rgba(var(--c-ink), 0.22); cursor: default; }
#view-map .task-add-cal-day.muted { visibility: hidden; }

#view-map .task-add-hour-select,
#view-map .task-add-minute-select,
#view-map .task-add-ampm-select {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-bottom: 1px solid rgba(var(--c-ink), 0.3);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M1 2l3 3 3-3' stroke='%23211E19' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 8px 8px;
  font-size: 11px;
  color: rgb(var(--c-ink));
  padding: 4px 12px 4px 2px;
  outline: none;
  font-family: inherit;
  min-width: 0;
  box-sizing: border-box;
}
#view-map .task-add-hour-select,
#view-map .task-add-minute-select { width: 40px; flex: none; }
#view-map .task-add-ampm-select { width: 54px; flex: none; }
#view-map .task-add-colon { color: rgba(var(--c-ink), 0.5); font-size: 11px; }
#view-map .task-add-datetime-row .task-add-submit-btn { margin-left: auto; }
#view-map .task-add-date-btn.error { color: rgb(var(--c-danger)); border-bottom-color: rgb(var(--c-danger)); }
#view-map .task-add-hour-select.error,
#view-map .task-add-minute-select.error { color: rgb(var(--c-danger)); border-bottom-color: rgb(var(--c-danger)); }
#view-map .task-add-datetime-error { width: 100%; font-size: 10.5px; color: rgb(var(--c-danger)); margin-top: 4px; }

#view-map .profile-notes-title, #view-map .profile-activity-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: rgb(var(--c-ink));
  margin: 26px 0 10px;
}

#view-map .profile-notes-box {
  background: rgb(var(--c-row));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

#view-map .profile-note-entry { margin-bottom: 14px; }
#view-map .profile-note-entry:last-child { margin-bottom: 0; }

#view-map .note-add-box { margin-top: 10px; }

#view-map .note-add-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  resize: vertical;
  border: 1px solid rgba(var(--c-ink), 0.18);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background: rgb(var(--c-cream));
  color: rgb(var(--c-ink));
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#view-map .note-add-textarea:focus {
  outline: none;
  border-color: rgba(var(--c-accent), 0.5);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(var(--c-accent), 0.12);
}

#view-map .note-add-btn {
  margin-top: 8px;
  width: 100%;
  background: rgb(var(--c-accent));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-map .note-add-btn:hover { background: rgb(var(--c-accent-2)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
#view-map .note-add-btn:disabled { opacity: 0.6; cursor: default; }

#view-map .profile-note-meta {
  font-size: 11px;
  font-weight: 700;
  color: rgb(var(--c-ink));
  margin-bottom: 4px;
}

#view-map .profile-note-text {
  font-size: 13.5px;
  color: rgb(var(--c-ink));
  line-height: 1.4;
}

#view-map .profile-activity-list {
  border: 1px solid rgba(var(--c-ink), 0.25);
  border-radius: 6px;
  overflow: hidden;
}

#view-map .profile-activity-row {
  padding: 9px 14px;
  font-size: 12.5px;
  color: rgb(var(--c-ink));
  text-align: center;
  border-bottom: 1px solid rgba(var(--c-ink), 0.15);
}

#view-map .profile-activity-row:last-child { border-bottom: none; }
