/* ===================================
   Dictator Website - Animations
   Scroll-triggered animations and transitions
   =================================== */

/* Animation Delays */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* Base Animation Classes */
.animate-fade-up,
.animate-fade-left,
.animate-fade-right,
.animate-scale-in {
    opacity: 0;
    animation-fill-mode: forwards;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fade Up Animation */
.animate-fade-up {
    transform: translateY(30px);
    animation-name: fadeUp;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade Left Animation */
.animate-fade-left {
    transform: translateX(50px);
    animation-name: fadeLeft;
}

@keyframes fadeLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade Right Animation */
.animate-fade-right {
    transform: translateX(-50px);
    animation-name: fadeRight;
}

@keyframes fadeRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
.animate-scale-in {
    transform: scale(0.95);
    animation-name: scaleIn;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll-triggered animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for grid items */
.scroll-animate[data-delay="1"] {
    transition-delay: 0.1s;
}

.scroll-animate[data-delay="2"] {
    transition-delay: 0.2s;
}

.scroll-animate[data-delay="3"] {
    transition-delay: 0.3s;
}

.scroll-animate[data-delay="4"] {
    transition-delay: 0.4s;
}

.scroll-animate[data-delay="5"] {
    transition-delay: 0.5s;
}

.scroll-animate[data-delay="6"] {
    transition-delay: 0.6s;
}

/* Hero Glow Animation */
.hero-glow {
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.4;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.1);
    }
}

/* Feature Card Hover Effects */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

/* Icon Bounce on Hover */
.feature-card:hover .feature-icon {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* Download Card Shine Effect */
.download-card {
    overflow: hidden;
}

.download-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.03) 50%,
            transparent 60%);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.8s ease;
}

.download-card:hover::after {
    transform: translateX(100%) rotate(45deg);
}

/* Button Ripple Effect */
.btn-primary,
.btn-download {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-download::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::after,
.btn-download:active::after {
    width: 300px;
    height: 300px;
}

/* Platform Icon Float */
.platform-icon {
    animation: float 3s ease-in-out infinite;
}

.platform-icon:nth-child(1) {
    animation-delay: 0s;
}

.platform-icon:nth-child(2) {
    animation-delay: 0.2s;
}

.platform-icon:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Screenshot Card Tilt Effect */
.screenshot-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Mobile Preview Float Animation */
.mobile-preview {
    animation: mobileFloat 4s ease-in-out infinite;
}

@keyframes mobileFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }
}

/* Nav scroll effect */
.nav {
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Slider dot transition */
.slider-dot {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Loading Animation for Images */
.screenshot-image img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.screenshot-image img.loaded {
    opacity: 1;
}

/* Gradient Text Shimmer */
.gradient-text {
    background-size: 200% 200%;
    animation: gradientShimmer 4s ease infinite;
}

@keyframes gradientShimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Section Divider Animation */
.features::before {
    animation: dividerGlow 3s ease-in-out infinite;
}

@keyframes dividerGlow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 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;
    }

    .scroll-animate {
        opacity: 1;
        transform: none;
    }
}