/* ===================================================== */
/* =============== RESET GLOBAL MAP =================== */
/* ===================================================== */

html,
body {
    max-width: none !important;
    margin: 0;
    background: transparent !important;
}

/* ===================================================== */
/* ================= MAP CONTAINER ===================== */
/* ===================================================== */

.map-frame {
    position: relative;
    height: 800px;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
}

/* Separación controles Leaflet */
.leaflet-top,
.leaflet-bottom {
    margin: 1.5rem;
}

/* ===================================================== */
/* =========== NEUTRALIZAR POPUP LEAFLET =============== */
/* ===================================================== */

.leaflet-popup-content {
    margin: 0 !important;
}

.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.leaflet-popup-tip {
    display: none !important;
}

/* ===================================================== */
/* ================= AQI TOOLTIP ======================= */
/* ===================================================== */

.aqi-tooltip {
    position: relative;
    width: 350px;                /* tamaño fijo */
    max-width: 350px;
    background: white;
    border: 6px solid black;
    border-radius: 20px;
    padding: 1.2rem 1.5rem;
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
}

/* ---------- Title ---------- */

.aqi-tooltip-title {
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 0.6rem;
}

/* ---------- Table ---------- */

.aqi-tooltip-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 0.2rem;
}

.p-row {
    display: contents;
}

.p-row.header span {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.col-pol {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.col-aqi {
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-val {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.aqi-icon-tooltip {
    width: 2rem;
}

/* ===================================================== */
/* ============ TOOLTIP ARROW (BORDERED) ================ */
/* ===================================================== */

/* Posición común */
.aqi-tooltip-arrow-black,
.aqi-tooltip-arrow-white {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Borde negro */
.aqi-tooltip-arrow-black {
    bottom: -12px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid black;
    z-index: 10;
}

/* Relleno blanco */
.aqi-tooltip-arrow-white {
    bottom: -10px;
    width: 0;
    /*height: 0;*/
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
    z-index: 11;
}

/* ===================================================== */
/* =============== LEAFLET CONTROLS ==================== */
/* ===================================================== */

.leaflet-touch .leaflet-control-layers-toggle {
    width: 28px;
    height: 28px;
}

.leaflet-touch .leaflet-bar a {
    width: 28px;
    height: 28px;
    line-height: 28px;
}

/* ===================================================== */
/* ================= CLUSTERS ========================== */
/* ===================================================== */

.aqi-cluster-wrapper {
    background: transparent;
}

.aqi-cluster {
    position: relative;
    width: 52px;
    height: 100px;
}

.aqi-cluster-icon {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 48px;
}

.aqi-cluster-count {
    position: absolute;
    bottom: 5px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: white;
    border: 3px solid black;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.aqi-cluster-tooltip {
  background: white;
  border: 3px solid black;
  border-radius: 20px;
  padding: 0.3rem 0.6rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  color: black;
  box-shadow: none;
  text-transform: uppercase;
}
.aqi-cluster-tooltip::before,
.aqi-cluster-tooltip::after {
  display: none !important;
}
.aqi-marker-wrapper { background: transparent; }

.aqi-marker {
  position: relative;
  width: 48px;
  height: 48px;
}

.aqi-marker-base {
  width: 48px;
  height: 48px;
}

.aqi-marker-team {
  position: absolute;
  top: -52px;
  left: 0;
  width: 52px;
  height: 52px;
  z-index: 2;
}
.aqi-marker-tooltip {
  background: white;
  border: 3px solid black;
  border-radius: 20px;
  padding: 0.3rem 0.6rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  color: black;
  box-shadow: none;
  text-transform: uppercase;
}
.aqi-marker-tooltip::before,
.aqi-marker-tooltip::after{
  display: none !important;
}
.aqi-simple-tooltip {
  background: white;
  /*border: 4px solid black;
  padding: 0.45rem 0.75rem;*/
  text-align: center;
  font-family: "Poppins", sans-serif;
  line-height: 1.1;
}

.aqi-simple-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aqi-simple-title-current {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aqi-simple-title-aqi {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aqi-simple-value {
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 0.15rem;
}
.aqi-tooltip-empty {
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 0.15rem;
  text-align: center;
  font-family: "Poppins", sans-serif;
  line-height: 1.1;
}
.aqi-cluster-team-icons {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 3px;
  z-index: 3;
}

.aqi-cluster-team-icon {
  width: 52px;
  height: 52px;
}

/* ===== COLORES EXACTOS DE LOS SVG ===== */

.aqi-lvl--1 .aqi-simple-value { color: rgb(209, 209, 209); }
.aqi-lvl-0 .aqi-simple-value { color: #2ed8d8; } /* good */
.aqi-lvl-1 .aqi-simple-value { color: #50858b; } /* fair */
.aqi-lvl-2 .aqi-simple-value { color: #f2edb2; } /* moderate */
.aqi-lvl-3 .aqi-simple-value { color: #ef6155; } /* poor */
.aqi-lvl-4 .aqi-simple-value { color: #8b2c35; } /* very poor */
.aqi-lvl-5 .aqi-simple-value { color: #5b35c4; } /* extremely poor */

.aqi-marker-team,
.aqi-cluster-team-icon {
  object-fit: contain;
}

/* ===================================================== */
/* ============ Etiqueta Current AQI =================== */
/* ===================================================== */
.aqi-label-control {
  display: flex;
  align-items: center;
  gap: 8px;

  background: white;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  border: 8px solid black;
  border-radius: 20px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  margin-bottom: 5px
}

.aqi-live-dot {
    width: 10px;
    height: 10px;
    background-color: #e53935;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(229, 57, 53, 0.8);
    animation: pulseFade 1.5s ease-in-out infinite;
}

@keyframes pulseFade {
    0%   { opacity: 1; }
    50%  { opacity: 0.2; }
    100% { opacity: 1; }
}

/* ===================================================== */
/* =============== Icono Zoom out ====================== */
/* ===================================================== */
.reset-map-view-btn {
  
}

/* ===================================================== */
/* ================= RESPONSIVE ======================== */
/* ===================================================== */

@media (max-width: 1024px) {
    .aqi-tooltip {
        width: 32vw;
        max-width: 32vw;
    }
}

@media (max-width: 768px) {
    .aqi-tooltip {
        width: 80vw;
        max-width: 80vw;
    }
}
