/* ==========================================================================
   MILESTONE MEMORY VIEWER MODAL
   Custom viewers for image, voice note, custom video player,
   Holding Hands keepsake waiting frame, First Kiss rainy card,
   Our First Date card, and Garba 2026 festive card.
   ========================================================================== */

.milestone-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(61, 15, 35, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

.milestone-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 182, 193, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(180, 40, 85, 0.25), 0 0 40px rgba(255, 182, 193, 0.3);
  padding: 2.2rem 1.8rem;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-overflow-scrolling: touch;
}

.milestone-modal.is-active .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff0f3;
  border: 1px solid #ffd0dc;
  color: var(--text-secondary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  z-index: 10;
  outline: none;
}

.modal-close-btn:hover {
  background: #ff4d79;
  color: #ffffff;
  transform: rotate(90deg) scale(1.06);
  border-color: #ff4d79;
}

/* Modal Content Header */
.modal-header {
  text-align: center;
  margin-bottom: 1.4rem;
  padding: 0 1.5rem;
}

.modal-milestone-number {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-primary);
  margin-bottom: 0.3rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4.5vw, 1.8rem);
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.modal-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Modal Media Body */
.milestone-media-wrap,
.modal-media-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 1.4rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff0f5;
  border: 1px solid rgba(255, 182, 193, 0.6);
  box-shadow: 0 8px 24px rgba(220, 80, 120, 0.12);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.milestone-media-img,
.modal-img {
  width: 100%;
  height: auto;
  max-height: 48vh;
  object-fit: contain;
  display: block;
  background: #fff8fa;
}

/* Custom Video Viewer Container */
.custom-video-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 1.4rem;
  background: #fff5f8;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 182, 193, 0.6);
  box-shadow: 0 8px 24px rgba(220, 80, 120, 0.12);
}

.custom-video-element {
  width: 100%;
  max-height: 44vh;
  display: block;
  object-fit: contain;
  background: #111111;
}

.video-custom-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(255, 182, 193, 0.5);
}

.video-play-btn {
  background: var(--pink-primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 3px 10px rgba(255, 77, 121, 0.35);
  transition: transform 0.2s ease;
  outline: none;
  flex-shrink: 0;
}

.video-play-btn:hover {
  transform: scale(1.08);
}

.video-progress-slider {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  appearance: none;
  background: #ffd6e0;
  outline: none;
  cursor: pointer;
}

.video-progress-slider::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--pink-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 77, 121, 0.4);
}

.video-time-display {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Milestone 4: Holding Hands Keepsake Frame */
.holding-hands-frame {
  padding: 2.8rem 1.6rem;
  text-align: center;
  background: linear-gradient(135deg, #fffafd 0%, #fff2f6 100%);
  border: 2px dashed rgba(255, 105, 145, 0.55);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(255, 182, 193, 0.2);
  margin-bottom: 1.4rem;
}

.holding-hands-icon {
  font-size: 3.2rem;
  margin-bottom: 0.8rem;
  display: inline-block;
  animation: heartPulse 2.4s infinite;
  filter: drop-shadow(0 4px 12px rgba(255, 77, 121, 0.3));
}

.holding-hands-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.holding-hands-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 380px;
  margin: 0 auto 1.2rem;
}

.holding-hands-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid rgba(255, 105, 145, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pink-primary);
  box-shadow: 0 4px 12px rgba(220, 80, 120, 0.1);
}

