/* ===== ENHANCED ANIMATIONS & EFFECTS ===== */

/* Base Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animate {
    opacity: 1;
}

/* ===== RISE EFFECTS ===== */
@keyframes riseUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes riseUpBounce {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rise-up {
    animation: riseUp 0.8s ease-out forwards;
}

.rise-up-slow {
    animation: riseUpSlow 1.2s ease-out forwards;
}

.rise-up-bounce {
    animation: riseUpBounce 1s ease-out forwards;
}

/* ===== WIPE EFFECTS ===== */
@keyframes wipeLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        clip-path: inset(0 0% 0 0);
    }
}

@keyframes wipeRight {
    from {
        opacity: 0;
        transform: translateX(100px);
        clip-path: inset(0 0 0 100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        clip-path: inset(0 0 0 0%);
    }
}

@keyframes wipeDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
        clip-path: inset(100% 0 0 0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        clip-path: inset(0% 0 0 0);
    }
}

.wipe-left {
    animation: wipeLeft 0.8s ease-out forwards;
}

.wipe-right {
    animation: wipeRight 0.8s ease-out forwards;
}

.wipe-down {
    animation: wipeDown 0.8s ease-out forwards;
}

/* ===== PAN EFFECTS ===== */
@keyframes panZoom {
    from {
        opacity: 0;
        transform: scale(0.8) translateX(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes panSlide {
    from {
        opacity: 0;
        transform: translateX(-50px) rotateY(15deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

.pan-zoom {
    animation: panZoom 1s ease-out forwards;
}

.pan-slide {
    animation: panSlide 0.8s ease-out forwards;
}

/* ===== FADE EFFECTS ===== */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInRotate {
    from {
        opacity: 0;
        transform: scale(0.9) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.fade-in-scale {
    animation: fadeInScale 0.8s ease-out forwards;
}

.fade-in-rotate {
    animation: fadeInRotate 1s ease-out forwards;
}

/* ===== HERO SECTION ANIMATIONS ===== */
.hero-content.animate {
    animation: wipeRight 1s ease-out forwards;
}

.hero-image.animate {
    animation: panZoom 1.2s ease-out 0.3s forwards;
}

.hero-image-placeholder {
    transition: transform 0.3s ease;
}

.hero-image-placeholder:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Enhanced badge animations */
.decoration-badge {
    animation: float 3s ease-in-out infinite;
}

.badge-1 {
    animation-delay: 0s;
}

.badge-2 {
    animation-delay: 1.5s;
}

.badge-3 {
    animation-delay: 0.5s;
}

/* ===== TENTANG SECTION ANIMATIONS ===== */
.tentang-content .animate:nth-child(1) {
    animation: wipeLeft 0.8s ease-out forwards;
}

.tentang-content .animate:nth-child(2) {
    animation: wipeRight 0.8s ease-out 0.2s forwards;
}

.tentang-features li {
    opacity: 0;
    animation: riseUp 0.6s ease-out forwards;
}

.tentang-features li:nth-child(1) { animation-delay: 0.1s; }
.tentang-features li:nth-child(2) { animation-delay: 0.2s; }
.tentang-features li:nth-child(3) { animation-delay: 0.3s; }
.tentang-features li:nth-child(4) { animation-delay: 0.4s; }
.tentang-features li:nth-child(5) { animation-delay: 0.5s; }

/* ===== PROBLEM SOLUTION ANIMATIONS ===== */
.problem-side.animate {
    animation: wipeLeft 0.8s ease-out forwards;
}

.solution-side.animate {
    animation: wipeRight 0.8s ease-out 0.3s forwards;
}

.problem-solution-image.animate {
    animation: fadeInScale 1s ease-out 0.6s forwards;
}

/* ===== JOURNEY SECTION ANIMATIONS ===== */
.timeline-step {
    opacity: 0;
}

.timeline-step.animate {
    animation: panSlide 0.8s ease-out forwards;
}

.timeline-step:nth-child(1) { animation-delay: 0.1s; }
.timeline-step:nth-child(2) { animation-delay: 0.2s; }
.timeline-step:nth-child(3) { animation-delay: 0.3s; }
.timeline-step:nth-child(4) { animation-delay: 0.4s; }
.timeline-step:nth-child(5) { animation-delay: 0.5s; }

/* Package cards animations */
.package-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s ease-out;
}

.package-card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.compact-card {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.compact-card.animate {
    opacity: 1;
    transform: translateX(0);
}

/* ===== KEUNGGULAN SECTION - MOBILE SPECIFIC ANIMATIONS ===== */
@media (max-width: 768px) {
    /* Card 1 - Rise Up */
    .flip-card:nth-child(1) {
        opacity: 0;
        transform: translateY(50px);
        transition: all 0.8s ease-out;
    }
    
    .flip-card:nth-child(1).animate {
        animation: riseUp 0.8s ease-out forwards;
    }
    
    /* Card 2 - Wipe Left */
    .flip-card:nth-child(2) {
        opacity: 0;
        transform: translateX(-50px);
        transition: all 0.8s ease-out;
    }
    
    .flip-card:nth-child(2).animate {
        animation: wipeLeft 0.8s ease-out 0.2s forwards;
    }
    
    /* Card 3 - Pan Zoom */
    .flip-card:nth-child(3) {
        opacity: 0;
        transform: scale(0.8) translateX(-30px);
        transition: all 0.8s ease-out;
    }
    
    .flip-card:nth-child(3).animate {
        animation: panZoom 0.8s ease-out 0.4s forwards;
    }
    
    /* Card 4 - Rise Bounce */
    .flip-card:nth-child(4) {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
        transition: all 0.8s ease-out;
    }
    
    .flip-card:nth-child(4).animate {
        animation: riseUpBounce 1s ease-out 0.6s forwards;
    }
    
    /* Card 5 (Static) - Fade Rotate */
    .static-card {
        opacity: 0;
        transform: scale(0.9) rotate(-5deg);
        transition: all 0.8s ease-out;
    }
    
    .static-card.animate {
        animation: fadeInRotate 1s ease-out 0.8s forwards;
    }
}

/* Desktop keunggulan animations enhancement */
@media (min-width: 769px) {
    .flip-card {
        opacity: 0;
        transform: translateY(40px);
        transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .flip-card.animate {
        opacity: 1;
        transform: translateY(0);
    }
    
    .flip-card:nth-child(1) { transition-delay: 0.1s; }
    .flip-card:nth-child(2) { transition-delay: 0.2s; }
    .flip-card:nth-child(3) { transition-delay: 0.3s; }
    .flip-card:nth-child(4) { transition-delay: 0.4s; }
    
    .static-card {
        opacity: 0;
        transform: translateY(40px);
        transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s;
    }
    
    .static-card.animate {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== TESTIMONY SECTION ANIMATIONS ===== */
.vintage-newspaper {
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
    transition: all 1s ease-out;
}

.vintage-newspaper.animate {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

.testimonial-slide {
    transform: translateX(30px);
    transition: all 0.6s ease-in-out;
}

.testimonial-slide.active {
    transform: translateX(0);
}

/* ===== STATS SECTION ANIMATIONS ===== */
.progress-stat-item {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.progress-stat-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.progress-stat-item:nth-child(1) { transition-delay: 0.1s; }
.progress-stat-item:nth-child(2) { transition-delay: 0.2s; }
.progress-stat-item:nth-child(3) { transition-delay: 0.3s; }
.progress-stat-item:nth-child(4) { transition-delay: 0.4s; }

/* Enhanced progress bar animation */
@keyframes progressGlow {
    0% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
}

.progress-fill {
    animation: progressFill 3s ease-out, progressGlow 2s ease-in-out infinite;
}

/* ===== SCROLL TRIGGERED ANIMATIONS ===== */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    opacity: 0;
    animation: slideInFromBottom 0.8s ease-out forwards;
}

/* ===== HOVER ENHANCEMENTS ===== */
.package-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.package-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.compact-card:hover {
    transform: translateY(-8px) rotateZ(1deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* ===== STAGGER ANIMATIONS ===== */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.stagger-animation.animate > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animation.animate > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animation.animate > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animation.animate > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animation.animate > *:nth-child(5) { transition-delay: 0.5s; }

.stagger-animation.animate > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===== MOBILE SPECIFIC ENHANCEMENTS ===== */
@media (max-width: 768px) {
    /* Reduced animation durations for mobile */
    .animate-on-scroll {
        transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Enhanced touch interactions */
    .package-card:active,
    .compact-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Hero image mobile enhancement */
    .hero-image-container {
        transition: transform 0.3s ease;
    }
    
    .hero-image-container:active {
        transform: scale(0.98);
    }
}

/* ===== LOADING STATES ===== */
@keyframes shimmerWave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.loading-shimmer {
    position: relative;
    overflow: hidden;
}

.loading-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmerWave 1.5s infinite;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.animate-on-scroll,
.flip-card,
.package-card,
.compact-card {
    will-change: transform, opacity;
}

/* Reduce animations on slow devices */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}