body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #141416;
  font-family: sans-serif;
  overflow: hidden;
}

.book {
  width: min(90vw, 1400px);
  aspect-ratio: 14 / 6;
  perspective: 1500px;
  margin-bottom: 80px;
}

.spread {
  display: flex;
  width: 100%;
  height: 100%;
}

.spread::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 100%;

  transform: translateX(-50%);
  pointer-events: none;

  background: linear-gradient(
    to right,
    rgba(0,0,0,0.06),
    rgba(0,0,0,0.03),
    rgba(0, 0, 0, 0.123),
    rgba(0,0,0,0.03),
    rgba(0,0,0,0.06)
  );

  z-index: 2;
}

.spread::after {
  transition: opacity 0.3s ease-in-out;
}

.book.flipping .spread::after {
  opacity: 0;
}

/* Pages */
.page {
  width: 50%;
  height: 100%;
  background: #141416;
  /* border: 1px solid #ddd; */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  border-radius: 16px;

  z-index: 1;
}

.page-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media {
  width: 100%;
  height: 100%;
  object-fit: cover; /* or contain if you prefer */
  display: block;
}

.controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  align-items: center;
  gap: 12px;

  z-index: 999;
}

/* Controls */
.book-controls {
  display: flex;
  align-items: center;
  gap: 2px;

  padding: 0 16px;
  height: 52px;
  border-radius: 999px;

  background: #313131;
  backdrop-filter: blur(10px);
  filter: drop-shadow(0px 0px 4px #0000007f);

  color: #FDFDFD;
  font-size: 14px;

  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  max-width: 168px;
}

/* Buttons */
.nav-btn {
  background: none;
  border: none;
  color: #E3E3E6;
  cursor: pointer;
  margin-top: 4px;

  opacity: 0.8;
  transition: 0.2s ease;
}

.nav-btn:hover {
  opacity: 1;
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Progress text */
#progressText {
  min-width: 60px;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.5px;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.click-zone {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 20;
  cursor: pointer;
}

/* Left side (Prev) */
.left-zone {
  left: 0;
}

/* Right side (Next) */
.right-zone {
  right: 0;
}

/* Optional: subtle hover feedback */
.click-zone:hover {
  background: rgba(255,255,255,0.03);
}

.flip-layer {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  left: 50%;
  perspective: 2000px;
  pointer-events: none;
  display: none;
}

.flip-page {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  background: white;
}

.flip-back {
  transform: rotateY(180deg);
}

/* Flip animations */
.flip-next {
  animation: flipNext 0.8s ease forwards;
}

@keyframes flipNext {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-180deg); }
}

.flip-prev {
  animation: flipPrev 0.8s ease forwards;
}

@keyframes flipPrev {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}

.book {
  position: relative;
}

.flip-layer {
  z-index: 10;
}

.spread {
  z-index: 1;
  position: relative;
}

.right-zone:hover::after {
  content: "⤿";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(179, 179, 179, 0.6);
  font-size: 24px;
}

.left-zone:hover::after {
  content: "⤾";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(179, 179, 179, 0.6);
  font-size: 24px;
}

/* =========================
   FLOATING BOTTOM NAV
========================= */
.floating-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;

  background: #313131;
  backdrop-filter: blur(10px);
  border-radius: 999px;
  filter: drop-shadow(0px 0px 4px #0000007f);

  z-index: 999;
}

.floating-nav .nav-item {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #E3E3E6;
  transition: all 0.25s ease;
  text-decoration: none;
}

/* =========================
   MATERIAL SYMBOLS
========================= */
.material-symbols-outlined, .material-symbols {
  font-size: 20px;
  line-height: 1;
  color: #656565;
  display: inline-block;

  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;

  transition: font-variation-settings 0.25s ease, transform 0.25s ease;
}

/* Active = filled */
.floating-nav .nav-item.active .material-symbols-outlined {
  color: #E3E3E6;
  font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;

  transform: scale(1.05);
}

/* OPTIONAL hover preview (non-conflicting) */
.floating-nav .nav-item:not(.active):hover .material-symbols-outlined {
  color: #E3E3E6;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  transition: all 0.4s ease;
}

.material-symbols:hover{
  color: #E3E3E6;
  transition: all 0.4s ease;
}

/* Pause / Play button cursor */
#pause-toggle {
  cursor: pointer;
}

/* Optional: also apply to all nav items for consistency */
.floating-nav .nav-item {
  cursor: pointer;
}

/* =========================
   TOOLTIP (DELAYED)
========================= */
.floating-nav .nav-item {
  position: relative;
}

/* Tooltip bubble */
.floating-nav .nav-item::after {
  content: attr(data-tooltip);

  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);

  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: "Darker Grotesque", sans-serif;
  white-space: nowrap;

  color: #E3E3E6;
  background: #313131;
  border-radius: 8px;

  opacity: 0;
  pointer-events: none;

  transition: 
    opacity 0.2s ease,
    transform 0.2s ease;
}


/* ⏱ Delay appears ONLY on hover */
.floating-nav .nav-item:hover::after,
.floating-nav .nav-item:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);

  transition-delay: 0.6s; /* 👈 adjust delay here */
}

/* Remove delay when leaving */
.floating-nav .nav-item::after,
.floating-nav .nav-item::before {
  transition-delay: 0s;
}

.progress {
  color: #aaa;
  font-size: 14px;

  transform: translateX(-50%);
}

@media (max-width: 1024px) {
  .book {
    width: 95vw;
    overflow: hidden;
  }
}

/* Default: desktop mode */
.mobile-gallery {
  display: none;
}

/* Mobile mode */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  .book,
  .book-controls {
    display: none;
  }

  .mobile-gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* padding: 0px 4px; */
  }

  .mobile-page {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
  }

  .mobile-page .page-content {
    height: auto;
  }

  .mobile-page .image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }
}