:root {
  --bg: #0264A8;
  --bg-panel: #0264A8;
  --line: #ffffff;
  --dot: #045288;
  --lime: #54dd4a;
  --olive: #03379d;
  --lavender: #4b5767;
  --lime-dim: #0264A8;
  --olive-dim: #0264A8;
  --lavender-dim: #0264A8;
  --text: #f4f2e8;
  --text-dim: #a9b3c9;
  --panel-border: rgba(243, 245, 231, 0.55);
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.hero {
  border-bottom: 1px solid rgba(199, 214, 84, 0.25);
  padding-bottom: 22px;
  margin-bottom: 26px;
}
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--lime);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(199, 230, 74, 0.2);
}

.sub {
  font-size: 15px;
  color: var(--text-dim);
  margin: 0;
  max-width: 520px;
}

.main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
  margin-top: 22px;
}
@media (max-width: 860px) {
  .main {
    grid-template-columns: 1fr;
  }
}

.map-wrap {
  position: relative;
  padding: 8px;
}
#map {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
}
#map:active {
  cursor: grabbing;
}

.state {
  stroke: var(--line);
  stroke-width: 0.7;
  fill: var(--bg);
  transition: fill 0.3s ease, opacity 0.25s ease;
}
.state.status-past {
  fill: var(--olive);
}
.state.status-today {
  fill: var(--lime);
}
.state.status-future {
  fill: var(--lavender);
}
.state.status-past.muted {
  fill: var(--olive-dim);
}
.state.status-today.muted {
  fill: var(--lime-dim);
}
.state.status-future.muted {
  fill: var(--lavender-dim);
}

/* puntito decorativo en cada estado */
.state-dot {
  fill: var(--dot);
  opacity: 0.85;
}
.state-dot.on-bright {
  stroke: #0c1c3a;
  stroke-width: 0.6;
}

/* --- pines de lugares (clicables) --- */

.pin {
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.15s ease;
  
}
.pin.muted {
  opacity: 0.15;
  pointer-events: none;
}

/* El círculo del pin. "filter: drop-shadow(...)" es el equivalente
     de box-shadow para formas SVG (box-shadow normal no aplica aquí)
     — ajusta sus 4 valores igual que harías con un box-shadow:
     offset-x  offset-y  blur  color */
.pin-circle {
  fill: #ffffff;
  filter: drop-shadow(0 1px 5px rgba(0, 0, 0,.5));
  transition: filter 0.15s ease;
  -webkit-animation: an-blink-lamp 1.5s 0.2s linear infinite;
  -moz-animation: an-blink-lamp 1.5s 0.2s linear infinite;
  -o-animation: an-blink-lamp 1.5s 0.2s linear infinite;
  animation: an-blink-lamp 1.5s 0.2s linear infinite;
}

@keyframes an-blink-lamp {
  50% {
    opacity: 0.2;
  }
  75% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}
.pin:hover .pin-circle {
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0))
    drop-shadow(0 0 6px rgba(255, 255, 255, 0));
}


/* --- controles de zoom --- */
.zoom-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}
.zoom-controls button {
  width: 32px;
  height: 32px;
  background: rgba(12, 28, 58, 0.9);
  border: 1.5px solid var(--panel-border);
  border-radius: 7px;
  color: var(--text);
  font-size: 16px;
  font-family: "IBM Plex Mono", monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.zoom-controls button:hover {
  background: rgba(199, 214, 84, 0.18);
}
.zoom-controls button:active {
  transform: scale(0.92);
}
#zoom-reset {
  font-size: 14px;
}

