/* JDServer-Webs — modules/fires/fires.css */

.jd-fires-module {
  padding: 18px;
}

.jd-fires-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.jd-fires-head h3 {
  margin: 0 0 8px;
}

.jd-fires-help {
  margin: 0;
  opacity: .9;
  line-height: 1.55;
}

.jd-fires-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.jd-fires-meta-item {
  min-width: 145px;
  padding: 10px 12px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--card, #fff) 92%, #ef4444 8%);
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.12)) 88%, #ef4444 12%);
  backdrop-filter: blur(8px);
}

.jd-fires-meta-label {
  display: block;
  font-size: .8rem;
  opacity: .75;
  margin-bottom: 4px;
}

.jd-fires-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.jd-fires-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--card, #fff) 96%, #ef4444 4%);
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 84%, #ef4444 16%);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.jd-fires-select {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  cursor: pointer;
}

.jd-fires-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.jd-fires-filter,
.jd-fires-btn {
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 82%, #ef4444 18%);
  background: color-mix(in oklab, var(--card, #fff) 96%, #ef4444 4%);
  color: inherit;
  font: inherit;
  line-height: 1;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.jd-fires-filter:hover,
.jd-fires-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--card, #fff) 90%, #ef4444 10%);
  border-color: color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 66%, #ef4444 34%);
}

.jd-fires-filter.is-active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.24);
}

.jd-fires-map {
  width: 100%;
  height: 520px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 84%, #ef4444 16%);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.jd-fires-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.jd-fires-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--card, #fff) 94%, #ef4444 6%);
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 86%, #ef4444 14%);
  font-size: .92rem;
}

