/* ==========================================================================
   OUR MINI WORLD - VINTAGE ROMANTIC SCRAPBOOK & 3D FLIPBOOK
   Inspired by spiral-bound diaries with polaroid photos, pink washi tape,
   handwritten notes, and interactive page flipping gestures.
   ========================================================================== */

:root {
  --scrapbook-bg: #f4ede6;
  --scrapbook-paper: #fffdf9;
  --scrapbook-grid: rgba(225, 210, 198, 0.45);
  --scrapbook-margin: rgba(255, 140, 175, 0.5);
  --scrapbook-ink: #3b282d;
  --scrapbook-tape: rgba(255, 145, 175, 0.75);
  --scrapbook-tape-border: rgba(255, 110, 150, 0.4);
  --spiral-metal: #a3826d;
  --spiral-highlight: #d6bda8;
  --spiral-shadow: #6b5344;
}

/* Base Scrapbook Page Layout */
body.scrapbook-body {
  background-color: var(--scrapbook-bg);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(255, 230, 235, 0.8) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 215, 225, 0.6) 0%, transparent 50%),
    linear-gradient(135deg, #f6eee7 0%, #ecdcd1 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--scrapbook-ink);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Scrapbook Top Navigation Bar */
.scrapbook-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 250, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 182, 193, 0.45);
  box-shadow: 0 4px 16px rgba(220, 80, 120, 0.05);
  padding: 0.6rem 1rem;
}

.scrapbook-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.scrapbook-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full, 9999px);
  background: #ffffff;
  border: 1.5px solid rgba(255, 140, 170, 0.6);
  color: #ff3366;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(255, 77, 121, 0.12);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.scrapbook-back-btn .back-text-mobile {
  display: none;
}

.scrapbook-back-btn .back-text-full {
  display: inline;
}

.scrapbook-back-btn:hover {
  background: #ff4d79;
  color: #ffffff;
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(255, 77, 121, 0.3);
}

.scrapbook-header-title {
  font-family: 'Caveat', 'Kalam', cursive;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 700;
  color: #ff3366;
  margin: 0;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: 0.3px;
  flex-shrink: 1;
}

.scrapbook-header-title .header-heart {
  display: inline-block;
  animation: heartPulse 2.8s infinite ease-in-out;
}

.scrapbook-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 235, 242, 0.9);
  border: 1px dashed #ff7597;
  color: #d12e5a;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.scrapbook-page-badge .badge-text-mobile {
  display: none;
}

.scrapbook-page-badge .badge-text-full {
  display: inline;
}

/* ==========================================================================
   DESK SURFACE & JOURNAL BOOK CONTAINER
   ========================================================================== */

.scrapbook-stage {
  max-width: 1000px;
  margin: 1.5rem auto 3rem;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 2000px;
}

/* Instructions / Hint Bar */
.scrapbook-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  color: #a86b7c;
  margin-bottom: 1rem;
  text-align: center;
  animation: hintBreathe 3s ease-in-out infinite;
}

@keyframes hintBreathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

/* The Spiral-Bound Notebook Book */
.scrapbook-book {
  position: relative;
  width: min(95vw, 700px);
  min-height: 580px;
  height: min(85vh, 760px);
  background-color: var(--scrapbook-paper);
  border-radius: 20px 28px 28px 20px;
  box-shadow: 
    0 25px 65px rgba(85, 45, 55, 0.18),
    0 6px 20px rgba(85, 45, 55, 0.1),
    inset 0 0 100px rgba(230, 205, 190, 0.15);
  border: 1px solid rgba(220, 195, 180, 0.7);
  display: flex;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

/* Realistic Spiral Wire Spine on Left */
.scrapbook-spiral-spine {
  width: 44px;
  background: linear-gradient(90deg, #d8c3b2 0%, #ebe0d6 50%, #f7f1eb 100%);
  border-right: 2px solid rgba(160, 120, 100, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 1.5rem 0;
  z-index: 50;
  position: relative;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

.spiral-ring {
  width: 32px;
  height: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--spiral-metal) 0%, var(--spiral-highlight) 40%, var(--spiral-shadow) 100%);
  border: 1px solid rgba(90, 60, 45, 0.4);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  position: relative;
}

.spiral-ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b2820;
  transform: translateY(-50%);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Viewport for Pages */
.scrapbook-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  perspective: 2500px;
  -webkit-perspective: 2500px;
  transform-style: preserve-3d;
  background-color: var(--scrapbook-paper);
  background-image: 
    /* Pink notebook vertical margin line */
    linear-gradient(90deg, transparent 38px, var(--scrapbook-margin) 38px, var(--scrapbook-margin) 40px, transparent 40px),
    /* Faint ruled lines */
    linear-gradient(var(--scrapbook-grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 2.2rem;
  line-height: 2.2rem;
}

/* Individual Scrapbook Page Spread */
.scrapbook-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1.1rem 1.4rem 4.4rem 3.4rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: left center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity, filter;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 182, 193, 0.5) transparent;
}

.scrapbook-page::-webkit-scrollbar {
  width: 4px;
}
.scrapbook-page::-webkit-scrollbar-thumb {
  background: rgba(255, 182, 193, 0.6);
  border-radius: 4px;
}

.scrapbook-page.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: rotateY(0deg) translateZ(1px);
  z-index: 10;
}

