/* ==========================================================
   KC METEO — WINDY UI v1
   ========================================================== */

:root {
  --kc-bg: #07141c;
  --kc-panel: rgba(6,21,29,.88);
  --kc-panel-solid: #091b24;
  --kc-border: rgba(255,255,255,.14);
  --kc-text: #f2f8fa;
  --kc-muted: #9db1b9;
  --kc-accent: #48d3a0;
}


html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}


body.windy-ui {
  overflow: hidden;
  background: #091820;
  color: var(--kc-text);
}


/* HEADER */

.windy-header {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;

  height: 52px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 16px;

  background: rgba(5,18,25,.94);

  border-bottom:
    1px solid rgba(255,255,255,.10);

  z-index: 5000;
}


.windy-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}


.windy-brand-mark {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background:
    linear-gradient(
      135deg,
      #48d3a0,
      #52a8ff
    );

  color: #041116;

  font-weight: 900;
  font-size: 12px;
}


.windy-brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: .08em;
}


.windy-brand span {
  display: block;

  margin-top: 1px;

  color: var(--kc-muted);

  font-size: 8px;
}


.windy-source {
  display: flex;
  align-items: center;

  gap: 9px;

  color: var(--kc-muted);

  font-size: 8px;
}


/* MAPA */

.windy-main {
  position: fixed;

  left: 0;
  right: 0;
  top: 52px;
  bottom: 0;

  overflow: hidden;
}


.windy-ui #weatherMap {
  position: absolute !important;

  inset: 0 !important;

  width: 100% !important;
  height: 100% !important;

  min-height: 0 !important;

  z-index: 1;
}


/* CONTROLES SUPERIORES */

.windy-controls {
  position: absolute;

  left: 16px;
  top: 14px;

  z-index: 900;

  display: flex;

  gap: 6px;

  padding: 6px;

  border:
    1px solid var(--kc-border);

  border-radius: 10px;

  background:
    rgba(5,20,28,.91);

  box-shadow:
    0 5px 18px rgba(0,0,0,.25);
}


.windy-control {
  width: 165px;
}


.windy-control:nth-child(3) {
  width: 215px;
}


.windy-control label {
  display: block;

  margin-bottom: 2px;

  color: var(--kc-muted);

  font-size: 7px;

  text-transform: uppercase;
  letter-spacing: .08em;
}


.windy-control select,
.windy-flyout select {
  width: 100%;

  height: 28px;
  min-height: 28px;

  padding: 0 7px;

  border:
    1px solid rgba(255,255,255,.12);

  border-radius: 5px;

  background: #071820;
  color: #f2f8fa;

  font-size: 10px;
}


/* TITULO */

.windy-layer-title {
  position: absolute;

  left: 18px;
  top: 78px;

  z-index: 850;

  padding: 6px 9px;

  border-radius: 8px;

  background:
    rgba(5,20,28,.72);

  backdrop-filter:
    blur(5px);

  pointer-events: none;
}


.windy-layer-title span {
  display: block;

  color: var(--kc-accent);

  font-size: 7px;
  font-weight: 800;

  letter-spacing: .1em;
}


.windy-layer-title strong {
  display: block;

  margin-top: 1px;

  font-size: 13px;
}


.windy-layer-title small {
  display: block;

  margin-top: 2px;

  color: var(--kc-muted);

  font-size: 8px;
}


/* SELECTOR DE CAPAS */

.windy-layer-stack {
  position: absolute;

  right: 17px;
  top: 75px;

  z-index: 1000;

  display: flex;
  flex-direction: column;

  align-items: flex-end;

  gap: 5px;
}


.wx-tool,
.windy-tool-secondary {
  width: 86px;
  min-height: 48px;

  display: grid;

  grid-template-columns:
    30px 1fr;

  align-items: center;

  padding: 5px 7px;

  border:
    1px solid rgba(255,255,255,.13);

  border-radius: 25px;

  background:
    rgba(5,20,28,.88);

  color: #f3f9fa;

  box-shadow:
    0 3px 13px rgba(0,0,0,.24);

  cursor: pointer;
}


