/* 
==========================================
Spark World Lighting - Animations
==========================================
*/

/* ========== TEXT ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== HERO ANIMATIONS ========== */
.animate-text {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.title-line-1 {
    animation-delay: 0.3s;
}

.title-line-2 {
    animation-delay: 0.6s;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-golden);
    white-space: nowrap;
    margin: 0 auto;
    animation:
        typing 3s steps(20, end) 1.2s forwards,
        blink-caret 0.75s step-end infinite;
    max-width: 0;
}

@keyframes typing {
    from {
        max-width: 0;
    }

    to {
        max-width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--color-golden);
    }
}

/* Fade in Up Animations */
.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1.5s;
}

.fade-in-up-stagger {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1.8s;
}

/* ========== SCROLL ANIMATIONS ========== */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========== HOVER ANIMATIONS ========== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hover-glow {
    position: relative;
    overflow: hidden;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 185, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hover-glow:hover::before {
    width: 300px;
    height: 300px;
}

/* ========== GRADIENT ANIMATIONS ========== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(270deg, var(--color-golden), var(--color-golden-light), var(--color-golden-dark));
    background-size: 600% 600%;
    animation: gradientShift 3s ease infinite;
}

/* ========== LOADING ANIMATIONS ========== */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 185, 0, 0.2);
    border-top-color: var(--color-golden);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== PAGE TRANSITION ========== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

/* ========== RIPPLE EFFECT ========== */
.ripple {
    position: relative;
    overflow: hidden;
}

.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, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* ========== PARALLAX EFFECTS ========== */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ========== STAGGER ANIMATIONS ========== */
.stagger-animation>* {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-animation.visible>* {
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-animation.visible>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animation.visible>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animation.visible>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animation.visible>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animation.visible>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animation.visible>*:nth-child(6) {
    animation-delay: 0.6s;
}

/* ========== IMAGE ZOOM (Ken Burns) ========== */
.ken-burns {
    overflow: hidden;
}

.ken-burns img {
    transition: transform 10s ease;
}

.ken-burns:hover img {
    transform: scale(1.1);
}

/* ========== UNDERLINE ANIMATION ========== */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-golden);
    transition: width 0.3s ease;
}

.animated-underline:hover::after {
    width: 100%;
}

/* ========== BOUNCE ANIMATION ========== */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* ========== ROTATE ANIMATION ========== */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 3s linear infinite;
}

/* ========== PULSE ANIMATION ========== */
@keyframes pulseAnimation {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse-animation {
    animation: pulseAnimation 2s infinite;
}

/* ========== SHAKE ANIMATION ========== */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* ========== FLIP ANIMATION ========== */
.flip-card {
    perspective: 1000px;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-inner {
    transform: rotateY(180deg);
}

.flip-front,
.flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-back {
    transform: rotateY(180deg);
}

/* ========== MODAL ANIMATIONS ========== */
.modal {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.modal-backdrop {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ========== CUSTOM ANIMATIONS ========== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease forwards;
}

.slide-down {
    animation: slideDown 0.6s ease forwards;
}

/* ========== RESPONSIVE ANIMATIONS ========== */
@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;
    }
}