/* --- popup de detalle (clic en un pin) --- */
.popup {
  position: absolute;
  transform: translate(-50%, -112%);
  background: #fff;
  color: var(--bg);
  width: 270px;
  max-width: 80vw;

  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  padding: 12px;
  display: flex;
  gap: 10px;
  z-index: 10;
  transition: opacity 0.12s ease;
  border-radius: 4px;
}
.popup.hidden {
  opacity: 0;
  pointer-events: none;
}
.popup-photo-wrap {
  flex: none;
  width: 64px;
  height: 64px;
  overflow: hidden;
    border-radius: 4px;
}
.popup-photo-wrap.hidden {
  display: none;
}
.popup-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

}
.popup-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.popup-state {  
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bg);
  margin: 0;
}
.popup-title {
  font-size: 17px;
  line-height: 1.25;
  color: #000;
  font-family: "Bebas Neue", sans-serif;
}
.popup-place {
 
  font-size: 13px;
  color: #6a7c9c;
}
.popup-date {
  font-size: 11px;
  color: #8fac1a;
}
.popup-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #6b7280;
  padding: 2px 4px;
}
.popup-close:hover {
  color: var(--bg);
}

/* Panel de leyenda / filtros con checkboxes, estilo del mockup */
.legend-panel {
  position: absolute;
  left: 0px;
  bottom: 0px;
  background: rgba(2, 99, 168, 0.4);
  border: 1px solid #fff;
  border-radius: 10px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 230px;
  backdrop-filter: blur(4px); 
  -webkit-backdrop-filter: blur(4px); /* For Safari support */
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.legend-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: none;
  border: 1.5px solid rgba(244, 242, 232, 0.35);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.swatch-today {
  background: var(--lime);
}
.swatch-past {
  background: var(--olive);
}
.swatch-future {
  background: var(--lavender);
}
.legend-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.legend-text {
  font-size: 13px;
  letter-spacing: 0.03em;
}
.legend-bar {
  height: 3px;
  border-radius: 2px;
  width: 100%;
}
.legend-bar-today {
  background: var(--lime);
}
.legend-bar-past {
  background: var(--olive);
}
.legend-bar-future {
  background: var(--lavender);
}
.legend-row.unchecked .swatch {
  opacity: 0.25;
  filter: grayscale(60%);
}
.legend-row.unchecked .legend-bar {
  opacity: 0.25;
}
.legend-row.unchecked .legend-text {
  color: var(--text-dim);
}
.legend-row:focus-within {
  outline: 1px solid #fff;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Sidebar itinerario */
.itinerary {
  background: var(--bg-panel);
  border: 1px solid rgba(199, 214, 84, 0.25);
  padding: 16px 16px 8px;
}
.itinerary h2 {
  font-family: "Oswald", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(199, 214, 84, 0.25);
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.itinerary h2.second-list-title {
  margin-top: 18px;
}
.itinerary .count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: none;
}
#itinerary-list{
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
#upcoming-list {
 margin: 0;
}
.it-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(199, 214, 84, 0.12);
  cursor: default;
  transition: background 0.15s ease, opacity 0.2s ease;
}
.it-item:last-child {
  border-bottom: none;
}
.it-item:hover {
  background: rgba(199, 214, 84, 0.06);
}
.it-item.muted {
  opacity: 0.3;
}
.it-empty {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 10px 4px;
}
.it-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex: none;
}
.it-item.status-past .it-dot {
  background: var(--olive);
}
.it-item.status-today .it-dot {
  background: var(--lime);
}
.it-item.status-future .it-dot {
  background: var(--lavender);
}
.it-city {
  font-size: 13.5px;
  font-weight: 500;
}
.it-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-top: 1px;
}

/* Bitácora: formato reducido — solo estado, ciudad y título */
h2.titulo .count{
  color: var(--text-dim);
  font-family: "Roboto", sans-serif;
  font-size: 13px;
} 
.bit-item {
  
  padding: 10px 4px;
  border-bottom: 1px solid rgba(199, 214, 84, 0.12);
  transition: background 0.15s ease, opacity 0.2s ease;
}
.bit-item:last-child {
  border-bottom: none;
}
.bit-item:hover {
  background: rgba(199, 214, 84, 0.06);
}
.bit-item.muted {
  opacity: 0.3;
}
.bit-state {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text);
  width: 100px;
  display: block;
}
.bit-item:nth-child(odd){
    background: #004F86;
    color: #fff;
}
.bit-city {
  font-size: 13px;
  color: var(--text-dim);
}
.bit-title {
  font-size: 13px;
  color: #fff;
}