.wx-tool b,
.windy-tool-secondary b {
  font-size: 16px;
  text-align: center;
}


.wx-tool span,
.windy-tool-secondary span {
  font-size: 8px;
}


.wx-tool:hover,
.windy-tool-secondary:hover {
  background:
    rgba(18,52,65,.95);
}


.wx-tool.active {
  border-color:
    rgba(72,211,160,.92);

  background:
    rgba(17,92,75,.93);
}


.windy-stack-separator {
  width: 55px;
  height: 1px;

  margin: 3px 8px;

  background:
    rgba(255,255,255,.15);
}


/* FLYOUT */

.windy-flyout {
  position: absolute;

  right: 112px;
  top: 344px;

  z-index: 1200;

  width: 210px;

  padding: 12px;

  border:
    1px solid var(--kc-border);

  border-radius: 10px;

  background:
    rgba(5,20,28,.96);

  box-shadow:
    0 12px 30px rgba(0,0,0,.35);
}


.windy-flyout strong {
  display: block;

  margin-bottom: 8px;

  font-size: 11px;
}


/* DRAWER */

.windy-drawer {
  position: absolute;

  right: 0;
  top: 0;
  bottom: 76px;

  width: 370px;

  z-index: 1800;

  display: grid;

  grid-template-rows:
    56px
    minmax(0,1fr)
    190px;

  background:
    rgba(6,21,29,.98);

  border-left:
    1px solid var(--kc-border);

  box-shadow:
    -18px 0 42px rgba(0,0,0,.35);
}


.windy-drawer > header,
.windy-picker > header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 8px 12px;

  border-bottom:
    1px solid var(--kc-border);
}


.windy-drawer header small,
.windy-picker header small {
  color: var(--kc-accent);

  font-size: 7px;

  text-transform: uppercase;
  letter-spacing: .1em;
}


.windy-drawer h2,
.windy-picker h2 {
  margin: 2px 0 0;

  font-size: 14px;
}


.windy-drawer button,
.windy-picker header button {
  width: 30px;
  height: 30px;

  border:
    1px solid var(--kc-border);

  border-radius: 50%;

  background:
    rgba(255,255,255,.06);

  color: white;

  font-size: 18px;

  cursor: pointer;
}


.windy-ranking-table {
  overflow: auto;
}


.windy-ranking-table table {
  font-size: 9px;
}


.windy-ranking-table th,
.windy-ranking-table td {
  padding: 7px 6px;
}


.windy-quality {
  padding: 8px;

  border-top:
    1px solid var(--kc-border);

  overflow: auto;
}


.windy-quality > small {
  display: block;

  margin-bottom: 6px;

  color: var(--kc-accent);

  font-size: 7px;

  text-transform: uppercase;
}


.windy-quality #qualityContent {
  padding: 0;

  font-size: 8px;
}


/* PICKER */

.windy-picker {
  position: absolute;

  left: 20px;
  bottom: 92px;

  z-index: 1700;

  width: 410px;

  max-height: 55vh;

  display: grid;

  grid-template-rows:
    52px
    minmax(0,1fr);

  overflow: hidden;

  border:
    1px solid rgba(255,255,255,.15);

  border-radius: 12px;

  background:
    rgba(5,20,28,.96);

  box-shadow:
    0 16px 44px rgba(0,0,0,.42);

  backdrop-filter:
    blur(7px);
}


.windy-picker .site-detail-body {
  padding: 10px;

  overflow: auto;
}


.windy-picker .site-day-grid {
  grid-template-columns: 1fr;
}


/* TIMELINE */

.windy-timeline {
  position: absolute;

  left: 16px;
  right: 16px;
  bottom: 10px;

  z-index: 1600;

  height: 62px;

  display: grid;

  grid-template-columns:
    48px
    minmax(0,1fr);

  gap: 8px;

  padding: 6px;

  border:
    1px solid rgba(255,255,255,.16);

  border-radius: 12px;

  background:
    rgba(5,20,28,.92);

  box-shadow:
    0 8px 24px rgba(0,0,0,.30);

  backdrop-filter:
    blur(7px);
}