/* Professional 3D Page Flip Animations */
.scrapbook-page.turning-out-next {
  z-index: 35;
  pointer-events: none;
  visibility: visible;
  animation: flipLeafNext 0.68s cubic-bezier(0.32, 0.08, 0.24, 1) forwards;
}

.scrapbook-page.incoming-next {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 15;
  animation: revealUnderneath 0.68s ease-out forwards;
}

.scrapbook-page.turning-in-prev {
  z-index: 35;
  visibility: visible;
  pointer-events: auto;
  animation: flipLeafPrev 0.68s cubic-bezier(0.32, 0.08, 0.24, 1) forwards;
}

.scrapbook-page.outgoing-prev {
  z-index: 15;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  animation: shadowBeneath 0.68s ease-in forwards;
}

@keyframes flipLeafNext {
  0% {
    transform: rotateY(0deg);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.05));
    opacity: 1;
  }
  35% {
    filter: drop-shadow(-22px 10px 32px rgba(60, 25, 35, 0.32));
  }
  85% {
    opacity: 0.8;
  }
  100% {
    transform: rotateY(-145deg);
    filter: drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.02));
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes revealUnderneath {
  0% {
    filter: brightness(0.85) contrast(1.06);
  }
  100% {
    filter: brightness(1) contrast(1);
  }
}

@keyframes flipLeafPrev {
  0% {
    transform: rotateY(-145deg);
    filter: drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.02));
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  65% {
    filter: drop-shadow(-22px 10px 32px rgba(60, 25, 35, 0.32));
    opacity: 1;
  }
  100% {
    transform: rotateY(0deg);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.05));
    opacity: 1;
  }
}

@keyframes shadowBeneath {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.85);
  }
  100% {
    filter: brightness(1);
  }
}

/* Scrapbook Page Header (Doodle Title) */
.page-header-doodle {
  text-align: center;
  margin-bottom: 0.8rem;
  position: relative;
  flex-shrink: 0;
}

.page-title-handwritten {
  font-family: 'Caveat', 'Kalam', cursive;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  font-weight: 700;
  color: #ff3366;
  margin: 0;
  line-height: 1.1;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
  display: inline-block;
  position: relative;
}

.page-title-handwritten::after {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -4px;
  height: 2.5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='6' viewBox='0 0 100 6'%3E%3Cpath d='M0,3 Q25,0 50,3 T100,3' fill='none' stroke='%23ff7597' stroke-width='2'/%3E%3C/svg%3E");
  background-size: 80px 6px;
  opacity: 0.7;
}

/* ==========================================================================
   SCRAPBOOK POLAROID GRID - EXPANDED TO FILL PAGE
   ========================================================================== */

.page-polaroid-collage {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem 1rem;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Center single odd item on its own row */
.page-polaroid-collage > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 260px;
  margin: 0 auto;
}

/* Organic Tilted Polaroid Card */
.scrapbook-polaroid {
  background: #ffffff;
  padding: 8px 8px 12px 8px;
  border-radius: 6px;
  box-shadow: 
    0 12px 28px rgba(70, 40, 50, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.scrapbook-polaroid:hover {
  transform: scale(1.04) rotate(0deg) !important;
  box-shadow: 0 18px 40px rgba(70, 40, 50, 0.25);
  z-index: 25;
}

.scrapbook-polaroid:active {
  transform: scale(0.98);
}

/* Organic Rotation Variations */
.tilt-left-1 { transform: rotate(-2.2deg); }
.tilt-right-1 { transform: rotate(1.8deg); }
.tilt-left-2 { transform: rotate(-1.4deg); }
.tilt-right-2 { transform: rotate(1.6deg); }
.tilt-center { transform: rotate(-0.4deg); }

/* Polaroid Media Frame - Fills Available Height */
.polaroid-media-box {
  flex: 1;
  width: 100%;
  min-height: 140px;
  aspect-ratio: 4 / 3.4;
  background: #f7eff2;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.polaroid-media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.scrapbook-polaroid:hover .polaroid-media-box img {
  transform: scale(1.04);
}

.polaroid-media-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Page Footer Decorative Band (Fills the Bottom Space Gracefully) */
.page-footer-decor {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 0.3rem;
  padding-top: 0.2rem;
  flex-shrink: 0;
}

.footer-doodle-text {
  font-family: 'Caveat', 'Kalam', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  color: #c46885;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 14px;
  border-radius: 9999px;
  border: 1px dashed rgba(255, 140, 175, 0.6);
  box-shadow: 0 2px 6px rgba(220, 100, 130, 0.08);
}

/* Video Play Overlay */
.polaroid-play-tag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 77, 121, 0.88);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(255, 77, 121, 0.5);
  transition: transform 0.25s ease, background 0.25s ease;
}

