/* 
 * SeriGraf Website - Animations CSS
 * Keyframes and utility classes for scroll animations, hover effects, etc.
 */

/* ==========================================================================
   Keyframes
   ========================================================================== */

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from { transform: translateY(100%); visibility: visible; }
    to { transform: translateY(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); visibility: visible; }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); visibility: visible; }
    to { transform: translateX(0); }
}

/* Scale & Rotate */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Special Effects */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 107, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 0, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 107, 0, 0.2); }
}

@keyframes textGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% { animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
    0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); }
    20% { transform: scale3d(1.1, 1.1, 1.1); }
    40% { transform: scale3d(0.9, 0.9, 0.9); }
    60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); }
    80% { transform: scale3d(0.97, 0.97, 0.97); }
    100% { opacity: 1; transform: scale3d(1, 1, 1); }
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

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

/* ==========================================================================
   Animation Classes (Triggered by JS Intersection Observer)
   ========================================================================== */

.animate-on-scroll {
    opacity: 0;
    will-change: transform, opacity;
}

/* Default state before animation */
.fade-up { transform: translate3d(0, 40px, 0); }
.fade-down { transform: translate3d(0, -40px, 0); }
.fade-left { transform: translate3d(-40px, 0, 0); }
.fade-right { transform: translate3d(40px, 0, 0); }
.zoom-in { transform: scale(0.9); }

/* Animated states */
.animate-on-scroll.animated {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Specific animation classes for non-scroll triggers */
.animate-fadeIn { animation: fadeIn 0.8s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.8s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.8s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.8s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.8s ease forwards; }
.animate-bounceIn { animation: bounceIn 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Delays */
.delay-100 { transition-delay: 0.1s !important; animation-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; animation-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; animation-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; animation-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; animation-delay: 0.5s !important; }
.delay-600 { transition-delay: 0.6s !important; animation-delay: 0.6s !important; }
.delay-700 { transition-delay: 0.7s !important; animation-delay: 0.7s !important; }
.delay-800 { transition-delay: 0.8s !important; animation-delay: 0.8s !important; }

/* Durations */
.duration-fast { transition-duration: 0.3s !important; animation-duration: 0.3s !important; }
.duration-normal { transition-duration: 0.5s !important; animation-duration: 0.5s !important; }
.duration-slow { transition-duration: 1s !important; animation-duration: 1s !important; }

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-8px);
}

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

.hover-glow {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.3);
    border-color: rgba(255, 107, 0, 0.5);
}

/* Specific elements */
.floating-element {
    animation: float 6s ease-in-out infinite;
}

.pulse-dot {
    position: relative;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: -1;
}

.scroll-indicator {
    animation: scrollBounce 2s infinite;
}

.text-gradient-animated {
    background: linear-gradient(135deg, #FF6B00, #FFD600, #FF6B00);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 3s linear infinite;
}

.skeleton-loading {
    background: #222;
    background-image: linear-gradient(to right, #222 0%, #333 20%, #222 40%, #222 100%);
    background-repeat: no-repeat;
    background-size: 800px 100%; 
    animation: shimmer 1.5s infinite linear backwards;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Reduced Motion preference */
@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;
    }
    .floating-element, .pulse-dot::after, .scroll-indicator, .text-gradient-animated {
        animation: none !important;
    }
}
