/* ============================================================
   PREMIUM MICRO-INTERACTIONS — World Class Animations
   Ripple effects, Spring animations, Depth effects, Glow trails
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   1. BUTTON RIPPLE EFFECT (Material Design inspired)
   ══════════════════════════════════════════════════════════ */

.btn-primary,
.btn-danger,
.btn-ghost,
.btn-premium,
.pkg-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary::after,
.btn-danger::after,
.btn-premium::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 cubic-bezier(0.4, 0, 0.2, 1),
              height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.btn-primary:active::after,
.btn-danger:active::after,
.btn-premium:active::after {
  width: 400px;
  height: 400px;
  transition: width 0s, height 0s;
}

/* ══════════════════════════════════════════════════════════
   2. SPRING HOVER ANIMATIONS (Bouncy feel)
   ══════════════════════════════════════════════════════════ */

.poster-card,
.pkg-card,
.movie-list-card {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.poster-card:hover {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9),
              0 0 0 1px rgba(79, 142, 247, 0.3);
  z-index: 100;
}

.pkg-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* ══════════════════════════════════════════════════════════
   3. GLOW TRAIL EFFECT (Package cards)
   ══════════════════════════════════════════════════════════ */

.pkg-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(79, 142, 247, 0.4) 60deg,
    rgba(139, 92, 246, 0.3) 120deg,
    rgba(240, 180, 41, 0.3) 180deg,
    rgba(79, 142, 247, 0.4) 240deg,
    transparent 300deg
  );
  border-radius: inherit;
  animation: rotate-glow 4s linear infinite;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.pkg-card:hover::before {
  opacity: 1;
}

.pkg-card.selected::before {
  opacity: 1;
  animation: rotate-glow 2s linear infinite;
}

@keyframes rotate-glow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mask for glow */
.pkg-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: inherit;
  z-index: -1;
}

/* ══════════════════════════════════════════════════════════
   4. BUTTON SHINE EFFECT (Premium gold buttons)
   ══════════════════════════════════════════════════════════ */

