/* ===== ENHANCED ANIMATIONS & PROFESSIONAL POLISH ===== */
/* Love App v2.0 - Professional Animation Enhancement */

/* === PERFORMANCE OPTIMIZATIONS === */

/* Enable hardware acceleration for smooth animations */
.password-screen,
.splash-screen,
.modal,
.notification-toast,
.sidebar,
.main-content,
.floating-messages .message,
.snowflake,
.password-container,
.love-meter-fill,
.wheel {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* === REFINED PAGE TRANSITIONS === */

/* Splash screen enhanced animation */
.splash-screen {
  animation: splashFadeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes splashFadeIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Enhanced typing cursor animation */
.cursor {
  animation: blinkSmooth 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes blinkSmooth {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* === FLOATING MESSAGES ENHANCEMENT === */

.floating-messages .message {
  animation: floatSmooth var(--duration, 20s) cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-messages .message:hover {
  transform: scale(1.15) translateY(-5px);
  text-shadow: 0 8px 20px rgba(255, 20, 147, 0.4);
  z-index: 10;
  animation-play-state: paused;
}

@keyframes floatSmooth {
  0% {
    transform: translateY(100vh) rotate(0deg) translateX(0);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg) translateX(50px);
    opacity: 0;
  }
}

/* === SIDEBAR ENHANCEMENTS === */

.sidebar {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease;
}

.nav-item {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 20, 147, 0.1), transparent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.nav-item:hover::before,
.nav-item.active::before {
  width: 100%;
}

.nav-item:hover {
  transform: translateX(8px);
  box-shadow: 4px 0 12px rgba(255, 20, 147, 0.15);
}

.nav-item:active {
  transform: translateX(6px) scale(0.98);
}

.emoji-icon {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover .emoji-icon {
  transform: scale(1.2) rotate(10deg);
}

/* === BUTTON ENHANCEMENTS === */

button,
.open-gift-btn,
.close-popup-btn,
.password-submit,
.header-btn,
.spin-btn,
.love-meter-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

button:not(:disabled):hover,
.open-gift-btn:hover,
.close-popup-btn:hover,
.header-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

button:not(:disabled):active,
.open-gift-btn:active,
.close-popup-btn:active,
.header-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* Ripple effect for buttons */
button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::after {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

/* === MODAL ENHANCEMENTS === */

.modal {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.3s ease;
}

.modal.show {
  animation: modalBackdropFade 0.3s ease;
}

@keyframes modalBackdropFade {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
}

.modal-content {
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content:hover {
  transform: translateY(-2px);
}

/* === CARD & PHOTO ENHANCEMENTS === */

.memory-card,
.pet-photo-card,
.gift-card,
.date-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.memory-card:hover,
.pet-photo-card:hover,
.gift-card:hover,
.date-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(255, 20, 147, 0.25);
}

.memory-card:active,
.pet-photo-card:active,
.gift-card:active,
.date-card:active {
  transform: translateY(-4px) scale(1.01);
}

/* Photo loading animation */
img {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

img.loading {
  opacity: 0.5;
  filter: blur(10px);
}

img.loaded {
  opacity: 1;
  filter: blur(0);
}

/* === LOVE METER ANIMATION ENHANCEMENT === */

.love-meter-fill {
  transition: width 0.05s linear,
              background 0.5s ease;
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

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

.love-meter-percent {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* === SPIN WHEEL ENHANCEMENT === */

.wheel {
  transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.wheel.spinning {
  transition-duration: 4.5s;
}

.wheel-pointer {
  animation: pointerBounce 0.5s ease-in-out infinite alternate;
}

@keyframes pointerBounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

/* === CONFETTI ENHANCEMENT === */

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* === SNOW ENHANCEMENT === */

@keyframes snowfall {
  0% {
    transform: translateY(-20px) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) rotate(360deg) translateX(30px);
    opacity: 0;
  }
}

/* === INPUT ENHANCEMENTS === */

input,
textarea,
select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
textarea:focus,
select:focus {
  transform: scale(1.01);
}

/* === LOADING STATES === */

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 20, 147, 0.1);
  border-top-color: #ff1493;
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* === PAGE CONTENT FADE-IN === */

.page-content {
  animation: contentFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* === HEADER ACTIONS ENHANCEMENT === */

.header-btn {
  position: relative;
}

.header-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff85c8, #ff1493);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.header-btn:hover::before {
  opacity: 0.2;
}

/* === WISH LIST ANIMATION === */

.wishlist-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wishlist-item.fulfilled {
  animation: wishComplete 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wishComplete {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(255, 20, 147, 0.3);
  }
  100% {
    transform: scale(1);
  }
}

/* === ADVENT CALENDAR ENHANCEMENT === */

.advent-day {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.advent-day:not(.locked):hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 40px rgba(255, 20, 147, 0.3);
}

.advent-day.unlocked {
  animation: unlockPulse 2s ease-in-out infinite;
}

@keyframes unlockPulse {
  0%, 100% {
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.2);
  }
  50% {
    box-shadow: 0 8px 25px rgba(255, 20, 147, 0.4);
  }
}

.advent-day.locked {
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.advent-day.opened {
  animation: celebrateOpen 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrateOpen {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* === MILESTONE TIMELINE ENHANCEMENT === */

.milestone-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: milestoneSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
}

.milestone-item:nth-child(odd) {
  animation-name: milestoneSlideLeft;
}

.milestone-item:nth-child(even) {
  animation-name: milestoneSlideRight;
}

@keyframes milestoneSlideLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes milestoneSlideRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.milestone-item:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(255, 20, 147, 0.2);
}

/* === TOGGLE SWITCH ANIMATION === */

.toggle-slider {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #ff85c8, #ff1493);
}

.toggle-slider::before {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === STAGGER ANIMATIONS === */

.memory-grid > *,
.pet-photos-grid > *,
.gifts-grid > *,
.dates-grid > * {
  animation: staggerFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
}

.memory-grid > *:nth-child(1),
.pet-photos-grid > *:nth-child(1),
.gifts-grid > *:nth-child(1),
.dates-grid > *:nth-child(1) { animation-delay: 0.05s; }

.memory-grid > *:nth-child(2),
.pet-photos-grid > *:nth-child(2),
.gifts-grid > *:nth-child(2),
.dates-grid > *:nth-child(2) { animation-delay: 0.1s; }

.memory-grid > *:nth-child(3),
.pet-photos-grid > *:nth-child(3),
.gifts-grid > *:nth-child(3),
.dates-grid > *:nth-child(3) { animation-delay: 0.15s; }

.memory-grid > *:nth-child(4),
.pet-photos-grid > *:nth-child(4),
.gifts-grid > *:nth-child(4),
.dates-grid > *:nth-child(4) { animation-delay: 0.2s; }

.memory-grid > *:nth-child(n+5),
.pet-photos-grid > *:nth-child(n+5),
.gifts-grid > *:nth-child(n+5),
.dates-grid > *:nth-child(n+5) { animation-delay: 0.25s; }

@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === REDUCED MOTION SUPPORT === */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === MOBILE TOUCH FEEDBACK === */

@media (hover: none) and (pointer: coarse) {
  button:active,
  .nav-item:active,
  .memory-card:active,
  .pet-photo-card:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* === DARK MODE ADJUSTMENTS (for Christmas mode) === */

body.christmas-mode .notification-toast {
  background: linear-gradient(135deg, #d4af37, #ffd700);
  color: #1a472a;
}

body.christmas-mode .password-submit,
body.christmas-mode button {
  background: linear-gradient(135deg, #ff0000, #00aa00);
}

body.christmas-mode .nav-item:hover .emoji-icon {
  transform: scale(1.3) rotate(-10deg);
}