.empty-note {  
  font-size: 12px;
  color: var(--text-dim);
  padding: 20px 4px;
}
.today-direction{
  padding-left: 0;
}
  .today-item{
    display:flex; gap:10px; align-items:flex-start;
    padding: 2px 4px; 
    border-bottom:1px solid rgba(199,214,84,0.12);
    transition:background 0.15s ease, opacity 0.2s ease;
    width: 100%;
    background-color: #fff;
    border-radius: 10px;
    padding: 10px;
    margin-top: 15px;
  }
  .today-item:last-child{ border-bottom:none; }
 
  .today-item.muted{ opacity:0.3; }
  .today-photo{
    flex:none; width:64px; height:64px;
    background-size:cover; background-position:center;
    border:1px solid rgba(199,214,84,0.25);
  }
  .today-photo-empty{ background-color:rgba(199,214,84,0.08); }
  .today-text{ display:flex; flex-direction:column; color: #000; }
  .today-text p{
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-size: 20px;
  }
  .today-date{font-size:11px; color: #777777; margin-top:2px; }
 
  .empty-note{font-size:12px; padding:20px 4px; }
  .bit-state-today{
   font-family: "Bebas Neue", sans-serif; 
    font-weight: 600;
  }
  .bit-city-today{
   font-family: "Bebas Neue", sans-serif;
    font-size: 15px;
  }
  .bit-title-today{
      font-family: "Bebas Neue", sans-serif;
      font-size: 15px;
  }
  .touch-hint{
    display: none;
  }

  /* Próximos 5 días: fila compacta (fecha + ciudad) que se expande al clic */
  #soon-list{
    padding: 0;
    list-style-type: none;
  }
  .soon-item{
    padding:10px 4px; border-bottom:1px solid rgba(199,214,84,0.12);
    cursor:pointer; transition:background 0.15s ease, opacity 0.2s ease;
  }
  .soon-item:last-child{ border-bottom:none; }
  .soon-item:hover{ background:rgba(199,214,84,0.06); }
  .soon-item.muted{ opacity:0.3; }
  .soon-summary{ display:flex; align-items:center; gap:10px; }
  .soon-date{ font-family:'IBM Plex Mono', monospace; font-size:11px; color:var(--text-dim); flex:none; }
  .soon-city{ font-family:'Oswald', sans-serif; font-weight:600; font-size:13.5px; text-transform:uppercase; flex:1; min-width:0; }
  .soon-arrow{ 
    font-size: 30px;
    color: #54dd4a;
    transition: transform 0.2s ease;
    flex: none;
    line-height: 0;
  }
  .soon-item.open .soon-arrow{ transform:rotate(180deg); }
  .soon-details{
    max-height:0; opacity:0; overflow:hidden;
    display:flex; flex-direction:column; gap:2px;
    transition:max-height 0.22s ease, opacity 0.18s ease, margin-top 0.22s ease;
    margin-top:0;
  }
  .soon-item.open .soon-details{ max-height:90px; opacity:1; margin-top:7px; }
  .soon-state{
    font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:0.08em;
    text-transform:uppercase; color:var(--text-dim);
  }
  .soon-title{ font-family:'IBM Plex Sans', sans-serif; font-size:12.5px; }

@media (max-width: 575.98px) {
  .legend-panel {

    margin-top: 14px;
    max-width: none;
  }
  .popup {
    width: 230px;
  }
  .zoom-controls {
    top: 8px;
    right: 8px;
  }
  .touch-hint{
    display: block;
    position:absolute; left:14px; top:14px;
    background:rgb(3, 55, 157);
    border:1px solid var(--panel-border);
    border-radius:6px;
    padding:5px 9px;
    font-size:14px;
    color:#fff;
    pointer-events:none;
    z-index:5;
  }
     #map{
        height: 600px;
    }
    .map-wrap{
        height: 600px;
    }
    .zoom-controls button{
      width: 44px;
      height: 44px;
    }
}

