/* =====================================
   ANIMATIONS
===================================== */

/* 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 Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll Down Indicator */
@keyframes scrollDown {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Scale Up */
@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Slide In From Top */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* =====================================
   ANIMATION CLASSES
===================================== */

.fade-in {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.fade-in-left {
    animation: fadeInLeft 1s ease-out forwards;
    opacity: 0;
}

.fade-in-right {
    animation: fadeInRight 1s ease-out forwards;
    opacity: 0;
}

.scale-up {
    animation: scaleUp 0.6s ease-out forwards;
    opacity: 0;
}

/* =====================================
   INTERSECTION OBSERVER ANIMATIONS
===================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================
   STAGGER ANIMATIONS
===================================== */

.stagger-animation > * {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.stagger-animation > *:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animation > *:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animation > *:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animation > *:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animation > *:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animation > *:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-animation > *:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-animation > *:nth-child(8) {
    animation-delay: 0.8s;
}

/* =====================================
   HOVER ANIMATIONS
===================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.2);
}

.hover-scale {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-brightness {
    transition: filter 0.3s ease;
}

.hover-brightness:hover {
    filter: brightness(1.1);
}

/* =====================================
   PARALLAX EFFECT
===================================== */

.parallax {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* =====================================
   LOADING ANIMATIONS
===================================== */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(211, 183, 124, 0.2);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================
   PAGE TRANSITION
===================================== */

.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* =====================================
   TEXT ANIMATIONS
===================================== */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =====================================
   SMOOTH TRANSITIONS
===================================== */

.smooth-transition {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================
   GALLERY ITEM ANIMATION
===================================== */

.galerie-item {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.galerie-item:nth-child(1) { animation-delay: 0.1s; }
.galerie-item:nth-child(2) { animation-delay: 0.15s; }
.galerie-item:nth-child(3) { animation-delay: 0.2s; }
.galerie-item:nth-child(4) { animation-delay: 0.25s; }
.galerie-item:nth-child(5) { animation-delay: 0.3s; }
.galerie-item:nth-child(6) { animation-delay: 0.35s; }
.galerie-item:nth-child(7) { animation-delay: 0.4s; }
.galerie-item:nth-child(8) { animation-delay: 0.45s; }

/* Reset animation when filtering */
.galerie-item.hidden {
    animation: none;
    opacity: 0;
    display: none;
}

.galerie-item.visible {
    display: block;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* =====================================
   BUTTON RIPPLE EFFECT
===================================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* =====================================
   UNDERLINE ANIMATION
===================================== */

.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animated-underline:hover::after {
    width: 100%;
}

/* =====================================
   IMAGE REVEAL
===================================== */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-black);
    transform-origin: left;
    animation: revealImage 1.2s cubic-bezier(0.77, 0, 0.18, 1) forwards;
    z-index: 1;
}

@keyframes revealImage {
    0% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(1);
        transform-origin: left;
    }
    51% {
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* =====================================
   COUNTER ANIMATION
===================================== */

.counter {
    animation: countUp 2s ease-out forwards;
}

/* =====================================
   FLOATING ANIMATION
===================================== */

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

/* =====================================
   REDUCED MOTION
===================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
