/* ============================================================
   Map & Map-filter component
   Extracted from parent style.css
   ============================================================ */

/* ===== LEAFLET MAP STYLES ===== */

.nc-map-wrapper {
  margin: 30px 0;
}

.nc-leaflet-map {
  width: 100%;
  height: 3800px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nc-map-marker-single,
.nc-map-marker {
  background: transparent;
  border: none;
}

.nc-marker-pin {
  width: 40px;
  height: 40px;
  background: #3498db;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.nc-marker-pin i {
  transform: rotate(45deg);
  color: white;
  font-size: 18px;
}

.nc-popup {
  font-family: inherit;
  min-width: 200px;
}

.nc-popup h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #2c3e50;
}

.nc-popup p {
  margin: 5px 0;
  font-size: 14px;
  color: #64748b;
}

.nc-popup-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background: #3498db;
  color: white !important;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.2s;
}

.nc-popup-link:hover {
  background: #2980b9;
}

/* ===== MAP FILTERS - FIXED ===== */

.nc-map-filter-container {
  margin: 40px 0;
}

.nc-map-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr)) auto;
  gap: 15px;
  margin-bottom: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  align-items: end;
}

.nc-filter-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nc-filter-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
  white-space: nowrap;
}

.nc-filter-group label i {
  margin-right: 6px;
  color: #3498db;
}

/* === FIX ZA SELECT DROPDOWNS - CHROME COMPATIBLE === */
.nc-filter-select {
  width: 100% !important;
  min-width: 250px !important;
  max-width: 100% !important;
  padding: 10px 40px 10px 12px !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  background: white !important;
  transition: border-color 0.2s !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  white-space: normal !important;
}

.nc-filter-select:focus {
  outline: none !important;
  border-color: #3498db !important;
}

.nc-filter-select option {
  padding: 8px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
}

@media (max-width: 768px) {
  .nc-filter-select {
    min-width: 100% !important;
    font-size: 16px !important;
  }
}

.nc-btn-reset {
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
  height: 42px;
}

.nc-btn-reset:hover {
  background: #c0392b;
}

.nc-map-stats {
  margin-top: 15px;
  padding: 12px 20px;
  background: #ecf0f1;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  color: #2c3e50;
}

.nc-map-stats #nc-visible-count,
.nc-map-stats span[id^="nc-visible-count"] {
  font-weight: 700;
  color: #3498db;
  font-size: 18px;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(52, 152, 219, 0.6);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(52, 152, 219, 0.8);
  color: white;
  font-weight: 700;
}

/* Custom popup styling - remove default Leaflet padding */
.nc-custom-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nc-custom-popup .leaflet-popup-content {
  margin: 0;
  width: 320px !important;
}

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

.nc-custom-popup a.leaflet-popup-close-button {
  top: 8px;
  right: 8px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.nc-custom-popup a.leaflet-popup-close-button:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .nc-map-filters {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .nc-btn-reset {
    width: 100%;
    height: auto;
    padding: 12px 20px;
  }

  .nc-leaflet-map {
    height: 350px;
  }
}

/* === CUSTOM SELECT DROPDOWN === */
.nc-map-filter-container .nc-custom-select {
  position: relative !important;
  width: 100% !important;
}

.nc-map-filter-container .nc-custom-select-trigger {
  padding: 10px 40px 10px 12px !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 6px !important;
  background: white !important;
  cursor: pointer !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-height: 42px !important;
  transition: border-color 0.2s !important;
}

.nc-map-filter-container .nc-custom-select-trigger:hover {
  border-color: #3498db !important;
}

.nc-map-filter-container .nc-custom-select-trigger i {
  transition: transform 0.2s !important;
  color: #334155 !important;
}

.nc-map-filter-container .nc-custom-select.active .nc-custom-select-trigger i {
  transform: rotate(180deg) !important;
}

.nc-map-filter-container .nc-custom-options {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  background: white !important;
  border: 2px solid #3498db !important;
  border-radius: 6px !important;
  margin-top: 4px !important;
  max-height: 300px !important;
  overflow-y: auto !important;
  z-index: 1000 !important;
  display: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.nc-map-filter-container .nc-custom-select.active .nc-custom-options {
  display: block !important;
}

.nc-map-filter-container .nc-custom-option {
  padding: 10px 12px !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  word-wrap: break-word !important;
}

.nc-map-filter-container .nc-custom-option:hover {
  background: #f1f5f9 !important;
}

.nc-map-filter-container .nc-custom-option.selected {
  background: #e0f2fe !important;
  font-weight: 600 !important;
}

.nc-map-filter-container .nc-custom-option[style*="display: none"] {
  display: none !important;
}

@media (max-width: 768px) {
  .nc-map-filter-container .nc-custom-select-trigger {
    font-size: 16px !important;
  }
}

/* === FORCE MOBILE DROPDOWN === */
.nc-map-filter-container .nc-custom-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #3498db;
  border-radius: 6px;
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nc-map-filter-container .nc-custom-select.active .nc-custom-options {
  display: block;
}