/* Milestone 7: First Kiss Rainy Card */
.first-kiss-card {
  position: relative;
  padding: 2.5rem 1.6rem;
  background: linear-gradient(145deg, #ffffff 0%, #fff4f8 45%, #fce9f1 100%);
  border: 1px solid rgba(255, 150, 180, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 45px rgba(220, 70, 115, 0.15);
  overflow: hidden;
  text-align: center;
  margin-bottom: 1.4rem;
}

.kiss-date-banner {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--pink-primary);
  padding: 0.35rem 1.3rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid #ffd0dc;
  box-shadow: 0 4px 12px rgba(255, 77, 121, 0.15);
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 2;
}

.kiss-quote {
  position: relative;
  z-index: 2;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-primary);
  max-width: 460px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.kiss-location-tag {
  position: relative;
  z-index: 2;
  margin-top: 1.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Milestone 8: Our First Date Card */
.first-date-card {
  position: relative;
  padding: 2.4rem 1.6rem;
  background: linear-gradient(145deg, #ffffff 0%, #fff8f5 50%, #ffeef2 100%);
  border: 1px solid rgba(255, 175, 150, 0.6);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(220, 80, 100, 0.12);
  text-align: center;
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.first-date-banner-tag {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: #d6336c;
  padding: 0.35rem 1.3rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid #ffe0d6;
  box-shadow: 0 4px 12px rgba(255, 120, 90, 0.15);
  margin-bottom: 1.1rem;
}

.first-date-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  animation: gentleFloat 4s ease-in-out infinite;
}

.first-date-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.first-date-location {
  margin-top: 1.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.milestone-media-preview {
  margin: 1rem auto 1.2rem;
  max-width: 380px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(220, 80, 120, 0.18);
  border: 4px solid #ffffff;
}

.milestone-keepsake-img {
  width: 100%;
  max-height: 42vh;
  object-fit: contain;
  display: block;
  background: #fff0f5;
}

/* Milestone 9: Garba 2026 Card */
.garba-card {
  position: relative;
  padding: 2.5rem 1.6rem;
  background: linear-gradient(145deg, #ffffff 0%, #fff4fa 45%, #fbebf7 100%);
  border: 1px solid rgba(220, 140, 200, 0.6);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 45px rgba(180, 60, 140, 0.15);
  text-align: center;
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.garba-banner-tag {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ad287b;
  padding: 0.35rem 1.4rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid #f2d4ee;
  box-shadow: 0 4px 12px rgba(180, 40, 120, 0.15);
  margin-bottom: 1.1rem;
}

.garba-festive-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 1.7rem;
  margin-bottom: 1.2rem;
  animation: heartPulse 3s ease-in-out infinite;
}

.garba-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-primary);
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.garba-location {
  margin-top: 1.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.garba-sparkles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.garba-sparkle-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff7597;
  box-shadow: 0 0 8px #ff4d79, 0 0 14px #ffd6e0;
  animation: twinkle 2.5s ease-in-out infinite;
}

/* Modal Story Description */
.modal-story-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  text-align: center;
  padding: 0 0.5rem;
  margin-bottom: 1.8rem;
}

/* ==========================================================================
   CINEMATIC VIDEO-STYLE STORY NAVIGATION BAR
   ========================================================================== */

.modal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 182, 193, 0.45);
}

.modal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  border: none;
  user-select: none;
}

.modal-prev-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 182, 193, 0.65);
  color: var(--text-secondary);
}

.modal-prev-btn:hover {
  background: #ffffff;
  color: var(--pink-primary);
  border-color: var(--pink-primary);
  transform: translateX(-2px);
}

.modal-next-btn {
  background: linear-gradient(135deg, #ff4d79 0%, #ff7597 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(255, 77, 121, 0.35);
}

.modal-next-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(255, 77, 121, 0.45);
}

.modal-mini-world-btn {
  background: linear-gradient(135deg, #e64980 0%, #f783ac 100%);
}

.modal-nav-counter {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Cinematic Video Slide Transitions for Modal Content */
.milestone-modal-content {
  transition: transform 0.22s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.22s ease;
}

.slide-out-to-left {
  opacity: 0;
  transform: translateX(-28px);
}

.slide-in-from-right {
  animation: slideInFromRight 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-out-to-right {
  opacity: 0;
  transform: translateX(28px);
}

.slide-in-from-left {
  animation: slideInFromLeft 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(28px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-28px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Milestone Card Action Flex Container */
.milestone-card-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.milestone-card-actions .milestone-action-btn {
  flex: 1;
}

.milestone-quick-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 182, 193, 0.7);
  color: var(--pink-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.milestone-quick-next-btn:hover {
  background: #ffffff;
  border-color: var(--pink-primary);
  transform: translateX(2px);
}

/* Small Screen Optimizations */
@media (max-width: 480px) {
  .modal-dialog {
    padding: 2rem 1.25rem 1.8rem;
    max-height: 88vh;
    border-radius: 22px;
  }

  .modal-close-btn {
    top: 0.8rem;
    right: 0.8rem;
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }

  .modal-header {
    padding: 0 0.25rem;
    margin-bottom: 1.2rem;
  }

  .modal-title {
    font-size: 1.45rem;
  }

  .milestone-media-img,
  .modal-img {
    max-height: 40vh;
  }

  .custom-video-element {
    max-height: 36vh;
  }

  .milestone-keepsake-img {
    max-height: 36vh;
  }

  .first-kiss-card,
  .first-date-card,
  .garba-card,
  .holding-hands-frame {
    padding: 1.8rem 1rem;
    border-radius: 16px;
  }

  .kiss-quote,
  .first-date-quote,
  .garba-quote {
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .modal-nav-bar {
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
  }

  .modal-nav-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .modal-nav-counter {
    width: 100%;
    order: -1;
    text-align: center;
    margin-bottom: 0.2rem;
  }
}
