/* ============================================
   FUN MEDIA DISPLAY COMPONENTS
   ============================================ */

/* Fun Media Gallery Base Styles */
.fun-media-section {
  position: relative;
  padding: 60px 20px;
  margin: 40px 0;
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.1), rgba(197, 108, 240, 0.1));
  border-radius: 30px;
  backdrop-filter: blur(5px);
  overflow: hidden;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #ff6b9d, #c56cf0, #ffd93d);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 4s ease infinite;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255, 107, 157, 0.2);
}

/* Polaroid Gallery - Fixed Layout */
.polaroid-gallery {
  padding: 40px 20px;
  margin: 30px 0;
  text-align: center;
}

.polaroid-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.polaroid {
  background: white;
  padding: 12px 12px 40px 12px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transform: rotate(var(--rotation, -3deg));
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  position: relative;
  animation: polaroidFloat 8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  flex: 0 0 auto;
  z-index: 1;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.08);
  box-shadow: 0 20px 50px rgba(255, 105, 180, 0.3);
  z-index: 10;
}

.polaroid.special-video {
  --rotation: -2deg;
  transform: rotate(-2deg) scale(1.1);
  box-shadow: 0 15px 40px rgba(255, 105, 180, 0.4);
  border: 4px solid rgba(255, 105, 180, 0.3);
}

.polaroid.special-video:hover {
  transform: rotate(0deg) scale(1.15);
  box-shadow: 0 25px 60px rgba(255, 105, 180, 0.5);
}

.polaroid img,
.polaroid video {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.polaroid-caption {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  text-align: center;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  color: #ff6b9d;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
}

/* Floating Memory Bubbles - Fixed Positioning */
.memory-bubbles {
  position: relative;
  padding: 80px 20px;
  margin: 30px 0;
  min-height: 500px;
}

.bubbles-container {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 0 auto;
  max-width: 1200px;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: bubbleFloat 8s ease-in-out infinite;
  box-shadow: 0 8px 30px rgba(255, 105, 180, 0.25),
              inset 0 0 15px rgba(255, 255, 255, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(3px);
}

.bubble:hover {
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 15px 50px rgba(255, 105, 180, 0.5),
              inset 0 0 25px rgba(255, 255, 255, 0.6);
  z-index: 100;
  border-color: rgba(255, 255, 255, 0.9);
}

.bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.bubble:hover img {
  transform: scale(1.1);
}

.bubble-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  color: #ff6b9d;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bubble:hover .bubble-label {
  opacity: 1;
}

@keyframes bubbleFloat {
  0%, 100% {
    transform: translateY(0) rotate(-8deg);
  }
  25% {
    transform: translateY(-15px) rotate(5deg);
  }
  50% {
    transform: translateY(-8px) rotate(-3deg);
  }
  75% {
    transform: translateY(-20px) rotate(8deg);
  }
}

/* Interactive Photo Wall */
.photo-wall {
  position: relative;
  padding: 60px 20px;
  margin: 50px 0;
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.2), rgba(197, 108, 240, 0.2));
  border-radius: 30px;
  overflow: hidden;
}

.photo-wall-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.wall-photo {
  aspect-ratio: 1;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 5px 20px rgba(255, 105, 180, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  position: relative;
  background: linear-gradient(135deg, #ff6b9d, #c56cf0);
}

.wall-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
  filter: brightness(0.9);
}

.wall-photo:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 50px rgba(255, 105, 180, 0.5);
  border-color: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.wall-photo:hover img {
  filter: brightness(1.1) contrast(1.1);
  transform: scale(1.2);
}

.wall-photo::before {
  content: '💕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.wall-photo:hover::before {
  opacity: 1;
}

/* Magic Video Lanterns */
.video-lanterns {
  position: relative;
  padding: 80px 20px;
  margin: 60px 0;
  min-height: 500px;
}

.lantern {
  position: absolute;
  width: 200px;
  height: 280px;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: lanternSwing 4s ease-in-out infinite;
}

.lantern:hover {
  transform: scale(1.1) rotate(10deg);
  z-index: 100;
}

.lantern-body {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(197, 108, 240, 0.3));
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 40px rgba(255, 105, 180, 0.3),
              inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.lantern-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lantern-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(circle, rgba(255, 105, 180, 0.3), transparent 70%);
  border-radius: 25px;
  animation: glowPulse 2s ease-in-out infinite;
}