.jd-fires-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.jd-fires-summary,
.jd-fires-disclaimer {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: color-mix(in oklab, var(--card, #fff) 95%, #ef4444 5%);
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 86%, #ef4444 14%);
  line-height: 1.55;
}

.jd-fires-disclaimer {
  font-size: .94rem;
  opacity: .92;
}

.jd-fires-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.jd-fires-card {
  padding: 16px;
  border-radius: 20px;
  background: color-mix(in oklab, var(--card, #fff) 97%, #ef4444 3%);
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 88%, #ef4444 12%);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.jd-fires-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.jd-fires-card h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.jd-fires-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.jd-fires-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .82rem;
  line-height: 1;
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 82%, #ef4444 18%);
  background: color-mix(in oklab, var(--card, #fff) 95%, #ef4444 5%);
}

.jd-fires-badge.is-distance {
  font-weight: 700;
}

.jd-fires-place {
  font-weight: 700;
  opacity: .95;
  margin-bottom: 10px;
}

.jd-fires-card-meta {
  display: grid;
  gap: 6px;
  font-size: .92rem;
  opacity: .84;
}

.jd-fires-empty {
  padding: 22px 18px;
  border-radius: 20px;
  background: color-mix(in oklab, var(--card, #fff) 95%, #ef4444 5%);
  border: 1px solid color-mix(in oklab, var(--border, rgba(0,0,0,.14)) 86%, #ef4444 14%);
  text-align: center;
  line-height: 1.6;
}

.jd-fires-popup {
  min-width: 220px;
}

.jd-fires-popup h5 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.jd-fires-popup p {
  margin: 6px 0;
  line-height: 1.45;
}

.jd-fires-popup .mini {
  font-size: .9rem;
  opacity: .85;
}

.jd-fires-radius-circle {
  filter: drop-shadow(0 2px 8px rgba(15,23,42,.10));
}

.jd-fires-map-marker {
  width: 24px !important;
  height: 24px !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  position: relative !important;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.98), rgba(255,255,255,.34) 34%, transparent 60%),
    var(--fires-color, #ef4444) !important;
  border: 1.5px solid rgba(255,255,255,.96) !important;
  box-shadow:
    0 7px 16px rgba(15,23,42,.22),
    0 0 0 2px color-mix(in oklab, var(--fires-color, #ef4444) 22%, transparent),
    inset 0 -3px 7px rgba(15,23,42,.10) !important;
  opacity: .92 !important;
}

.jd-fires-map-marker::before {
  content: "🔥";
  color: #fff !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  font-size: 12px !important;
  text-shadow: 0 1px 4px rgba(15,23,42,.36) !important;
  transform: translateY(-1px) !important;
}

.jd-fires-map-marker.forestal::before {
  content: "▲";
  font-size: 13px !important;
}

.jd-fires-map-marker.vegetacio::before {
  content: "●";
  font-size: 15px !important;
}

.jd-fires-map-marker.agricola::before {
  content: "◆";
  font-size: 12px !important;
}

.jd-fires-map-marker.urba::before {
  content: "■";
  font-size: 11px !important;
}

.jd-fires-map-marker.other::before {
  content: "•";
  font-size: 20px !important;
}

.jd-fires-map-marker.station {
  width: 26px !important;
  height: 26px !important;
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,1), rgba(255,255,255,.72) 42%, rgba(255,255,255,.92) 70%),
    #ffffff !important;
  border: 1.5px solid rgba(15,23,42,.82) !important;
  box-shadow:
    0 8px 18px rgba(15,23,42,.22),
    0 0 0 2px rgba(15,23,42,.12),
    inset 0 -3px 7px rgba(15,23,42,.08) !important;
  opacity: .96 !important;
}

.jd-fires-map-marker.station::before {
  content: "⌂" !important;
  color: #111827 !important;
  font-size: 13px !important;
  text-shadow: none !important;
}

:root[data-theme="dark"] .jd-fires-meta-item,
html[data-theme="dark"] .jd-fires-meta-item,
html.dark .jd-fires-meta-item,
body.dark .jd-fires-meta-item,
:root[data-theme="dark"] .jd-fires-control,
html[data-theme="dark"] .jd-fires-control,
html.dark .jd-fires-control,
body.dark .jd-fires-control,
:root[data-theme="dark"] .jd-fires-filter,
html[data-theme="dark"] .jd-fires-filter,
html.dark .jd-fires-filter,
body.dark .jd-fires-filter,
:root[data-theme="dark"] .jd-fires-btn,
html[data-theme="dark"] .jd-fires-btn,
html.dark .jd-fires-btn,
body.dark .jd-fires-btn,
:root[data-theme="dark"] .jd-fires-legend-item,
html[data-theme="dark"] .jd-fires-legend-item,
html.dark .jd-fires-legend-item,
body.dark .jd-fires-legend-item,
:root[data-theme="dark"] .jd-fires-summary,
html[data-theme="dark"] .jd-fires-summary,
html.dark .jd-fires-summary,
body.dark .jd-fires-summary,
:root[data-theme="dark"] .jd-fires-disclaimer,
html[data-theme="dark"] .jd-fires-disclaimer,
html.dark .jd-fires-disclaimer,
body.dark .jd-fires-disclaimer,
:root[data-theme="dark"] .jd-fires-card,
html[data-theme="dark"] .jd-fires-card,
html.dark .jd-fires-card,
body.dark .jd-fires-card,
:root[data-theme="dark"] .jd-fires-empty,
html[data-theme="dark"] .jd-fires-empty,
html.dark .jd-fires-empty,
body.dark .jd-fires-empty,
:root[data-theme="dark"] .jd-fires-badge,
html[data-theme="dark"] .jd-fires-badge,
html.dark .jd-fires-badge,
body.dark .jd-fires-badge,
:root[data-theme="dark"] .jd-fires-map,
html[data-theme="dark"] .jd-fires-map,
html.dark .jd-fires-map,
body.dark .jd-fires-map {
  border-color: rgba(255,255,255,.10);
}

:root[data-theme="dark"] .jd-fires-filter,
html[data-theme="dark"] .jd-fires-filter,
html.dark .jd-fires-filter,
body.dark .jd-fires-filter,
:root[data-theme="dark"] .jd-fires-btn,
html[data-theme="dark"] .jd-fires-btn,
html.dark .jd-fires-btn,
body.dark .jd-fires-btn,
:root[data-theme="dark"] .jd-fires-control,
html[data-theme="dark"] .jd-fires-control,
html.dark .jd-fires-control,
body.dark .jd-fires-control {
  background: rgba(255,255,255,.05);
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .jd-fires-meta-item,
  :root:not([data-theme]) .jd-fires-control,
  :root:not([data-theme]) .jd-fires-filter,
  :root:not([data-theme]) .jd-fires-btn,
  :root:not([data-theme]) .jd-fires-legend-item,
  :root:not([data-theme]) .jd-fires-summary,
  :root:not([data-theme]) .jd-fires-disclaimer,
  :root:not([data-theme]) .jd-fires-card,
  :root:not([data-theme]) .jd-fires-empty,
  :root:not([data-theme]) .jd-fires-badge,
  :root:not([data-theme]) .jd-fires-map {
    border-color: rgba(255,255,255,.10);
  }

  :root:not([data-theme]) .jd-fires-filter,
  :root:not([data-theme]) .jd-fires-btn,
  :root:not([data-theme]) .jd-fires-control {
    background: rgba(255,255,255,.05);
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  .jd-fires-list {
    grid-template-columns: 1fr;
  }

  .jd-fires-map {
    height: 430px;
  }
}

@media (max-width: 640px) {
  .jd-fires-module {
    padding: 14px;
  }

  .jd-fires-map {
    height: 360px;
    border-radius: 18px;
  }

  .jd-fires-toolbar {
    align-items: stretch;
  }

  .jd-fires-control,
  .jd-fires-btn {
    width: 100%;
    justify-content: space-between;
  }

  .jd-fires-filters {
    width: 100%;
  }

  .jd-fires-filter {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .jd-fires-map-marker {
    width: 22px !important;
    height: 22px !important;
  }

  .jd-fires-map-marker.station {
    width: 24px !important;
    height: 24px !important;
  }
}

/* =========================================================
   Fires v2 — iconos SVG específicos por tipo
   Forestal / Vegetació / Agrícola / Urbà / Altres
   ========================================================= */

.jd-fires-map-marker{
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}

.jd-fires-map-marker::before{
  content: "" !important;
  display: none !important;
}

.jd-fires-map-marker .jd-fires-icon-svg{
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  color: #fff !important;
  filter:
    drop-shadow(0 1px 1px rgba(15,23,42,.35))
    drop-shadow(0 0 4px rgba(15,23,42,.22)) !important;
}

.jd-fires-map-marker .jd-fire-flame{
  fill: color-mix(in oklab, var(--fires-color, #ef4444) 82%, #ffffff 18%) !important;
  stroke: rgba(255,255,255,.72) !important;
  stroke-width: .75 !important;
}

.jd-fires-map-marker.station{
  width: 34px !important;
  height: 34px !important;
}

.jd-fires-map-marker.station .jd-fires-icon-svg{
  width: 21px !important;
  height: 21px !important;
  color: #111827 !important;
  filter: none !important;
}

.jd-fires-map-marker.station .jd-fire-flame{
  display: none !important;
}

.jd-fires-legend-icon{
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.96), rgba(255,255,255,.30) 34%, transparent 60%),
    var(--fires-color, #ef4444);
  border: 1.4px solid rgba(255,255,255,.92);
  box-shadow:
    0 3px 9px rgba(15,23,42,.16),
    0 0 0 2px color-mix(in oklab, var(--fires-color, #ef4444) 16%, transparent);
}

.jd-fires-legend-icon .jd-fires-icon-svg{
  width: 17px;
  height: 17px;
  color: #fff;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(15,23,42,.28));
}

.jd-fires-legend-icon .jd-fire-flame{
  fill: color-mix(in oklab, var(--fires-color, #ef4444) 82%, #ffffff 18%);
  stroke: rgba(255,255,255,.72);
  stroke-width: .75;
}

@media (max-width: 640px){
  .jd-fires-map-marker{
    width: 28px !important;
    height: 28px !important;
  }

  .jd-fires-map-marker .jd-fires-icon-svg{
    width: 20px !important;
    height: 20px !important;
  }

  .jd-fires-map-marker.station{
    width: 32px !important;
    height: 32px !important;
  }
}

/* =========================================================
   Fires v2.1 — iconos limpios
   - Quitamos la llama de fondo en forestal/vegetació/agrícola/urbà
   - El color del marcador ya indica incendio/tipo
   - Dejamos llama solo en "Altres"
   ========================================================= */

.jd-fires-map-marker.forestal .jd-fire-flame,
.jd-fires-map-marker.vegetacio .jd-fire-flame,
.jd-fires-map-marker.agricola .jd-fire-flame,
.jd-fires-map-marker.urba .jd-fire-flame,
.jd-fires-legend-icon.forestal .jd-fire-flame,
.jd-fires-legend-icon.vegetacio .jd-fire-flame,
.jd-fires-legend-icon.agricola .jd-fire-flame,
.jd-fires-legend-icon.urba .jd-fire-flame{
  display: none !important;
}

/* Icono principal más grande y mejor centrado */
.jd-fires-map-marker.forestal .jd-fires-icon-svg,
.jd-fires-map-marker.vegetacio .jd-fires-icon-svg,
.jd-fires-map-marker.agricola .jd-fires-icon-svg,
.jd-fires-map-marker.urba .jd-fires-icon-svg{
  width: 21px !important;
  height: 21px !important;
  color: #ffffff !important;
  transform: translateY(0) !important;
  filter:
    drop-shadow(0 1px 1px rgba(15,23,42,.46))
    drop-shadow(0 0 4px rgba(15,23,42,.24)) !important;
}

/* Altres mantiene icono de llama, pero limpio */
.jd-fires-map-marker.other .jd-fires-icon-svg{
  width: 20px !important;
  height: 20px !important;
}

/* Leyenda: mismo criterio, sin doble símbolo */
.jd-fires-legend-icon.forestal .jd-fires-icon-svg,
.jd-fires-legend-icon.vegetacio .jd-fires-icon-svg,
.jd-fires-legend-icon.agricola .jd-fires-icon-svg,
.jd-fires-legend-icon.urba .jd-fires-icon-svg{
  width: 16px !important;
  height: 16px !important;
  color: #ffffff !important;
}

/* Un poquito más de contraste interior */
.jd-fires-map-marker{
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.95), rgba(255,255,255,.24) 30%, transparent 58%),
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--fires-color, #ef4444) 88%, #ffffff 12%),
      color-mix(in oklab, var(--fires-color, #ef4444) 92%, #111827 8%)
    ) !important;
}

/* Leyenda igual que marcador */
.jd-fires-legend-icon{
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.95), rgba(255,255,255,.24) 30%, transparent 58%),
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--fires-color, #ef4444) 88%, #ffffff 12%),
      color-mix(in oklab, var(--fires-color, #ef4444) 92%, #111827 8%)
    ) !important;
}

@media (max-width: 640px){
  .jd-fires-map-marker.forestal .jd-fires-icon-svg,
  .jd-fires-map-marker.vegetacio .jd-fires-icon-svg,
  .jd-fires-map-marker.agricola .jd-fires-icon-svg,
  .jd-fires-map-marker.urba .jd-fires-icon-svg{
    width: 19px !important;
    height: 19px !important;
  }
}
