/* ===========
   LIVE MAP LAYOUT
   =========== */

main {
  margin-top: 1rem;
}

/* Overall layout: sidebar + map */
.live-map-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Sidebar (calls list) */
.live-map-sidebar {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.live-map-sidebar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main, #111827);
  margin-bottom: 0.1rem;
}

.live-map-sidebar .lead {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 0.4rem;
}

/* Count + last updated line */
.live-map-count {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main, #111827);
}

.live-map-updated {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 0.3rem;
}

/* Calls list container */
.live-map-call-list {
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 0.2rem;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Individual call item */
.live-map-call-item {
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

.live-map-call-item:hover {
  background: #f9fafb;
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

/* Active/selected call */
.live-map-call-item.active {
  border-color: rgb(197, 2, 2);
  background: radial-gradient(
      circle at top left,
      rgba(129, 140, 248, 0.18),
      transparent 55%
    ),
    #f9fafb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3),
    0 8px 20px rgba(15, 23, 42, 0.08);
}

/* Gray-out recently inactive markers on the map */
.leaflet-marker-icon.wdw-marker-inactive {
  filter: grayscale(100%) brightness(0.85);
  opacity: 0.9;
}

/* Make sure active markers look normal */
.leaflet-marker-icon.wdw-marker-active {
  filter: none;
  opacity: 1;
}

.live-map-call-sections {
  margin-top: 0.75rem;
}

.live-map-call-section + .live-map-call-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.live-map-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  color: #0354f5;
}

.live-map-call-empty {
  font-size: 0.8rem;
  color: #9ca3af;
  padding: 0.4rem 0;
}

.live-map-call-item.inactive {
  opacity: 0.7;
}


/* Time / type / location text */
.call-time {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #111827);
}

.call-type {
  font-size: 0.82rem;
  font-weight: 500;
  color: #4b5563;
}

.call-location {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
}

/* Map wrapper */
.live-map-map-wrapper {
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

/* Leaflet map div */
#live-map {
  width: 100%;
  height: 360px;
}

/* Leaflet popup tweaks */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.leaflet-popup-content {
  margin: 8px 10px;
}

/* Desktop layout (taller heights) */
@media (min-width: 900px) {
  .live-map-layout {
    flex-direction: row;
    align-items: stretch;
  }

  /* Sidebar width */
  .live-map-sidebar {
    flex: 2;
    max-width: 420px; /* a bit wider for readability */
    height: 760px;    /* <<< NEW: taller sidebar */
    overflow-y: auto; /* ensure no overflow issues */
  }

  /* Map container */
  .live-map-map-wrapper {
    flex: 3;
    height: 760px; /* <<< NEW: same height as sidebar */
  }

  /* Leaflet map height */
  #live-map {
    height: 760px; /* <<< NEW: taller map */
  }

  /* Calls list area inside sidebar */
  .live-map-call-list {
    max-height: none; /* allow full height */
  }
}

