/* =============================================================================
   Mapa de fiestas con barra de tiempo (app-mapa-tiempo.js) y barra superior de
   Explorar.
   Colores: fondo #0b0c0b, lima #d7f26a, texto #f4f6ef, gris #a7b0a8.
   ============================================================================= */

/* --- Campana: el numero va montado abajo a la derecha del icono ------------- */

.topbar-icon-btn {
  position: relative;
}

.topbar-icon-btn .topbar-notif-badge {
  position: absolute;
  top: auto;
  left: auto;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 9px;
  border: 2px solid #0e100e;
  background: #ff4d6d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

/* --- Explorar: buscar, calendario y campana en una sola pastilla ------------ */

body.tt-feed-active[data-main-tab="posts"] .topbar-quick {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 24px;
  background: rgba(14, 16, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.tt-feed-active[data-main-tab="posts"] .topbar-quick .topbar-icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #f4f6ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

body.tt-feed-active[data-main-tab="posts"] .topbar-quick .topbar-icon-btn:hover,
body.tt-feed-active[data-main-tab="posts"] .topbar-quick .topbar-icon-btn:focus-visible {
  background: rgba(244, 246, 239, 0.08);
}

/* --- Ciudad: solo en la pantalla del mapa, en el sitio de las historias ------ */

.topbar-ciudad {
  display: none;
}

body.tt-feed-active.tt-en-mapa[data-main-tab="posts"] #feedGuidedRail {
  display: none;
}

body.tt-feed-active.tt-en-mapa[data-main-tab="posts"] .topbar:not(.is-searching) .topbar-ciudad {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 55%;
  height: 48px;
  margin-right: auto;
  padding: 0 14px 0 13px;
  border: 0;
  border-radius: 24px;
  background: rgba(14, 16, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f4f6ef;
  font: 600 16px/1 "Outfit", system-ui, sans-serif;
  cursor: pointer;
}

.topbar-ciudad > i:first-child {
  color: #d7f26a;
  font-size: 16px;
}

.topbar-ciudad span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-ciudad .topbar-ciudad-flecha {
  color: #8f9a91;
  font-size: 11px;
}

.topbar-ciudad:focus-visible {
  outline: 2px solid #d7f26a;
  outline-offset: 2px;
}

/* --- Fechas: control segmentado a todo lo ancho ----------------------------- */

.tt-parties-map-wrap {
  --mt-top: 72px;
  --mt-abajo: 0px;
}

.mt-tramos {
  position: absolute;
  top: var(--mt-top);
  left: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 24px;
  background: rgba(14, 16, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto !important;
  font-family: "Outfit", system-ui, sans-serif;
}

.mt-tramo {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  min-height: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #f4f6ef;
  font: 600 15px/1 "Outfit", system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.mt-tramo span {
  font-weight: 500;
  opacity: 0.6;
}

.mt-tramo.is-active {
  background: #d7f26a;
  color: #0b0c0b;
}

.mt-tramo:focus-visible {
  outline: 2px solid #d7f26a;
  outline-offset: 2px;
}

/* Con el buscador abierto, sus atajos ocupan esa franja. */
body:has(.topbar.is-searching) .mt-tramos {
  visibility: hidden;
}

/* --- Panel de abajo: tarjeta de la fiesta + barra de tiempo ------------------ */

.mt-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  /* Si suena musica o radio, el panel sube por encima de su barra. En el movil
     el feed ya se encoge y --mt-tapado es 0; en pantallas anchas la barra
     queda encima del mapa y --mt-tapado mide cuanto tapa (app-mapa-tiempo.js). */
  bottom: calc(10px + var(--mt-tapado, 0px));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Outfit", system-ui, sans-serif;
  color: #f4f6ef;
  pointer-events: auto !important;
}

.mt-tarjeta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 18px;
  background: rgba(14, 16, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f4f6ef;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mt-tarjeta.is-vacia {
  cursor: default;
}

.mt-tarjeta.is-vacia .mt-flecha {
  visibility: hidden;
}

.mt-mini {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 12px;
  background: #1c221d;
  color: #d7f26a;
  font-size: 20px;
  display: grid;
  place-items: center;
}

.mt-mini img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mt-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mt-cuando {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  color: #d7f26a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mt-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 8px;
  background: #2c332d;
  color: #d7f26a;
}

.mt-tag.is-ahora {
  background: #d7f26a;
  color: #0b0c0b;
}

.mt-tag[hidden] {
  display: none;
}

.mt-fecha {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-titulo {
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-sala {
  overflow: hidden;
  color: #a7b0a8;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-flecha {
  flex: none;
  color: #8f9a91;
  font-size: 14px;
}

.mt-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 12px;
  border-radius: 18px;
  background: rgba(14, 16, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mt-play {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d7f26a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mt-play:disabled {
  opacity: 0.4;
  cursor: default;
}

.mt-play:focus-visible,
.mt-tarjeta:focus-visible {
  outline: 2px solid #d7f26a;
  outline-offset: 2px;
}

.mt-linea {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mt-textos {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.mt-hora {
  color: #f4f6ef;
  font-weight: 700;
  white-space: nowrap;
}

.mt-cuenta {
  overflow: hidden;
  color: #a7b0a8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-pista {
  position: relative;
  height: 26px;
}

.mt-pista-fondo,
.mt-pista-relleno {
  position: absolute;
  top: 11px;
  height: 4px;
  border-radius: 2px;
}

.mt-pista-fondo {
  left: 0;
  right: 0;
  background: #2c332d;
}

.mt-pista-relleno {
  left: 0;
  width: 0;
  background: #6f7f3a;
}

.mt-marcas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mt-marca {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: #5d665d;
}

.mt-marca.is-pasada {
  background: #d7f26a;
}

.mt-cabezal {
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 4px solid #d7f26a;
  background: #f4f6ef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* El tirador de verdad es un <input type="range"> invisible encima de la pista:
   accesible con teclado y lector de pantalla, y se arrastra con el dedo. */
.mt-scrub {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.mt-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px;
  height: 26px;
}

.mt-scrub::-moz-range-thumb {
  width: 2px;
  height: 26px;
  border: 0;
}

.mt-scrub:focus-visible ~ .mt-cabezal,
.mt-pista:focus-within .mt-cabezal {
  box-shadow: 0 0 0 3px rgba(215, 242, 106, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.mt-dias {
  position: relative;
  height: 14px;
}

.mt-dia {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: #7d877f;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.mt-dia.is-hoy {
  color: #d7f26a;
}

/* La cita a OpenStreetMap y el aviso del doble toque suben por encima del panel. */
.tt-parties-map .leaflet-bottom {
  bottom: var(--mt-abajo, 0px);
}

.tt-parties-map-wrap .tt-parties-map-pista {
  bottom: calc(var(--mt-abajo, 64px) + 18px);
}

.tt-parties-map .leaflet-control-attribution {
  margin-bottom: 12px;
}

/* --- Marcadores ---------------------------------------------------------------
   La fiesta activa: el cartel grande con borde lima, la fecha debajo, un pop al
   aparecer y un pulso en su punto. Las demas son puntos: lima apagado las que
   ya pasaron, hueco las que vienen. */

.mt-pin {
  overflow: visible;
}

.mt-pin-punto {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid #0b0c0b;
  background: #d7f26a;
  transform: translate(-50%, -50%);
}

.mt-pin-pulso {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(215, 242, 106, 0.35);
  transform: translate(-50%, -50%);
  animation: mt-pulso 1.6s ease-out infinite;
  pointer-events: none;
}

.mt-pin-carta {
  position: absolute;
  left: 0;
  bottom: 14px;
  width: 74px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 16px;
  background: #d7f26a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  transform-origin: 50% 100%;
  animation: mt-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.mt-pin-poster {
  position: relative;
  display: grid;
  place-items: center;
  height: 58px;
  overflow: hidden;
  border-radius: 12px;
  background: #151815;
  color: #d7f26a;
  font-size: 18px;
}

.mt-pin-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mt-pin-fecha {
  display: block;
  padding: 4px 0 1px;
  color: #0b0c0b;
  font: 700 12px/1 "Outfit", system-ui, sans-serif;
  text-align: center;
  white-space: nowrap;
}

.tt-parties-map .mt-punto {
  cursor: pointer;
}

@keyframes mt-pulso {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

@keyframes mt-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Reducir movimiento: sin pop ni pulso (y la barra no arranca sola, ver JS). */
.mt-sin-animacion .mt-pin-pulso {
  display: none;
}

.mt-sin-animacion .mt-pin-carta {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .mt-pin-pulso {
    display: none;
  }

  .mt-pin-carta {
    animation: none;
  }
}
