/* ============================================================
   TRAKITA LOCATION PICKER STYLES
   Map picker component untuk dashboard mitra
   ============================================================ */

/* Container utama */
.trakita-loc-picker-wrapper {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-top: 4px;
}

/* Header info */
.trakita-loc-picker-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
}

.trakita-loc-picker-header svg {
  flex-shrink: 0;
}

/* Search bar */
.trakita-loc-picker-search {
  position: relative;
  padding: 8px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}

.trakita-loc-picker-search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.trakita-loc-picker-search input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.trakita-loc-picker-search input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.trakita-loc-picker-search-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.trakita-loc-picker-search-btn:hover {
  background: #4f46e5;
}

.trakita-loc-picker-search-btn svg {
  flex-shrink: 0;
}

/* GPS detect button */
.trakita-loc-picker-gps-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.trakita-loc-picker-gps-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: #f5f3ff;
}

.trakita-loc-picker-gps-btn svg {
  flex-shrink: 0;
}

/* Search results dropdown */
.loc-picker-search-results {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
}

.loc-picker-result-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.4;
}

.loc-picker-result-item:last-child {
  border-bottom: none;
}

.loc-picker-result-item:hover {
  background: #f5f3ff;
  color: #4f46e5;
}

.loc-picker-result-item span {
  flex: 1;
}

.loc-picker-no-result {
  padding: 12px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}

/* Map container */
.trakita-loc-picker-map {
  width: 100%;
  height: 250px;
  position: relative;
  background: #f3f4f6;
}

/* Custom pin marker */
.trakita-loc-picker-pin {
  cursor: grab;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: filter 0.2s;
}

.trakita-loc-picker-pin:active {
  cursor: grabbing;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* Address display */
.trakita-loc-picker-address {
  padding: 10px 12px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.trakita-loc-picker-address-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.trakita-loc-picker-address-row svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.trakita-loc-picker-address-text {
  flex: 1;
  font-size: 12px;
  color: #374151;
  line-height: 1.5;
  word-break: break-word;
}

.trakita-loc-picker-coords {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

/* Required badge */
.trakita-loc-picker-required {
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}

/* Status indicator */
.trakita-loc-picker-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

.trakita-loc-picker-status.saved {
  background: #dcfce7;
  color: #16a34a;
}

.trakita-loc-picker-status.unsaved {
  background: #fef3c7;
  color: #d97706;
}

.trakita-loc-picker-status.none {
  background: #fee2e2;
  color: #ef4444;
}

/* Instruction text */
.trakita-loc-picker-instruction {
  padding: 6px 12px 10px;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

/* MapLibre popup override untuk location picker */
.trakita-loc-picker-map .maplibregl-popup-content {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.trakita-loc-picker-map .maplibregl-ctrl-bottom-left,
.trakita-loc-picker-map .maplibregl-ctrl-bottom-right {
  bottom: 4px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .trakita-loc-picker-map {
    height: 200px;
  }

  .trakita-loc-picker-search-row {
    flex-wrap: wrap;
  }

  .trakita-loc-picker-search input {
    min-width: 0;
  }

  .trakita-loc-picker-search-btn {
    padding: 8px 10px;
  }

  .trakita-loc-picker-gps-btn {
    padding: 8px 8px;
    font-size: 10px;
  }
}
