@import "../styles.css";

#fotosSection {
  width: 100%;
  min-height: 80vh;
  margin-top: 20px;
  padding: 0 14px 84px;
  box-sizing: border-box;
}

#fotosSection h2 {
  color: var(--neon-magenta-core);
  font-family: "Neonderthaw", cursive;
  font-size: 3em;
  margin: 50px 0 14px;
  text-shadow:
    0 0 2px var(--neon-magenta-core),
    0 0 10px var(--neon-magenta-core),
    0 0 18px rgba(255, 77, 255, 0.95),
    0 0 45px var(--neon-magenta-soft),
    0 0 60px rgba(255, 77, 255, 0.45);
  animation: neonFlicker 3s infinite alternate;
}

#fotoIntro,
#fotoInfos,
#photoViewerCaption {
  color: white;
  font-family: "Tilt Neon", sans-serif;
  font-size: 1.05rem;
  line-height: 1.45;
  text-align: center;
}

#fotoIntro {
  width: min(92vw, 720px);
  margin: 0 auto 24px;
}

#fotoInfos {
  width: min(92vw, 760px);
  min-height: 1.7em;
  margin: 18px auto 20px;
}

#timeFilter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(96vw, 860px);
}

.time-filter-button {
  min-width: 84px;
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid var(--neon-blue-core);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.88);
  color: white;
  font-family: "Tilt Neon", sans-serif;
  font-size: 1rem;
  cursor: pointer;
  box-shadow:
    0 0 2px var(--neon-blue-core),
    0 0 8px rgba(0, 168, 255, 0.7),
    inset 0 0 10px rgba(0, 168, 255, 0.18);
}

.time-filter-button.is-active {
  border-color: var(--neon-magenta-core);
  background: rgba(228, 40, 133, 0.22);
  box-shadow:
    0 0 2px var(--neon-magenta-core),
    0 0 12px var(--neon-magenta-soft),
    0 0 26px rgba(228, 40, 133, 0.45),
    inset 0 0 14px rgba(228, 40, 133, 0.24);
}

#fotosContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  width: min(94vw, 1180px);
}

.photo-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  box-shadow:
    0 0 2px var(--neon-blue-core),
    0 0 10px rgba(0, 168, 255, 0.48);
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.photo-tile img.is-loaded {
  opacity: 1;
}

.photo-tile::after {
  content: attr(data-minute);
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  font-family: "Tilt Neon", sans-serif;
  font-size: 0.86rem;
  line-height: 1;
}

#fotoLoadSentinel {
  width: 100%;
  height: 1px;
}

#photoViewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 74px 0 70px;
  background: rgba(0, 0, 0, 0.96);
}

#photoViewer.is-hidden {
  display: none;
}

#photoViewerTopbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 12px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.9);
  box-shadow:
    0 2px 2px var(--neon-magenta-core),
    0 2px 12px rgba(228, 40, 133, 0.55);
}

#photoViewerActions {
  display: flex;
  gap: 8px;
}

#closePhotoViewer,
#sharePhotoButton,
#downloadPhotoLink,
#scrollTopButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 2px solid var(--neon-magenta-core);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-family: "Tilt Neon", sans-serif;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 0 2px var(--neon-magenta-core),
    0 0 12px rgba(228, 40, 133, 0.65);
}

#closePhotoViewer {
  width: 42px;
  padding: 0;
  font-size: 1.35rem;
}

#sharePhotoButton,
#downloadPhotoLink {
  min-width: 82px;
  padding: 0 12px;
}

#fullPhoto {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 220px;
  object-fit: contain;
  background: #050505;
}

#photoViewerCaption {
  width: min(92vw, 820px);
  margin: 16px auto 0;
}

#scrollTopButton {
  position: fixed;
  right: 16px;
  bottom: 76px;
  z-index: 1200;
  width: 46px;
  min-width: 46px;
  height: 46px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#scrollTopButton.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#currentMinuteIndicator {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 3200;
  transform: translateX(-50%);
  min-width: 132px;
  max-width: calc(100vw - 112px);
  padding: 8px 14px;
  border: 2px solid var(--neon-blue-core);
  border-radius: 8px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-family: "Tilt Neon", sans-serif;
  font-size: 0.96rem;
  line-height: 1.15;
  text-align: center;
  box-shadow:
    0 0 2px var(--neon-blue-core),
    0 0 12px rgba(0, 168, 255, 0.7);
}

body.photo-viewer-open {
  overflow: hidden;
}

@media (hover: hover) {
  .time-filter-button:hover,
  .photo-tile:hover,
  #closePhotoViewer:hover,
  #sharePhotoButton:hover,
  #downloadPhotoLink:hover,
  #scrollTopButton:hover {
    animation: neonFlicker 1.6s infinite alternate;
  }
}

@media screen and (min-width: 700px) {
  #fotosSection {
    padding-inline: 24px;
  }

  #fotosContainer {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
  }

  #photoViewer {
    padding-top: 82px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-tile img,
  #scrollTopButton {
    transition: none;
  }
}
