/* ================================================
   PAVLOV OpenStreetMap Leaflet Plugin Styles
   ================================================ */

/* Map Container */
.osm-leaflet-map {
  height: 400px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Leaflet Controls */
.leaflet-control-container .leaflet-routing-container-hide {
  display: none;
}

.leaflet-control-container .leaflet-control {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.leaflet-control-container .leaflet-control a {
  color: #333;
  text-decoration: none;
}

.leaflet-control-container .leaflet-control a:hover {
  color: #007cba;
}

/* Popup Styles */
.leaflet-popup-content-wrapper {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.leaflet-popup-tip {
  background: #fff;
}

/* Marker Styles (if using custom markers) */
.osm-leaflet-marker {
  /* Custom marker styles here */
}

/* Admin panel map editor styles */
.osm-map-editor-container {
  position: relative;
  clear: both;
  margin: 10px 0;
  display: block;
  width: 100%;
}
.osm-map-editor {
  height: 400px;
  width: 100% !important;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: block;
  background: #e1e5e9;
}
.osm-map-editor .leaflet-container {
  background: #e1e5e9;
}
.osm-geocode-label,
.osm-info-label {
  display: block;
  font-weight: bold;
  margin-bottom: 10px;
}
.osm-info-label.osm-info-label--spaced,
.osm-geocode-label {
  margin-top: 15px;
}
.osm-info-help,
.osm-geocode-status {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}
.osm-geocode-status {
  margin-top: 0;
}
.osm-geocode-status-error {
  color: #b00;
}
.osm-geocode-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.osm-geocode-input {
  flex: 1;
  padding: 7px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.osm-flag-image-container {
  margin-bottom: 10px;
}
.osm-flag-image-preview img,
.osm-flag-preview-img {
  max-width: 100px;
  height: auto;
  border: 1px solid #ddd;
  padding: 5px;
}
.osm-hidden {
  display: none !important;
}
#osm_element_flag_image_id_field {
  display: none;
}

/* Shortcode split layout */
.osm-map-split-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}
.osm-map-split-container > div {
  flex: 1 1 calc(50% - 20px);
  min-width: 320px;
}
.osm-map-split-container.osm-map-right .osm-map-right,
.osm-map-split-container.osm-map-left .osm-map-left {
  order: 2;
}
.osm-map-split-container.osm-map-right .osm-map-left,
.osm-map-split-container.osm-map-left .osm-map-right {
  order: 1;
}
.osm-map-split-container .osm-map-sidebar-content {
  text-align: left;
  padding: 8px;
  max-height: calc(var(--osm-map-height) - 80px);
  overflow: auto;
}
.frm_forms .frm_form_field {
  margin-bottom: 10px;
}
.frm_primary_label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.osm-map-search-field .frm_form_field {
  padding-right: 40px;
}
.osm-map-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  transition: color 0.2s ease;
}
.osm-map-search-icon:hover {
  color: #374151;
}
.osm-map-search-result {
  text-align: left;
  font-size: 13px;
  min-height: 1.2em;
}
.osm-map-sidebar-content-empty {
  min-height: 100px;
  background: #fafafa;
}
.osm-map-container {
  width: 100%;
  border: 1px solid #ccc;
}
.osm-map-image-fallback {
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
}
.osm-map-drag-over {
  opacity: 0.7;
}
.osm-map-image-fallback img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.osm-map-image-empty p {
  color: #999;
}
.osm-map-inquiry-heading {
  text-align: left;
}
.osm-fieldset-no-padding {
  padding: 0!important;
}
.osm-admin-card {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
  display: none;
}
.osm-admin-label {
  margin-right: 10px;
  font-weight: bold;
}
.osm-admin-color-picker {
  cursor: pointer;
  width: 60px;
  height: 40px;
  border: none;
  border-radius: 4px;
}
.osm-admin-textarea {
  width: 100%;
  height: 60px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 12px;
}
.osm-admin-buttonContainer {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
}
.osm-admin-button {
  margin-right: 5px;
  margin-bottom: 5px;
  padding: 8px 15px;
  background-color: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}
.osm-admin-button:hover {
  background-color: #005a87;
}
.osm-admin-button-active {
  background-color: #004578;
  opacity: 0.7;
}
.osm-admin-clear-button {
  background-color: #dc3545;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}
.osm-admin-help-text {
  font-size: 12px;
  color: #666;
  margin: 10px 0 0 0;
}
.osm-admin-drawing-button {
  margin-top: 10px;
}
.osm-admin-drawing-button.active {
  background-color: #28a745;
}
.osm-admin-drawing-button.inactive {
  background-color: #999;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .osm-leaflet-map {
    height: 300px;
  }
}

.osm-map-sidebar-results {
  max-height: 200px;
  overflow-y: auto;
}
.osm-map-sidebar-item {
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.osm-map-sidebar-item:last-child {
  border-bottom: none;
}

.osm-block-map-drag-over {
  background-color: rgba(0, 150, 255, 0.1);
  border: 2px dashed #0096ff;
}

.wp-block-osm-leaflet-map .osm-map-container {
  position: relative;
  overflow: hidden;
}
.wp-block-osm-leaflet-map iframe {
  display: none !important;
}