/* MyFreeCams - Keyframe Animations & Micro-interactions */

/* Fade Up Reveal */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade Left Reveal */
@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Zoom In Scale */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Floating Aura Orb Animation */
@keyframes floatOrb {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

/* Glowing Pulse Effect */
@keyframes pulse-glow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(233, 30, 99, 0.4);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 25px rgba(233, 30, 99, 0.8), 0 0 35px rgba(139, 92, 246, 0.6);
    transform: scale(1.04);
  }
}

/* Click Ripple Animation */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleScale 0.6s linear;
  pointer-events: none;
}

@keyframes rippleScale {
  to {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
  }
}

/* Shimmer Skeleton Loading */
@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-surface) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* Scroll Reveal Classes */
.reveal {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }
.delay-4 { transition-delay: 0.6s; }

/* Floating Decorative Shapes */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 8s ease-in-out infinite;
}

.orb-pink {
  width: 300px;
  height: 300px;
  background: rgba(233, 30, 99, 0.15);
}

.orb-purple {
  width: 350px;
  height: 350px;
  background: rgba(139, 92, 246, 0.15);
}

.orb-gold {
  width: 250px;
  height: 250px;
  background: rgba(245, 158, 11, 0.12);
}

/* Image Zoom Hover */
.zoom-on-hover {
  overflow: hidden;
}

.zoom-on-hover img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.zoom-on-hover:hover img {
  transform: scale(1.08);
}

/* Micro-interaction: Social Button Enhanced Hover */
.social-btn {
  transition: var(--transition-bounce);
}

.social-btn:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: var(--shadow-glow);
}

/* Micro-interaction: Card Slight Parallax on Hover */
.card-article {
  will-change: transform;
}

/* Micro-interaction: Image Load with Subtle Fade */
.card-image-wrap img {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-image-wrap img.loaded {
  opacity: 1;
}

.card-image-wrap img[src] {
  opacity: 1;
}

/* Micro-interaction: Badge Subtle Pulse */
.badge {
  transition: var(--transition-fast);
}

/* Micro-interaction: Navigation Link Smooth Underline */
.nav-link::after {
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Micro-interaction: Reading Progress Bar Smooth Motion */
.reading-progress-bar {
  transition: width 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Micro-interaction: Card Footer Hover Lift */
.card-footer {
  transition: var(--transition-fast);
}

/* Micro-interaction: Filter Pill Scale on Active */
.homepage-filter-pill.active,
.filter-pill.active {
  transform: scale(1.02);
}

/* Micro-interaction: Action Button Smooth Icon Spin */
.action-btn i {
  transition: transform 0.3s ease;
}

.action-btn:hover i {
  transform: scale(1.15);
}

/* Micro-interaction: Author Avatar Gentle Border Glow */
.author-avatar {
  transition: box-shadow 0.4s ease;
}

.card-article:hover .author-avatar {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Micro-interaction: Newsletter Input Focus */
.newsletter-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  transition: all 0.3s ease;
}

/* Micro-interaction: Mega Menu Link Slide */
.mega-column ul li a i {
  transition: transform 0.3s ease;
}

.mega-column ul li a:hover i {
  transform: translateX(3px);
}

/* Micro-interaction: Comment Form Button */
.comment-form button[type="submit"]:hover {
  transform: translateY(-2px) scale(1.02);
}

/* Smooth Counter Animation for Like */
.like-btn i {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Micro-interaction: Toast Slide Enhancement */
.toast {
  animation: slideInRight 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Micro-interaction: Mobile Drawer Smooth */
.mobile-nav-drawer {
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ====== Galaxy / Space Animations (Dark Mode Only) ====== */

/* Star twinkle - realistic with varied opacity */
@keyframes starTwinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  20% { opacity: 0.4; transform: scale(0.9); }
  40% { opacity: 1; transform: scale(1.2); }
  60% { opacity: 0.5; transform: scale(1.05); }
  80% { opacity: 0.2; transform: scale(0.85); }
}

/* Nebula drift */
@keyframes nebulaDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(20px, 15px) scale(1.02); }
}

/* Moon glow pulse */
@keyframes moonGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(253, 230, 138, 0.15), 0 0 80px rgba(253, 230, 138, 0.08), 0 0 120px rgba(253, 230, 138, 0.04); }
  50% { box-shadow: 0 0 60px rgba(253, 230, 138, 0.25), 0 0 100px rgba(253, 230, 138, 0.12), 0 0 150px rgba(253, 230, 138, 0.06); }
}

/* Floating particle drift */
@keyframes particleDrift {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { transform: translate(var(--drift-x, 40px), var(--drift-y, -60px)) scale(0.3); opacity: 0; }
}

/* Shimmering galaxy text gradient */
@keyframes galaxyShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Sparkle dots on headings */
@keyframes sparklePop {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  30% { opacity: 1; transform: scale(1.2) rotate(20deg); }
  60% { opacity: 0.8; transform: scale(1) rotate(-10deg); }
  80% { opacity: 0.3; transform: scale(0.6) rotate(5deg); }
}

/* Cosmic border glow pulse */
@keyframes cosmicBorderGlow {
  0%, 100% { border-color: rgba(255,117,151,0.15); box-shadow: 0 0 15px rgba(124,58,237,0.05); }
  50% { border-color: rgba(124,58,237,0.35); box-shadow: 0 0 30px rgba(124,58,237,0.12); }
}

/* Apply cosmic border only in dark mode */
[data-theme="dark"] .page-galaxy .cosmic-border {
  animation: cosmicBorderGlow 4s ease-in-out infinite;
}

/* ====== 3D Hero Animations ====== */

/* Floating 3D text layers */
@keyframes float3d {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-10px) rotateX(2deg); }
}

/* Hero decorative 3D ring pulse */
@keyframes ringPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.2; }
  50% { transform: scale(1.08) rotate(5deg); opacity: 0.4; }
}

/* Hero background glow pulse */
@keyframes heroGlowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* Shimmer on hero heading */
@keyframes heroShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Entrance stagger for hero elements */
.hero-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-stagger > *:nth-child(1) { animation-delay: 0.2s; }
.hero-stagger > *:nth-child(2) { animation-delay: 0.4s; }
.hero-stagger > *:nth-child(3) { animation-delay: 0.6s; }
.hero-stagger > *:nth-child(4) { animation-delay: 0.8s; }

@keyframes heroFadeUp {
  to { opacity: 1; transform: translateY(0); }
}
