/* FishRadar Weather Map V3 — Leaflet dark map
   Uses FishRadar design tokens from styles.css (loaded before this file)
   v=20260628-v3-leaflet */

/* ── Container ─────────────────────────────────────────────────── */
#weather-map-svg.v3-active {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  text-align: left !important;
  position: relative;
  height: 480px;
  border-radius: 14px;
  overflow: hidden;
}

@media (min-width: 480px) { #weather-map-svg.v3-active { height: 520px; } }
@media (min-width: 768px) { #weather-map-svg.v3-active { height: 580px; } }
@media (min-width: 1024px) { #weather-map-svg.v3-active { height: 640px; } }

#v3-leaflet-map {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: #06090F;
}

/* Override Leaflet for dark theme */
#v3-leaflet-map .leaflet-container {
  background: #06090F !important;
  font-family: var(--font-sans, system-ui, sans-serif) !important;
}

#v3-leaflet-map .leaflet-control-attribution {
  background: rgba(6,9,15,.72) !important;
  color: rgba(240,244,250,.3) !important;
  font-size: 9px !important;
  backdrop-filter: blur(6px);
}

#v3-leaflet-map .leaflet-control-attribution a {
  color: rgba(240,244,250,.45) !important;
}

#v3-leaflet-map .leaflet-control-zoom {
  border: 1px solid rgba(240,244,250,.1) !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

#v3-leaflet-map .leaflet-control-zoom a {
  background: rgba(14,20,32,.88) !important;
  color: rgba(240,244,250,.7) !important;
  border-bottom: 1px solid rgba(240,244,250,.08) !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  transition: background .15s, color .15s;
  backdrop-filter: blur(8px);
}

#v3-leaflet-map .leaflet-control-zoom a:last-child { border-bottom: none !important; }
#v3-leaflet-map .leaflet-control-zoom a:hover {
  background: rgba(46,236,193,.15) !important;
  color: #2EECC1 !important;
}

/* ── Layer tab bar ──────────────────────────────────────────────── */
.v3layers {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1200;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: calc(100% - 24px);
}

.v3l {
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(240,244,250,.12);
  background: rgba(6,9,15,.78);
  color: rgba(240,244,250,.55);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background .18s, color .18s, border-color .18s;
  white-space: nowrap;
  letter-spacing: .02em;
}

.v3l:hover {
  background: rgba(46,236,193,.12);
  color: rgba(240,244,250,.9);
  border-color: rgba(46,236,193,.3);
}

.v3l--active {
  background: rgba(46,236,193,.15) !important;
  color: #2EECC1 !important;
  border-color: rgba(46,236,193,.4) !important;
}

/* ── Info card ──────────────────────────────────────────────────── */
.v3card {
  position: absolute;
  bottom: 24px;
  left: 12px;
  right: 12px;
  z-index: 1200;
  border-radius: 14px;
  background: rgba(10,15,24,.88);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(240,244,250,.1);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  overflow: hidden;
}

.v3card.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (min-width: 768px) {
  .v3card {
    left: 12px;
    right: auto;
    width: 276px;
    bottom: 32px;
  }
}

.v3card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px 8px;
  gap: 8px;
}

.v3card__title {
  flex: 1;
  min-width: 0;
}