.timeline-play {
  border: 0;

  border-radius: 50%;

  background:
    #f5f8f9;

  color: #16252b;

  font-size: 16px;

  cursor: pointer;
}


.timeline-content {
  min-width: 0;

  display: grid;

  grid-template-rows:
    17px
    1fr;
}


.timeline-days {
  display: grid;
  grid-template-columns:
    repeat(3, 1fr);

  color: var(--kc-muted);

  font-size: 8px;

  text-align: center;
}


.timeline-day.active {
  color: white;
  font-weight: 800;
}


.timeline-track {
  display: grid;

  grid-template-columns:
    repeat(12, minmax(48px,1fr));

  gap: 2px;
}


.timeline-slot {
  border: 0;

  border-radius: 4px;

  background:
    rgba(255,255,255,.055);

  color: #bbcbd1;

  font-size: 8px;

  cursor: pointer;
}


.timeline-slot:hover {
  background:
    rgba(255,255,255,.13);
}


.timeline-slot.active {
  background:
    #f2a91e;

  color: #1d1b15;

  font-weight: 900;
}


/* LEAFLET */

.windy-ui .leaflet-control-zoom {
  margin-left: 17px;
  margin-top: 130px;
}


.windy-ui .leaflet-control-scale {
  margin-bottom: 82px;
}


.windy-ui .leaflet-control-attribution {
  margin-bottom: 70px !important;

  font-size: 7px !important;
}


/* UTILES */

.windy-hidden {
  position: absolute !important;

  left: -99999px !important;

  width: 1px !important;
  height: 1px !important;

  opacity: 0 !important;

  pointer-events: none !important;
}


.hidden {
  display: none !important;
}


/* MOVIL */

@media (max-width: 900px) {

  .windy-controls {
    right: 110px;

    overflow-x: auto;
  }


  .windy-control {
    min-width: 130px;
  }


  .windy-layer-stack {
    top: 120px;
  }


  .wx-tool,
  .windy-tool-secondary {
    width: 48px;

    grid-template-columns: 1fr;
  }


  .wx-tool span,
  .windy-tool-secondary span {
    display: none;
  }


  .windy-picker {
    width:
      calc(100% - 40px);
  }


  .windy-drawer {
    width:
      min(360px, 90vw);
  }

}

/* ==========================================================
   KC METEO — WINDY UI v1.1
   AUXILIARY TOOLS + TIMELINE FIX
   ========================================================== */


/* ----------------------------------------------------------
   1. VARIABLES METEOROLÓGICAS
   Solo las cinco capas meteorológicas.
   ---------------------------------------------------------- */

.windy-layer-stack {
  right: 17px;
  top: 82px;

  gap: 6px;
}


/* ----------------------------------------------------------
   2. CAPAS / SITIOS
   Controles independientes arriba a la derecha.
   ---------------------------------------------------------- */

.windy-secondary-tools {
  position: absolute;

  right: 17px;
  top: 14px;

  z-index: 1100;

  display: flex;
  align-items: center;

  gap: 6px;
}


.windy-secondary-tools
.windy-tool-secondary {
  width: 90px;
  height: 44px;
  min-height: 44px;

  display: grid;

  grid-template-columns:
    27px
    1fr;

  align-items: center;

  padding:
    5px
    8px;

  border:
    1px solid
    rgba(255,255,255,.16);

  border-radius: 10px;

  background:
    rgba(5,20,28,.93);

  color: #f3f9fa;

  box-shadow:
    0 4px 14px
    rgba(0,0,0,.27);

  cursor: pointer;
}


.windy-secondary-tools
.windy-tool-secondary:hover {
  background:
    rgba(18,52,65,.97);

  border-color:
    rgba(72,211,160,.50);
}


.windy-secondary-tools
.windy-tool-secondary b {
  font-size: 17px;

  text-align: center;

  line-height: 1;
}


.windy-secondary-tools
.windy-tool-secondary span {
  font-size: 9px;

  font-weight: 700;

  text-align: left;
}


/* ----------------------------------------------------------
   3. PANEL DE CAPAS
   Ahora nace debajo de los botones auxiliares.
   ---------------------------------------------------------- */

