/* =============================================================================
   Mapshot Enhanced: Styles for injected Leaflet plugins
   ============================================================================= */

/* --- Drawing labels --- */
.mapshot-draw-label {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  white-space: nowrap;
}

/* --- Measurement popup --- */
.mapshot-measure-popup {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.5;
}

/* --- Measure tool --- */
.mapshot-measure-control .mapshot-measure-btn {
  font-size: 16px;
  text-align: center;
  line-height: 26px;
  text-decoration: none !important;
}
.mapshot-measure-control .mapshot-measure-btn.active {
  background: #ff6600;
  color: #fff;
}

.mapshot-measure-label {
  background: rgba(255, 102, 0, 0.85);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  padding: 1px 5px;
  font-family: 'Consolas', 'Monaco', monospace;
}

.mapshot-measure-total {
  background: rgba(255, 60, 0, 0.9);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  padding: 3px 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-weight: bold;
}

/* --- Coordinate display --- */
.mapshot-coords {
  background: rgba(0, 0, 0, 0.7);
  color: #ddd;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  min-width: 140px;
  text-align: center;
  pointer-events: none;
}

/* --- Drawing manager panel --- */
.mapshot-drawing-manager {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
}

.mapshot-dm-toggle {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  font-size: 13px;
}
.mapshot-dm-toggle:hover {
  background: rgba(0, 0, 0, 0.9);
}

.mapshot-dm-panel {
  background: rgba(20, 20, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  margin-bottom: 6px;
  max-height: 350px;
  width: 280px;
  overflow-y: auto;
  color: #ddd;
  backdrop-filter: blur(8px);
}

.mapshot-dm-header {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.mapshot-dm-actions {
  padding: 6px 10px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.mapshot-dm-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  color: #ccc;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 11px;
}
.mapshot-dm-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.mapshot-dm-btn-danger {
  color: #ff6b6b;
  border-color: rgba(255, 100, 100, 0.3);
}
.mapshot-dm-btn-danger:hover {
  background: rgba(255, 50, 50, 0.3);
  color: #ff4444;
}

.mapshot-dm-list {
  max-height: 240px;
  overflow-y: auto;
}

.mapshot-dm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mapshot-dm-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mapshot-dm-info {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapshot-dm-btn-sm {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}
.mapshot-dm-btn-sm:hover {
  color: #fff;
}

.mapshot-dm-empty {
  padding: 12px;
  color: #888;
  text-align: center;
  font-style: italic;
  font-size: 12px;
}

/* --- Leaflet.draw overrides for dark theme --- */
.leaflet-draw-toolbar a {
  background-color: rgba(30, 30, 35, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
.leaflet-draw-toolbar a:hover {
  background-color: rgba(50, 50, 60, 0.95) !important;
}
.leaflet-draw-actions a {
  background: rgba(30, 30, 35, 0.95) !important;
  color: #ddd !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
.leaflet-draw-actions a:hover {
  background: rgba(60, 60, 70, 0.95) !important;
  color: #fff !important;
}

/* --- Print/export styles --- */
@media print {
  .leaflet-control-container,
  .mapshot-drawing-manager,
  .mapshot-coords {
    display: none !important;
  }
}
