/* ===== Keyframe Animations ===== */

/* Loader Progress */
@keyframes loadProgress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Scroll Bounce */
@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(12px); opacity: 0.5; }
}

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

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

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

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

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

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

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(201, 169, 98, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(201, 169, 98, 0.6);
    }
}

/* Text Reveal */
@keyframes textReveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Line Expand */
@keyframes lineExpand {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Parallax Float */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    25% {
        transform: translate3d(10px, -10px, 0);
    }
    50% {
        transform: translate3d(0, -20px, 0);
    }
    75% {
        transform: translate3d(-10px, -10px, 0);
    }
}

/* ===== Animation Classes ===== */

/* Slide Up */
.animate-slide-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide Down */
.animate-slide-down {
    opacity: 0;
    transform: translateY(-40px);
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide Left */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-60px);
    animation: slideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Slide Right */
.animate-slide-right {
    opacity: 0;
    transform: translateX(60px);
    animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Scale In */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Zoom In */
.animate-zoom-in {
    opacity: 0;
    transform: scale(0.8);
    animation: zoomIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Rotate In */
.animate-rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
    animation: rotateIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

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

/* ===== Animation Delays ===== */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }
.delay-9 { animation-delay: 0.9s; }
.delay-10 { animation-delay: 1s; }

/* ===== Scroll-Triggered Animations (AOS-like) ===== */
[data-aos] {
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.8s ease;
}

[data-aos="fade-up"] {
    transform: translateY(50px);
}

[data-aos="fade-down"] {
    transform: translateY(-50px);
}

[data-aos="fade-left"] {
    transform: translateX(50px);
}

[data-aos="fade-right"] {
    transform: translateX(-50px);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos="zoom-out"] {
    transform: scale(1.1);
}

[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(-100deg);
}

[data-aos="flip-left"] {
    transform: perspective(2500px) rotateY(-100deg);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotateX(0) rotateY(0);
}

/* Delay variations for AOS */
[data-aos-delay="100"] { transition-delay: 100ms; }
[data-aos-delay="150"] { transition-delay: 150ms; }
[data-aos-delay="200"] { transition-delay: 200ms; }
[data-aos-delay="250"] { transition-delay: 250ms; }
[data-aos-delay="300"] { transition-delay: 300ms; }
[data-aos-delay="400"] { transition-delay: 400ms; }
[data-aos-delay="500"] { transition-delay: 500ms; }

/* ===== Hover Animations ===== */
.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 {
    transition: transform 0.3s ease;
}

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

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

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(201, 169, 98, 0.4);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

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

.hover-shine:hover::before {
    left: 100%;
}

/* ===== Text Animations ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

.text-reveal {
    animation: textReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== Line Animations ===== */
.line-animate {
    position: relative;
}

.line-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--color-primary);
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.line-animate:hover::after,
.line-animate.active::after {
    width: 100%;
}

/* ===== Background Animations ===== */
.bg-gradient-animate {
    background: linear-gradient(-45deg, #0f0f1a, #1a1a2e, #2d2d44, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* ===== Stagger Children Animation ===== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.animate > *:nth-child(1) { animation: fadeInUp 0.5s 0.1s forwards; }
.stagger-children.animate > *:nth-child(2) { animation: fadeInUp 0.5s 0.2s forwards; }
.stagger-children.animate > *:nth-child(3) { animation: fadeInUp 0.5s 0.3s forwards; }
.stagger-children.animate > *:nth-child(4) { animation: fadeInUp 0.5s 0.4s forwards; }
.stagger-children.animate > *:nth-child(5) { animation: fadeInUp 0.5s 0.5s forwards; }
.stagger-children.animate > *:nth-child(6) { animation: fadeInUp 0.5s 0.6s forwards; }

/* ===== Parallax Effect ===== */
.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-element {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ===== Magnetic Button Effect ===== */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnetic-btn-inner {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Image Reveal ===== */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    z-index: 1;
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.revealed::before {
    transform: scaleX(0);
}

.image-reveal img {
    transform: scale(1.2);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.revealed img {
    transform: scale(1);
}

/* ===== Number Counter Animation ===== */
.counter {
    display: inline-block;
}

/* ===== Cursor Effects ===== */
.cursor-grow-target:hover ~ .cursor-follower,
.cursor-grow-target:hover .cursor-follower {
    transform: translate(-50%, -50%) scale(1.5);
}

/* ===== Page Transition ===== */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--color-dark);
    z-index: 10001;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-transition.active {
    transform: scaleY(1);
    transform-origin: top;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