.windy-flyout {
  right: 17px;
  top: 66px;

  width: 220px;
}


/* ----------------------------------------------------------
   4. TIMELINE
   Subirla, darle altura real y asegurar que se vean
   los períodos.
   ---------------------------------------------------------- */

.windy-timeline {
  left: 20px;
  right: 20px;

  bottom: 24px;

  height: 86px;

  grid-template-columns:
    54px
    minmax(0,1fr);

  gap: 10px;

  padding: 8px;

  z-index: 2200;

  border:
    1px solid
    rgba(255,255,255,.20);

  background:
    rgba(5,20,28,.94);

  box-shadow:
    0 8px 28px
    rgba(0,0,0,.38);
}


.timeline-play {
  width: 48px;
  height: 48px;

  align-self: center;
  justify-self: center;

  padding: 0;

  display: grid;
  place-items: center;

  border-radius: 50%;

  font-size: 17px;
}


.timeline-content {
  min-width: 0;
  min-height: 0;

  display: grid;

  grid-template-rows:
    20px
    42px;

  gap: 4px;
}


.timeline-days {
  min-height: 20px;

  display: grid;

  grid-template-columns:
    repeat(3,1fr);

  align-items: center;

  font-size: 9px;
}


.timeline-day {
  padding: 2px 6px;

  border-right:
    1px solid
    rgba(255,255,255,.08);
}


.timeline-day:last-child {
  border-right: 0;
}


.timeline-track {
  min-width: 0;
  min-height: 42px;

  display: grid;

  grid-template-columns:
    repeat(
      12,
      minmax(62px,1fr)
    );

  gap: 3px;

  overflow-x: auto;
  overflow-y: hidden;

  scrollbar-width: thin;
}


.timeline-slot {
  min-height: 37px;

  padding:
    0
    5px;

  border:
    1px solid
    rgba(255,255,255,.06);

  border-radius: 5px;

  background:
    rgba(255,255,255,.065);

  color: #c9d7dc;

  font-size: 8px;

  white-space: nowrap;
}


.timeline-slot.active {
  background: #f2a91e;

  border-color:
    rgba(255,255,255,.30);

  color: #1c1a14;

  font-weight: 900;
}


/* ----------------------------------------------------------
   5. LIBERAR ESPACIO PARA TIMELINE
   ---------------------------------------------------------- */

.windy-ui
.leaflet-control-scale {
  margin-bottom:
    120px !important;
}


.windy-ui
.leaflet-control-attribution {
  margin-bottom:
    108px !important;
}


/* picker no debe tapar timeline */

.windy-picker {
  bottom: 126px;
}


/* drawer lateral tampoco */

.windy-drawer {
  bottom: 122px;
}


/* ----------------------------------------------------------
   6. MOBILE / TABLET
   ---------------------------------------------------------- */

@media (max-width: 900px) {

  .windy-secondary-tools {
    right: 12px;
    top: 12px;
  }


  .windy-secondary-tools
  .windy-tool-secondary {
    width: 46px;

    grid-template-columns: 1fr;
  }


  .windy-secondary-tools
  .windy-tool-secondary span {
    display: none;
  }


  .windy-layer-stack {
    top: 76px;
  }


  .windy-timeline {
    left: 10px;
    right: 10px;

    bottom: 12px;

    height: 82px;
  }

}



/* ==========================================================
   KC METEO — WINDY UI v1.2
   Ajuste vertical de timeline
   ========================================================== */

.windy-timeline {
  bottom: 46px !important;
}


/* Mantener controles Leaflet por encima de la timeline */

.windy-ui .leaflet-control-scale {
  margin-bottom: 142px !important;
}

.windy-ui .leaflet-control-attribution {
  margin-bottom: 130px !important;
}


/* Picker y drawer tampoco deben invadir la timeline */

.windy-picker {
  bottom: 150px !important;
}

.windy-drawer {
  bottom: 146px !important;
}


/* En pantallas pequeñas subirla proporcionalmente */

@media (max-width: 900px) {

  .windy-timeline {
    bottom: 32px !important;
  }

}
