/* =====================================================
   HYDROSISTEM - Animations Stylesheet
   Lightweight CSS Animations (No external libraries)
   ===================================================== */

/* Reveal Animation Base */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Fade In Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
    animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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

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

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Scale Animations */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
.slide-up {
    transform: translateY(100%);
    animation: slideUp 0.5s ease forwards;
}

.slide-down {
    transform: translateY(-100%);
    animation: slideDown 0.5s ease forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    to {
        transform: translateY(0);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s infinite;
}

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

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Float Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Glow Animation */
.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(var(--c-brand-rgb), 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(var(--c-brand-rgb), 0.4);
    }
}

/* Rotate Animation */
.rotate {
    animation: rotate 1s linear infinite;
}

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

/* Flip Animation */
.flip-in {
    animation: flipIn 0.6s ease forwards;
    transform-style: preserve-3d;
}

@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

/* Wave Text Animation */
.wave-text span {
    display: inline-block;
    animation: wave 1s ease-in-out infinite;
}

.wave-text span:nth-child(2) { animation-delay: 0.1s; }
.wave-text span:nth-child(3) { animation-delay: 0.2s; }
.wave-text span:nth-child(4) { animation-delay: 0.3s; }
.wave-text span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 2px solid var(--c-brand);
    white-space: nowrap;
    animation: typing 3s steps(30) forwards, blink 0.7s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Gradient Animation */
.gradient-animate {
    background: linear-gradient(270deg, var(--c-brand), var(--c-brand-light), var(--c-brand));
    background-size: 600% 600%;
    animation: gradientShift 5s ease infinite;
}

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

/* Border Animation */
.border-animate {
    position: relative;
}

.border-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--c-brand);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.border-animate:hover::after {
    width: 100%;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Hover Scale Effect */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Hover Rotate Effect */
.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Button Loading Animation */
.btn-loader i {
    animation: rotate 1s linear infinite;
}

/* Counter Animation (CSS-only visual) */
.counter-animate {
    transition: all 0.5s ease;
}

/* Card Entrance Animation */
.card-entrance {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Smooth Hover for Links */
.link-hover {
    position: relative;
    display: inline-block;
}

.link-hover::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--c-brand);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.link-hover:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Image Reveal Animation */
.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--c-brand);
    transform: translateX(-100%);
    z-index: 1;
}

.img-reveal.revealed::before {
    animation: imgReveal 0.8s ease forwards;
}

@keyframes imgReveal {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Text Highlight Animation */
.text-highlight {
    background: linear-gradient(90deg, transparent 50%, rgba(var(--c-brand-rgb), 0.2) 50%);
    background-size: 200% 100%;
    background-position: 0% 0%;
    transition: background-position 0.3s ease;
}

.text-highlight:hover {
    background-position: -100% 0%;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.ripple:active::after {
    transform: translate(-50%, -50%) scale(4);
    opacity: 1;
    transition: 0s;
}

/* Progress Bar Animation */
.progress-bar {
    background-color: var(--c-gray);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c-brand) 0%, var(--c-brand-light) 100%);
    border-radius: 2px;
    transition: width 1s ease;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
