/* ================================
   ANIMATIONS
   Keyframes, Scroll Animations, Effects
   ================================ */

/* ===== KEYFRAME ANIMATIONS ===== */

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

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

/* Slide Down */
@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

/* Shimmer Effect (for buttons/CTA) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* Draw Line (for underlines) */
@keyframes drawLine {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

/* ===== ANIMATION CLASSES ===== */

/* Fade Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

/* Scale Animation */
.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* Pulse Animation */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

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

/* ===== STAGGERED ANIMATIONS ===== */
.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;
}

/* ===== SCROLL ANIMATIONS ===== */
/* Elements start hidden and animate in when scrolled into view */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Scroll Animation Variants */
.scroll-fade {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.scroll-fade.active {
    opacity: 1;
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-slide-left.active {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-slide-right.active {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ===== HOVER EFFECTS ===== */

/* Image Zoom on Hover */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.5s ease;
}

.hover-zoom:hover img {
    transform: scale(1.1);
}

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

/* Underline on Hover */
.hover-underline {
    position: relative;
    display: inline-block;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* Gradient Shift on Hover */
.hover-gradient {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    transition: background-position 0.5s ease;
}

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

/* Glow Effect on Hover */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.5);
}

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

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray) 25%,
        var(--color-light-gray) 50%,
        var(--color-gray) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-gray);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* ===== PARALLAX EFFECT ===== */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===== BUTTON SPECIAL EFFECTS ===== */

/* Shimmer Button */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-shimmer:hover::before {
    left: 100%;
}

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

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

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ===== TEXT ANIMATIONS ===== */

/* Gradient Text */
.text-gradient {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation: typing 3s steps(40) 1s forwards;
}

/* ===== MODAL/OVERLAY ANIMATIONS ===== */
.modal-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.modal-slide-up {
    animation: fadeInUp 0.4s ease-out;
}

/* ===== SCROLL INDICATOR ===== */
@keyframes scrollIndicator {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px);
    }
}

.scroll-indicator {
    animation: scrollIndicator 2s ease-in-out infinite;
}

/* ===== DISABLE ANIMATIONS FOR 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;
    }
}