.scrapbook-polaroid:hover .polaroid-play-tag {
  transform: translate(-50%, -50%) scale(1.15);
  background: #ff3366;
}

/* ==========================================================================
   SMALL PINK WASHI TAPE (As seen in user reference)
   ========================================================================== */

.pink-tape {
  position: absolute;
  height: 20px;
  width: 65px;
  background: var(--scrapbook-tape);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 2px 6px rgba(200, 50, 90, 0.2);
  border-left: 2px dashed rgba(255, 255, 255, 0.7);
  border-right: 2px dashed rgba(255, 255, 255, 0.7);
  z-index: 5;
  pointer-events: none;
}

.pink-tape-top {
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
}

.pink-tape-corner-left {
  top: -8px;
  left: -12px;
  transform: rotate(-35deg);
  width: 55px;
}

.pink-tape-corner-right {
  top: -8px;
  right: -12px;
  transform: rotate(35deg);
  width: 55px;
}

/* Handwritten Scrapbook Captions */
.scrapbook-note {
  font-family: 'Caveat', 'Kalam', cursive;
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  font-weight: 700;
  color: var(--scrapbook-ink);
  text-align: center;
  margin-top: 8px;
  line-height: 1.25;
  letter-spacing: 0.2px;
  min-height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cute Doodles & Stickers */
.scrapbook-sticker {
  position: absolute;
  font-size: 1.4rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  z-index: 4;
}

.sticker-heart { top: 12px; right: 18px; transform: rotate(12deg); }
.sticker-sparkle { bottom: 65px; left: 16px; transform: rotate(-8deg); }
.sticker-stars { top: 35%; right: 12px; transform: rotate(15deg); }

/* ==========================================================================
   NAVIGATION CONTROLS & FLIP BUTTONS
   ========================================================================== */

.scrapbook-controls {
  position: absolute;
  bottom: 12px;
  left: 44px; /* offset by spiral width */
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 25;
  pointer-events: none;
}

.flip-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #ff7597;
  color: #ff3366;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 77, 121, 0.25);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.flip-btn:hover:not(:disabled) {
  background: #ff4d79;
  color: #ffffff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 18px rgba(255, 77, 121, 0.4);
}