.btn-hd-access,
.btn-premium {
  background-size: 200% 100%;
  background-position: 100% 0;
  transition: background-position 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-hd-access:hover,
.btn-premium:hover {
  background-position: 0 0;
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════════
   5. CARD DEPTH EFFECT (3D transform on hover)
   ══════════════════════════════════════════════════════════ */

.poster-card {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.poster-card .poster-img-wrap {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.poster-card:hover .poster-img-wrap {
  transform: rotateX(2deg) rotateY(2deg) translateZ(10px);
}

/* Info overlay slides up with smooth easing */
.poster-card .p-info {
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.poster-card:hover .p-info {
  transform: translateY(-4px);
}

/* ══════════════════════════════════════════════════════════
   6. MAGNETIC BUTTON EFFECT (Subtle pull towards cursor)
   ══════════════════════════════════════════════════════════ */

@media (hover: hover) and (pointer: fine) {
  .btn-primary,
  .btn-danger {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  /* Applied via JS for true magnetic effect */
  .btn-magnetic {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ══════════════════════════════════════════════════════════
   7. ICON BOUNCE (Icons inside buttons)
   ══════════════════════════════════════════════════════════ */

.btn-primary i,
.btn-danger i,
.btn-watch i {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-primary:hover i,
.btn-danger:hover i {
  transform: scale(1.15) rotate(-5deg);
}

.btn-watch:hover i {
  transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════
   8. CATEGORY TAB ACTIVE INDICATOR (Smooth slide)
   ══════════════════════════════════════════════════════════ */

.cat-tabs {
  position: relative;
}

.cat-tabs::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--grad-blue);
  border-radius: 2px 2px 0 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(79, 142, 247, 0.6);
}

/* Positioned via JS based on active tab */

/* ══════════════════════════════════════════════════════════
   9. LOADING STATE PULSE (Buttons and cards)
   ══════════════════════════════════════════════════════════ */

@keyframes pulse-loading {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.98);
  }
}

.btn-primary.loading,
.btn-danger.loading {
  pointer-events: none;
  animation: pulse-loading 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.btn-primary.loading::after,
.btn-danger.loading::after {
  display: none;
}

/* ══════════════════════════════════════════════════════════
   10. PACKAGE CARD SELECTION ANIMATION
   ══════════════════════════════════════════════════════════ */

.pkg-card {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pkg-card.selected {
  transform: scale(1.03);
  border-color: rgba(79, 142, 247, 0.6);
  background: rgba(79, 142, 247, 0.12);
  box-shadow: 0 0 0 4px rgba(79, 142, 247, 0.15),
              0 12px 40px rgba(79, 142, 247, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pkg-card.selected .pkg-name {
  animation: text-glow 2s ease-in-out infinite;
}

@keyframes text-glow {
  0%, 100% {
    text-shadow: 0 0 8px rgba(79, 142, 247, 0.4);
  }
  50% {
    text-shadow: 0 0 16px rgba(79, 142, 247, 0.8);
  }
}

/* ══════════════════════════════════════════════════════════
   11. MODAL ENTER/EXIT ANIMATIONS
   ══════════════════════════════════════════════════════════ */

.modal-overlay {
  animation: fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal {
  animation: slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ══════════════════════════════════════════════════════════
   12. HERO BANNER PARALLAX EFFECT
   ══════════════════════════════════════════════════════════ */

.hero-banner {
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Applied via JS for mouse movement parallax */
.hero-banner.parallax {
  transform: translate3d(var(--tx, 0), var(--ty, 0), 0);
}

/* ══════════════════════════════════════════════════════════
   13. INPUT FOCUS GLOW
   ══════════════════════════════════════════════════════════ */

.form-input,
.premium-input {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.premium-input:focus {
  border-color: rgba(79, 142, 247, 0.5);
  box-shadow: 0 0 0 4px rgba(79, 142, 247, 0.12),
              0 4px 20px rgba(79, 142, 247, 0.15);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
   14. STAR RATING HOVER EFFECT
   ══════════════════════════════════════════════════════════ */

.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-stars i {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rating-stars:hover i {
  transform: scale(1.1);
}

.rating-stars i:hover ~ i {
  transform: scale(0.95);
}

/* ══════════════════════════════════════════════════════════
   15. PREMIUM BADGE FLOAT
   ══════════════════════════════════════════════════════════ */

.pkg-popular-badge,
.badge-premium {
  animation: float-badge 3s ease-in-out infinite;
}

@keyframes float-badge {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(-2deg);
  }
}

/* ══════════════════════════════════════════════════════════
   16. SCROLL REVEAL ANIMATIONS
   ══════════════════════════════════════════════════════════ */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation */
.reveal-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.5s; }

/* ══════════════════════════════════════════════════════════
   17. TOAST NOTIFICATION SLIDE-IN
   ══════════════════════════════════════════════════════════ */

.toast {
  animation: slide-in-right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.removing {
  animation: slide-out-right 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slide-out-right {
  to {
    opacity: 0;
    transform: translateX(120%) scale(0.9);
  }
}

/* ══════════════════════════════════════════════════════════
   18. PERFORMANCE OPTIMIZATIONS
   ══════════════════════════════════════════════════════════ */

/* Hardware acceleration */
.poster-card,
.pkg-card,
.btn-primary,
.btn-danger,
.modal {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .poster-card:hover,
  .pkg-card:hover {
    transform: none;
  }
}

/* ══════════════════════════════════════════════════════════
   19. ADMIN STAT CARD COUNT-UP ANIMATION
   ══════════════════════════════════════════════════════════ */

@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-val {
  animation: count-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ══════════════════════════════════════════════════════════
   20. PAYMENT SUCCESS CONFETTI EFFECT
   ══════════════════════════════════════════════════════════ */

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--gold);
  animation: confetti-fall 3s linear infinite;
  z-index: 9999;
  pointer-events: none;
}

.confetti:nth-child(2n) { background: var(--blue); animation-delay: 0.2s; }
.confetti:nth-child(3n) { background: var(--purple); animation-delay: 0.4s; }
.confetti:nth-child(4n) { background: var(--teal); animation-delay: 0.6s; }

/* ══════════════════════════════════════════════════════════
   USAGE NOTES
   ══════════════════════════════════════════════════════════
   
   All animations use cubic-bezier easing for premium feel:
   - Standard: cubic-bezier(0.4, 0, 0.2, 1)
   - Spring: cubic-bezier(0.34, 1.56, 0.64, 1)
   
   Hardware acceleration enabled for smooth 60fps
   Respects prefers-reduced-motion for accessibility
   All effects optimized for mobile performance
   
   ══════════════════════════════════════════════════════════ */
