/**
 * Kasi Box Custom Map Theme — Clean Modern
 * Brand: #171717 (dark), #22c55e (green), #fff (white)
 */

:root {
  --kbx-map-bg: #ffffff;
  --kbx-map-road: #e5e5e5;
  --kbx-map-water: #a8d5e2;
  --kbx-map-green: #c8e6c9;
  --kbx-map-text: #525252;
  --kbx-map-text-light: #a3a3a3;
  --kbx-brand-dark: #171717;
  --kbx-brand-green: #22c55e;
  --kbx-brand-green-dark: #16a34a;
  --kbx-brand-cream: #faf8f5;
}

/* ── Tile layer — clean, desaturated modern look ────────────── */
.leaflet-tile-pane {
  filter: grayscale(0.65) brightness(1.08) contrast(0.88) saturate(0.4);
}

/* ── Zoom controls ──────────────────────────────────────────── */
.leaflet-control-zoom {
  border: none !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08) !important;
  border: 1px solid rgba(0,0,0,0.04) !important;
}
.leaflet-control-zoom a {
  background: var(--kbx-map-bg) !important;
  color: var(--kbx-brand-dark) !important;
  border: none !important;
  border-bottom: 1px solid #f3f4f6 !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 17px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}
.leaflet-control-zoom a:hover {
  background: var(--kbx-brand-cream) !important;
}
.leaflet-control-zoom a:active {
  background: #f0f0f0 !important;
  transform: scale(0.95);
}
.leaflet-control-zoom-in { border-bottom: 1px solid #f3f4f6 !important; }
.leaflet-control-zoom-out { border-bottom: none !important; }

/* ── Attribution ────────────────────────────────────────────── */
.leaflet-control-attribution {
  background: rgba(255,255,255,0.8) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: var(--kbx-map-text-light) !important;
  font-size: 9px !important;
  padding: 2px 8px !important;
  border-radius: 8px 0 0 0 !important;
  border: none !important;
}
.leaflet-control-attribution a {
  color: var(--kbx-map-text) !important;
  text-decoration: none !important;
}

/* ── Popups ─────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--kbx-map-bg) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.03) !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.leaflet-popup-content {
  margin: 14px 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif !important;
  font-size: 13px !important;
  color: var(--kbx-brand-dark) !important;
  line-height: 1.5 !important;
}
.leaflet-popup-content b {
  font-weight: 700;
  color: var(--kbx-brand-dark);
}
.leaflet-popup-tip {
  background: var(--kbx-map-bg) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1) !important;
  border: none !important;
}
.leaflet-popup-close-button {
  color: var(--kbx-map-text-light) !important;
  font-size: 20px !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  transition: all 0.15s !important;
}
.leaflet-popup-close-button:hover {
  color: var(--kbx-brand-dark) !important;
  background: #f3f4f6 !important;
}

/* ── Custom marker base ─────────────────────────────────────── */
.kbx-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.kbx-marker-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  border: 3px solid #fff;
}
.kbx-marker-pin i {
  transform: rotate(45deg);
  font-size: 16px;
  color: #fff;
}

/* Brand green marker */
.kbx-marker-green .kbx-marker-pin {
  background: var(--kbx-brand-green);
}
/* Dark marker */
.kbx-marker-dark .kbx-marker-pin {
  background: var(--kbx-brand-dark);
}
/* Blue marker (customer) */
.kbx-marker-blue .kbx-marker-pin {
  background: #3b82f6;
}
/* Orange marker (store) */
.kbx-marker-orange .kbx-marker-pin {
  background: #f59e0b;
}

/* Small dot marker */
.kbx-marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.kbx-marker-dot.green { background: var(--kbx-brand-green); }
.kbx-marker-dot.dark { background: var(--kbx-brand-dark); }
.kbx-marker-dot.blue { background: #3b82f6; }

/* ── Pulsing marker (for live tracking) ─────────────────────── */
.kbx-marker-pulse {
  position: relative;
}
.kbx-marker-pulse::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--kbx-brand-green);
  opacity: 0.3;
  animation: kbxPulse 2s ease-in-out infinite;
}
@keyframes kbxPulse {
  0%, 100% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.6); opacity: 0; }
}

/* ── Layer switcher ─────────────────────────────────────────── */
.simple-layer-switcher {
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03) !important;
  border: none !important;
  overflow: hidden !important;
}
.simple-provider-btn {
  border-radius: 10px !important;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.simple-provider-btn:active {
  transform: scale(0.9) !important;
}

/* ── Fullscreen map ─────────────────────────────────────────── */
.leaflet-container {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif !important;
}