.flip-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.flip-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Page indicator dots & text */
.scrapbook-pager {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid rgba(255, 182, 193, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pager-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ff4d79;
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE OPTIMIZATION (360px - 600px)
   ========================================================================== */

@media (max-width: 600px) {
  .scrapbook-header {
    padding: 0.45rem 0.65rem;
  }

  .scrapbook-header-inner {
    gap: 0.35rem;
  }

  .scrapbook-back-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    gap: 0.25rem;
  }

  .scrapbook-back-btn .back-text-full {
    display: none;
  }

  .scrapbook-back-btn .back-text-mobile {
    display: inline;
  }

  .scrapbook-header-title {
    font-size: 1.25rem;
    letter-spacing: 0;
  }

  .scrapbook-page-badge {
    padding: 0.32rem 0.6rem;
    font-size: 0.74rem;
    gap: 0.25rem;
  }

  .scrapbook-page-badge .badge-text-full {
    display: none;
  }

  .scrapbook-page-badge .badge-text-mobile {
    display: inline;
  }

  .scrapbook-hint-bar {
    font-size: 0.88rem;
    margin: 0.2rem auto 0.4rem;
    padding: 0 0.5rem;
    gap: 0.35rem;
  }

  .scrapbook-stage {
    margin: 0.25rem auto 1.5rem;
    padding: 0 0.4rem;
  }

  .scrapbook-book {
    width: 96vw;
    height: calc(100dvh - 110px);
    max-height: 720px;
    min-height: 520px;
    border-radius: 14px 18px 18px 14px;
  }

  .scrapbook-spiral-spine {
    width: 28px;
    padding: 0.75rem 0;
  }

  .spiral-ring {
    width: 22px;
    height: 10px;
  }

  .spiral-ring::before {
    left: -5px;
    width: 6px;
    height: 6px;
  }

  .scrapbook-viewport {
    background-image: 
      linear-gradient(90deg, transparent 20px, var(--scrapbook-margin) 20px, var(--scrapbook-margin) 21px, transparent 21px),
      linear-gradient(var(--scrapbook-grid) 1px, transparent 1px);
    background-size: 100% 100%, 100% 1.8rem;
    line-height: 1.8rem;
  }

  .scrapbook-page {
    padding: 0.65rem 0.65rem 3.4rem 1.35rem;
  }

  .page-header-wrap {
    margin-bottom: 0.35rem;
  }

  .page-chapter-title {
    font-size: 1.15rem;
  }

  .page-polaroid-collage {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 0.45rem;
    flex: 1;
  }

  .page-polaroid-collage > :last-child:nth-child(odd) {
    max-width: 190px;
    margin: 0 auto;
  }

  .scrapbook-polaroid {
    padding: 5px 5px 8px 5px;
    max-width: 100%;
    height: 100%;
    border-radius: 4px;
  }

  .polaroid-media-box {
    min-height: 110px;
    aspect-ratio: 4 / 3.4;
  }

  .pink-tape {
    height: 14px;
    width: 42px;
  }

  .pink-tape-corner-left, .pink-tape-corner-right {
    width: 36px;
  }

  .scrapbook-note {
    font-size: 0.95rem;
    margin-top: 4px;
    min-height: 1.4rem;
    line-height: 1.2;
  }

  .page-footer-decor {
    margin-top: 0.3rem;
  }

  .footer-doodle-text {
    font-size: 0.92rem;
    padding: 1px 10px;
  }

  .scrapbook-controls {
    left: 28px;
    right: 6px;
    padding: 0 0.4rem;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .flip-btn {
    padding: 0.42rem 0.75rem;
    font-size: 0.76rem;
    gap: 0.35rem;
  }

  .pager-text {
    font-size: 0.74rem;
  }
}

@media (max-width: 380px) {
  .scrapbook-header-title {
    font-size: 1.05rem;
  }

  .scrapbook-back-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.74rem;
  }

  .scrapbook-page-badge {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }

  .page-chapter-title {
    font-size: 1.05rem;
  }

  .page-polaroid-collage {
    gap: 0.55rem 0.35rem;
  }

  .page-polaroid-collage > :last-child:nth-child(odd) {
    max-width: 170px;
  }

  .scrapbook-polaroid {
    padding: 4px 4px 6px 4px;
  }

  .polaroid-media-box {
    min-height: 95px;
  }

  .scrapbook-note {
    font-size: 0.88rem;
  }

  .flip-btn span.btn-text {
    display: none;
  }
  
  .flip-btn {
    padding: 0.42rem 0.65rem;
  }
}

/* ==========================================================================
   SCRAPBOOK FULLSCREEN LIGHTBOX & VIDEO MODAL (Guaranteed Hidden When Inactive)
   ========================================================================== */

.memories-lightbox,
.lightbox-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.memories-lightbox.is-active,
.lightbox-overlay.is-active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 10, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1;
}

.lightbox-dialog,
.lightbox-container {
  position: relative;
  z-index: 2;
  width: 92vw;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-close,
.lightbox-close-btn {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #ff7597;
  color: #ff3366;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  z-index: 10;
  outline: none;
}

.lightbox-close:hover,
.lightbox-close-btn:hover {
  background: #ff4d79;
  color: #ffffff;
  transform: scale(1.08);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #ff7597;
  color: #ff3366;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  z-index: 10;
  outline: none;
}

.lightbox-nav-btn:hover {
  background: #ff4d79;
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn.prev,
.lightbox-prev-btn {
  left: -24px;
}

.lightbox-nav-btn.next,
.lightbox-next-btn {
  right: -24px;
}

.lightbox-media-container,
.lightbox-stage {
  max-width: 100%;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  background: #000;
}

.lightbox-media-container img,
.lightbox-media-container video,
.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.lightbox-footer {
  margin-top: 0.85rem;
  text-align: center;
  color: #ffffff;
  padding: 0 1rem;
}

.lightbox-caption {
  font-family: 'Caveat', 'Kalam', cursive;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  margin-bottom: 0.25rem;
}

.lightbox-counter {
  font-size: 0.82rem;
  color: #ffb3c6;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .lightbox-close,
  .lightbox-close-btn {
    top: -42px;
    right: 4px;
    width: 36px;
    height: 36px;
  }
  .lightbox-nav-btn.prev,
  .lightbox-prev-btn {
    left: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .lightbox-nav-btn.next,
  .lightbox-next-btn {
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}
