/* ==========================================================================
   POKEBALL.CSS — Poké Ball Catalog | Scrollable Slides
   Half-height slides (40vh), zigzag layout, neon glow
   ========================================================================== */

.pokeball-page {
  padding: 0;
  min-height: 0;
  flex-grow: 0;
  overflow-y: visible;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Compact back link — fixed, doesn't take scroll space */
.pokeball-back-link {
  position: fixed;
  top: 60px;
  left: 1rem;
  z-index: 20;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 6px 12px;
  background: rgba(10, 14, 30, 0.7);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  transition: color 0.2s, background 0.2s;
}

.pokeball-back-link:hover {
  color: #fff;
  background: rgba(10, 14, 30, 0.9);
}

/* ==========================================================================
   POKEBALL AREA — Compact slides, balls float close together
   ========================================================================== */
.pokeball-area {
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0 0 60px;
  background: transparent;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── Generation block: outer glass (aligned with series dossier aesthetic) ── */
.pokeball-gen-panel {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto 1.35rem;
  padding: 1.2rem 1.35rem 1.15rem;
  background: rgba(5, 12, 28, 0.52);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.35),
    0 24px 64px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.pokeball-gen-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(120, 180, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.12) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.pokeball-gen-slides {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 0;
}

.pokeball-gen-slides .pokeball-slide {
  margin-bottom: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Gen title: glass chỉ rộng bằng chữ, căn giữa theo chiều ngang */
.pokeball-area > .pokeball-section-slide {
  width: 100%;
  max-width: 100vw;
  margin: 0 auto 0.65rem;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pokeball-area > .pokeball-section-slide:first-child,
.pokeball-area > .pokeball-gen-panel:first-child {
  margin-top: 0.35rem;
}

.pokeball-area > .pokeball-section-slide .pokeball-section-glass {
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

body:has(.pokeball-page) {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  scroll-behavior: smooth;
  height: auto;
  min-height: 100vh;
}

.pokeball-empty-msg {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  padding: 3rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
}

.pokeball-empty-msg code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
}

.pokeball-slide {
  width: 100%;
  max-width: 100vw;
  min-height: 22vh;
  height: auto;
  margin: 0 0 4px 0;
  padding: 0 1.5rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-margin-top: 12px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Section slide — liquid glass header (đứng ngoài khung nội dung gen) */
.pokeball-section-slide {
  min-height: 14vh;
}

.pokeball-section-glass {
  position: relative;
  padding: 0.9rem 1.75rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pokeball-section-glass::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, transparent 10%, rgba(255,255,255,0.2) 50%, transparent 90%);
  pointer-events: none;
}

.pokeball-section-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

/* Neon glow behind ball — soft, uses ball's primary color */
.pokeball-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60%;
  height: 80%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    var(--glow-color, #E63946) 0%,
    transparent 70%
  );
  filter: blur(45px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* Watermark */
.pokeball-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.pokeball-watermark span {
  font-size: 12vw;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.04);
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}

/* Zigzag: odd = ball right, even = ball left (ball opposite to name/info) */
.pokeball-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: 100%;
  width: 100%;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.pokeball-slide.odd .pokeball-inner {
  flex-direction: row-reverse;
}

.pokeball-slide.even .pokeball-inner {
  flex-direction: row;
}

/* Ball frame — floating animation (light) */
.pokeball-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  min-height: 0;
  flex: 0 0 40%;
  max-width: 160px;
  position: relative;
  z-index: 1;
}

.pokeball-img {
  width: clamp(64px, 14vw, 110px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35))
          drop-shadow(0 0 30px var(--glow-color, #E63946));
  position: relative;
  z-index: 2;
  animation: pokeballFloat 4s ease-in-out infinite;
}

@keyframes pokeballFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Info column */
.pokeball-info {
  flex: 1 1 58%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.4rem;
  position: relative;
  z-index: 2;
}

.pokeball-slide.odd .pokeball-info {
  align-items: flex-end;
  text-align: right;
}

/* Ball on right: offset slightly from center toward right */
.pokeball-slide.odd .pokeball-frame {
  margin-left: 1.5rem;
}

.pokeball-name {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
  margin: 0 0 0.1rem 0;
}

.pokeball-gen-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem 0;
}

/* Description — liquid glass with asymmetric corners (2 symmetric pairs) */
.pokeball-desc-glass {
  position: relative;
  padding: 0.6rem 1rem;
  border-radius: 44px 12px 44px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  max-width: 360px;
}

.pokeball-desc-glass::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  border-radius: 44px 12px 0 0;
  background: linear-gradient(90deg, transparent 15%, rgba(255,255,255,0.15) 50%, transparent 85%);
  pointer-events: none;
}

.pokeball-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ==========================================================================
   MOBILE
   ========================================================================== */
@media (max-width: 768px) {
  .pokeball-area {
    padding: 0 0 50px;
  }

  .pokeball-gen-panel {
    width: calc(100% - 1.25rem);
    margin-bottom: 1rem;
    padding: 0.95rem 0.85rem 0.9rem;
    border-radius: 14px;
  }

  .pokeball-area > .pokeball-section-slide {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    margin-bottom: 0.55rem;
    min-height: 12vh;
  }

  .pokeball-section-glass {
    padding: 0.7rem 1.2rem;
  }

  .pokeball-section-label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  .pokeball-slide {
    min-height: 28vh;
    padding: 0.75rem 0.65rem;
    margin-bottom: 6px;
  }

  .pokeball-gen-slides .pokeball-slide {
    margin-bottom: 0;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }

  .pokeball-inner,
  .pokeball-slide.even .pokeball-inner,
  .pokeball-slide.odd .pokeball-inner {
    flex-direction: column;
    gap: 0.6rem;
  }

  .pokeball-frame {
    flex: none;
    max-width: 100%;
    padding: 0.25rem 0.5rem;
  }

  .pokeball-img {
    width: clamp(56px, 20vw, 90px);
  }

  .pokeball-info {
    align-items: center !important;
    text-align: center !important;
  }

  .pokeball-desc-glass {
    max-width: 100%;
  }

  .pokeball-watermark span {
    font-size: 10vw;
  }
}