.lantern-bottom {
  width: 30px;
  height: 40px;
  background: linear-gradient(135deg, #ff6b9d, #c56cf0);
  margin: 10px auto;
  border-radius: 0 0 15px 15px;
  position: relative;
}

.lantern-string {
  width: 2px;
  height: 60px;
  background: linear-gradient(180deg, transparent, #ff6b9d);
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes lanternSwinging {
  0%, 100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Heart Trail Gallery */
.heart-trail-gallery {
  position: relative;
  padding: 60px 20px;
  margin: 50px 0;
  min-height: 600px;
}

.trail-photo {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 10px 40px rgba(255, 105, 180, 0.3);
  border: 4px solid rgba(255, 255, 255, 0.8);
  animation: trailFloat 8s ease-in-out infinite;
}

.trail-photo:hover {
  transform: scale(1.2) rotate(15deg);
  box-shadow: 0 20px 80px rgba(255, 105, 180, 0.6);
  z-index: 100;
  border-color: #fff;
}

.trail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.trail-photo:hover img {
  transform: scale(1.1);
}

.trail-photo::after {
  content: '❤️';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  opacity: 0;
  transition: all 0.3s ease;
  transform: scale(0);
}

.trail-photo:hover::after {
  opacity: 1;
  transform: scale(1) rotate(360deg);
}

@keyframes trailFloat {
  0%, 100% {
    transform: translateY(0) rotate(-10deg);
  }
  25% {
    transform: translateY(-30px) rotate(5deg);
  }
  50% {
    transform: translateY(-15px) rotate(-5deg);
  }
  75% {
    transform: translateY(-40px) rotate(10deg);
  }
}

/* Spinning Photo Carousel */
.spinning-carousel {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 60px 0;
  perspective: 1500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: spin3d 20s linear infinite;
}

.carousel-3d-item {
  position: absolute;
  width: 300px;
  height: 400px;
  left: 50%;
  top: 50%;
  margin-left: -150px;
  margin-top: -200px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(255, 105, 180, 0.4);
  border: 4px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-3d-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.carousel-3d-item:hover {
  transform: scale(1.1);
  box-shadow: 0 30px 120px rgba(255, 105, 180, 0.7);
}

.carousel-3d-item:hover img {
  transform: scale(1.2);
}

@keyframes spin3d {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

/* Floating Polaroids */
.polaroid-gallery {
  position: relative;
  padding: 80px 20px;
  margin: 60px 0;
  min-height: 700px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.polaroid {
  background: white;
  padding: 15px 15px 50px 15px;
  border-radius: 5px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
  transform: rotate(var(--rotation));
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  position: relative;
  animation: polaroidFloat 6s ease-in-out infinite;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.15);
  box-shadow: 0 25px 100px rgba(255, 105, 180, 0.4);
  z-index: 100;
}

.polaroid img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 3px;
}

.polaroid-caption {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  text-align: center;
  font-family: 'Comic Sans MS', cursive;
  color: #ff6b9d;
  font-size: 14px;
  font-weight: bold;
}

@keyframes polaroidFloat {
  0%, 100% {
    transform: rotate(var(--rotation)) translateY(0px);
  }
  25% {
    transform: rotate(var(--rotation)) translateY(-8px);
  }
  50% {
    transform: rotate(var(--rotation)) translateY(-15px);
  }
  75% {
    transform: rotate(var(--rotation)) translateY(-5px);
  }
}

/* Enhanced Mobile Touch Support */
@media screen and (max-width: 768px) {
  /* Touch-optimized photo interactions */
  .polaroid,
  .bubble,
  .wall-photo,
  .trail-photo,
  .carousel-3d-item,
  .video-card,
  .memory-item {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 107, 157, 0.1);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .polaroid:active,
  .bubble:active,
  .wall-photo:active,
  .trail-photo:active,
  .carousel-3d-item:active,
  .video-card:active,
  .memory-item:active {
    transform: scale(0.95) !important;
  }

  /* Enhanced touch feedback */
  .polaroid:hover:active,
  .bubble:hover:active,
  .wall-photo:hover:active,
  .trail-photo:hover:active {
    transform: scale(1.0) rotate(0deg) !important;
  }

  /* Lazy loading placeholder styles */
  .lazy-loading {
    background: linear-gradient(90deg, rgba(255, 182, 193, 0.1) 25%, rgba(197, 108, 240, 0.1) 50%, rgba(255, 182, 193, 0.1) 75%);
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
  }

  @keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .lazy-loaded {
    animation: fadeIn 0.5s ease-out;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Mobile swipe hints */
  .swipe-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    opacity: 0.7;
    animation: swipeHintPulse 2s ease-in-out infinite;
  }

  @keyframes swipeHintPulse {
    0%, 100% { opacity: 0.7; transform: translateX(-50%); }
    50% { opacity: 1; transform: translateX(-50%) translateX(-5px); }
  }

  .swipe-hint::before {
    content: '👆';
    margin-right: 5px;
  }

  .fun-media-section {
    padding: 30px 15px;
    margin: 20px 0;
    border-radius: 20px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .polaroid-gallery, .memory-bubbles, .photo-wall, .video-lanterns, .heart-trail-gallery, .spinning-carousel {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
  }

  /* Polaroid Gallery Mobile */
  .polaroid-gallery {
    padding: 20px 10px;
  }

  .polaroid-container {
    gap: 20px;
    justify-content: center;
  }

  .polaroid {
    padding: 8px 8px 30px 8px;
  }

  .polaroid img,
  .polaroid video {
    width: 140px;
    height: 140px;
  }

  .polaroid-caption {
    font-size: 10px;
    bottom: 6px;
  }

  /* Memory Bubbles Mobile */
  .memory-bubbles {
    padding: 40px 10px;
    min-height: 400px;
  }

  .bubbles-container {
    height: 400px;
  }

  .bubble {
    width: 100px !important;
    height: 100px !important;
  }

  .bubble-label {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  /* Photo Wall Mobile */
  .photo-wall-container {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .wall-photo {
    aspect-ratio: 1;
  }

  .wall-photo::before {
    font-size: 1.5rem;
  }

  /* Other Components Mobile */
  .photo-cube {
    width: 160px;
    height: 160px;
  }

  .lantern {
    width: 120px !important;
    height: 180px !important;
  }

  .lantern-body {
    height: 140px;
  }

  .trail-photo {
    width: 100px !important;
    height: 100px !important;
  }

  .carousel-3d-item {
    width: 160px;
    height: 220px;
    margin-left: -80px;
    margin-top: -110px;
  }
}

/* Additional Mobile Fixes */
@media screen and (max-width: 480px) {
  .fun-media-section {
    padding: 20px 10px;
    margin: 15px 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .polaroid-gallery, .memory-bubbles, .photo-wall, .video-lanterns, .heart-trail-gallery, .spinning-carousel {
    border: none !important;
    outline: none !important;
  }

  .polaroid, .bubble, .wall-photo, .trail-photo, .carousel-3d-item {
    border: none !important;
    outline: none !important;
  }
}

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .polaroid img,
  .polaroid video {
    width: 120px;
    height: 120px;
  }

  .polaroid-caption {
    font-size: 9px;
    bottom: 5px;
  }

  .bubble {
    width: 80px !important;
    height: 80px !important;
  }

  .bubble-label {
    font-size: 0.6rem;
    padding: 1px 6px;
  }

  .photo-wall-container {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 5px;
  }
}

/* Fun Loading Animation for Galleries */
.gallery-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 1.5rem;
  color: #ff6b9d;
  animation: loadingHearts 1.5s ease-in-out infinite;
}

@keyframes loadingHearts {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}