.v3card__name {
  font-size: 15px;
  font-weight: 700;
  color: rgba(240,244,250,.95);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v3card__water {
  font-size: 10px;
  color: rgba(240,244,250,.45);
  margin-top: 2px;
  font-family: var(--font-mono, monospace);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v3card__close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(240,244,250,.12);
  background: rgba(240,244,250,.06);
  color: rgba(240,244,250,.5);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.v3card__close:hover {
  background: rgba(255,107,107,.18);
  color: #ff6b6b;
  border-color: rgba(255,107,107,.3);
}

.v3card__score {
  padding: 0 14px 10px;
}

.v3card__score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.v3card__slabel {
  font-size: 11px;
  font-weight: 700;
  color: var(--v3c, #2EECC1);
}

.v3card__bar-wrap {
  height: 4px;
  background: rgba(240,244,250,.08);
  border-radius: 2px;
  overflow: hidden;
}

.v3card__bar {
  height: 100%;
  border-radius: 2px;
  background: var(--v3c, #2EECC1);
  transition: width .4s;
}

.v3card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  padding: 0 14px 12px;
}

.v3card__cell {
  padding: 7px 0;
  border-top: 1px solid rgba(240,244,250,.06);
}

.v3card__k {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(240,244,250,.35);
  margin-bottom: 3px;
}

.v3card__v {
  font-size: 13px;
  font-weight: 700;
  color: rgba(240,244,250,.85);
}

.v3card__icon-label {
  font-size: 10px;
  color: rgba(240,244,250,.55);
  margin-top: 1px;
}

/* ── Region markers ─────────────────────────────────────────────── */
.v3mk {
  position: relative;
  cursor: pointer;
}

.v3mk__svg {
  display: block;
  overflow: visible;
}

.v3mk__body {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
  line-height: 1;
}

.v3mk__icon {
  font-size: 15px;
  display: block;
  margin-bottom: 1px;
}

.v3mk__temp {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--mk-c, #2EECC1);
  letter-spacing: -.01em;
}

.v3mk__name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  white-space: nowrap;
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(240,244,250,.65);
  background: rgba(6,9,15,.72);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  transition: color .18s;
}

.v3mk--active .v3mk__name {
  color: var(--mk-c, #2EECC1);
  background: rgba(6,9,15,.88);
}

/* Hover glow via SVG filter baked into HTML */
.v3mk:hover .v3mk__svg circle.v3mk__rim {
  opacity: .65;
}

/* ── City labels ────────────────────────────────────────────────── */
.v3city {
  pointer-events: none !important;
}

.v3city__label {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(240,244,250,.38);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 1px 5px;
  background: rgba(6,9,15,.45);
  border-radius: 3px;
  pointer-events: none;
}

/* ── Micro fishing points ───────────────────────────────────────── */
.v3micro {
  pointer-events: auto;
  cursor: pointer;
}

.v3micro__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mk-c, rgba(46,236,193,.4));
  border: 1.5px solid var(--mk-c, rgba(46,236,193,.6));
  opacity: 0.45;
  transition: opacity .2s, transform .2s;
}

.v3micro:hover .v3micro__dot {
  opacity: 0.85;
  transform: scale(1.4);
}

/* Tooltip for micro (native leaflet popup restyled) */
#v3-leaflet-map .leaflet-popup-content-wrapper {
  background: rgba(10,15,24,.92) !important;
  border: 1px solid rgba(240,244,250,.1) !important;
  border-radius: 10px !important;
  color: rgba(240,244,250,.88) !important;
  font-size: 12px !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.45) !important;
  backdrop-filter: blur(12px);
  padding: 2px !important;
}

#v3-leaflet-map .leaflet-popup-content {
  margin: 10px 14px !important;
  line-height: 1.55 !important;
}

#v3-leaflet-map .leaflet-popup-tip {
  background: rgba(10,15,24,.92) !important;
}

#v3-leaflet-map .leaflet-popup-close-button {
  color: rgba(240,244,250,.4) !important;
  font-size: 16px !important;
  padding: 5px 8px !important;
}

/* ── Scroll wheel guard ─────────────────────────────────────────── */
.v3-scroll-hint {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 1300;
  background: rgba(10,15,24,.82);
  border: 1px solid rgba(240,244,250,.12);
  border-radius: 8px;
  color: rgba(240,244,250,.7);
  font-size: 11px;
  padding: 6px 14px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}

.v3-scroll-hint.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Velocity layer (wind particles) ────────────────────────────── */
#v3-leaflet-map .leaflet-velocity-canvas,
#v3-leaflet-map .velocity-overlay {
  pointer-events: none !important;
  opacity: 0.72;
}

/* ── OWM tile overlay opacity ───────────────────────────────────── */
#v3-leaflet-map .v3-owm-overlay {
  opacity: 0.52;
}

/* ── Mobile adjustments ─────────────────────────────────────────── */
@media (max-width: 540px) {
  .v3layers { gap: 4px; }
  .v3l { font-size: 10px; padding: 4px 9px; }

  .v3card { bottom: 8px; }

  .v3card__head { padding: 8px 12px 6px; }
  .v3card__name { font-size: 13px; }
  .v3card__water { font-size: 9px; }

  .v3card__score { padding: 0 12px 8px; }
  .v3card__score-row { margin-bottom: 4px; }
  .v3card__slabel { font-size: 10px; }

  .v3card__grid {
    grid-template-columns: 1fr 1fr;
    padding: 0 12px 10px;
  }
  .v3card__cell { padding: 5px 0; }
  .v3card__k { font-size: 8px; }
  .v3card__v { font-size: 12px; }

  /* show only 4 cells on mobile */
  .v3card__cell:nth-child(5),
  .v3card__cell:nth-child(6) { display: none; }
}
