/* =================================================================
   ANIMATIONS.CSS - FATHURWEB.XYZ OPTIMIZED EDITION
   Animasi yang dioptimalkan untuk pengalaman pengguna yang lebih baik
   ================================================================= */

/* ============================================
   CORE ANIMATIONS - OPTIMIZED
   ============================================ */

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* Scale Animations - Subtle */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gentleBounce {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Animations - Reduced */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

/* ============================================
   SUBTLE SPECIAL EFFECTS
   ============================================ */

/* Gentle Glow */
@keyframes subtleGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 191, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(0, 191, 255, 0.4);
    }
}

/* Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

/* Floating Animation - Reduced */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* ============================================
   UTILITY ANIMATION CLASSES - OPTIMIZED
   ============================================ */

/* Basic Entrance Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.bounce-in {
    animation: gentleBounce 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* Animation Delays - Reduced */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ============================================
   SCROLL TRIGGERED ANIMATIONS - OPTIMIZED
   ============================================ */

/* Elements that animate on scroll */
.appear-animation {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.appear-animation.in-view {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease-out;
}

.slide-in-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.6s ease-out;
}

.slide-in-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.slide-in-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.bounce-in {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s ease-out;
}

.bounce-in.in-view {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   HOVER ANIMATIONS - SUBTLE
   ============================================ */

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

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

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

/* Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 191, 255, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   SPECIAL EFFECTS - MINIMAL
   ============================================ */

/* Typing Animation */
.typing-animation {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Floating Animation */
.floating {
    animation: gentleFloat 3s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Reduce animation intensity on mobile devices */
@media (max-width: 768px) {
    .bounce-in,
    .slide-in-left,
    .slide-in-right,
    .slide-in-up,
    .appear-animation {
        animation-duration: 0.4s;
        transition-duration: 0.4s;
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hide elements initially for animation */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Animation states */
.paused {
    animation-play-state: paused;
}

.running {
    animation-play-state: running;
}

/* Card Entrance Animation - Simplified */
.card-entrance {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s ease-out;
}

.card-entrance.visible {
    opacity: 1;
    transform: translateY(0);
}