/* ========================================
   CROCO BRASSEUR - ADVANCED ANIMATIONS
   Inspired by Luxury Restaurant Designs
   ======================================== */

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

/* Letter by letter animation */
.letter-reveal {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(90deg);
    animation: revealLetter 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* Mask reveal effect */
.mask-reveal {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.mask-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gold);
    transform-origin: left;
    animation: maskSlide 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes maskSlide {
    0% {
        transform: scaleX(0);
    }
    50% {
        transform: scaleX(1);
        transform-origin: left;
    }
    51% {
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* ========================================
   GLOW & PARTICLE EFFECTS
   ======================================== */

/* Text glow pulse */
.text-glow {
    animation: glowPulseText 3s ease-in-out infinite;
}

@keyframes glowPulseText {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(201, 169, 97, 0.5),
            0 0 20px rgba(201, 169, 97, 0.3),
            0 0 30px rgba(201, 169, 97, 0.2);
    }
    50% {
        text-shadow:
            0 0 20px rgba(201, 169, 97, 0.8),
            0 0 30px rgba(201, 169, 97, 0.6),
            0 0 40px rgba(201, 169, 97, 0.4),
            0 0 50px rgba(201, 169, 97, 0.2);
    }
}

/* Particle system */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 4s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120px) translateX(var(--x-drift, 0));
        opacity: 0;
    }
}

/* Shimmer text effect */
.shimmer-text {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(201, 169, 97, 1) 50%,
        rgba(255, 255, 255, 1) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Fade in on scroll */
.scroll-fade {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* Slide in from left */
.scroll-slide-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* Slide in from right */
.scroll-slide-right {
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* Scale in on scroll */
.scroll-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* Decorative line expand */
.decorative-line {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    margin: 40px auto;
    transition: width 1s ease;
    position: relative;
}

.decorative-line::before,
.decorative-line::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-gold);
    border-radius: 50%;
    top: -3px;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.decorative-line::before {
    left: -15px;
}

.decorative-line::after {
    right: -15px;
}

.decorative-line.active {
    width: 120px;
}

.decorative-line.active::before,
.decorative-line.active::after {
    opacity: 1;
}

/* ========================================
   COUNTER ANIMATIONS
   ======================================== */

.stat-number {
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.stat-number.counting {
    animation: countPulse 0.5s ease;
}

@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--primary-gold);
    }
}

/* ========================================
   IMAGE EFFECTS
   ======================================== */

/* Ken Burns effect */
.ken-burns {
    overflow: hidden;
}

.ken-burns img,
.ken-burns .background-image {
    animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.1) translate(-20px, -20px);
    }
}

/* Image reveal on scroll */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal img {
    transform: scale(1.2);
    opacity: 0;
    transition: transform 1.5s ease, opacity 1s ease;
}

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

.image-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gold);
    transform-origin: left;
    transform: scaleX(1);
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.active::after {
    transform: scaleX(0);
    transform-origin: right;
}

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

/* Magnetic button effect */
.btn-magnetic {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ripple effect on click */
.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, height 0.6s;
}

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

/* Glowing border animation */
.btn-glow-border {
    position: relative;
    border: 2px solid transparent;
    background:
        linear-gradient(var(--dark-gray), var(--dark-gray)) padding-box,
        linear-gradient(45deg, var(--primary-gold), #fff, var(--primary-gold)) border-box;
    animation: rotateBorder 3s linear infinite;
}

@keyframes rotateBorder {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

/* ========================================
   SECTION TRANSITIONS
   ======================================== */

/* Parallax background */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

@media (max-width: 768px) {
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* Stagger animation for lists */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-item.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1).active { transition-delay: 0.1s; }
.stagger-item:nth-child(2).active { transition-delay: 0.2s; }
.stagger-item:nth-child(3).active { transition-delay: 0.3s; }
.stagger-item:nth-child(4).active { transition-delay: 0.4s; }
.stagger-item:nth-child(5).active { transition-delay: 0.5s; }
.stagger-item:nth-child(6).active { transition-delay: 0.6s; }

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

/* Card lift and glow */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(201, 169, 97, 0.2);
}

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

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Text gradient on hover */
.text-gradient-hover {
    background: linear-gradient(90deg, var(--dark-gray), var(--primary-gold));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.5s ease;
}

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

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

/* Skeleton loader */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Pulse animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

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

/* Rotate on scroll */
.rotate-on-scroll {
    transition: transform 0.3s ease-out;
}

/* Blur to focus */
.blur-focus {
    filter: blur(5px);
    opacity: 0;
    transition: filter 1s ease, opacity 1s ease;
}

.blur-focus.active {
    filter: blur(0);
    opacity: 1;
}

/* Split text animation */
.split-text {
    position: relative;
    display: inline-block;
}

.split-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(-90deg);
    animation: splitReveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* ========================================
   WORD ANIMATIONS - Sophisticated Title Effects
   ======================================== */

/* Word reveal - each word appears one by one */
.word-reveal {
    display: inline-block;
    overflow: hidden;
}

.word-reveal .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: wordSlideUp 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* Word fade with scale */
.word-fade-scale .word {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
    animation: wordFadeScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Word slide from left */
.word-slide-left .word {
    display: inline-block;
    opacity: 0;
    transform: translateX(-50px);
    animation: wordSlideLeft 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* Word slide from right */
.word-slide-right .word {
    display: inline-block;
    opacity: 0;
    transform: translateX(50px);
    animation: wordSlideRight 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* Word rotate in */
.word-rotate .word {
    display: inline-block;
    opacity: 0;
    transform: rotateX(-90deg);
    transform-origin: bottom;
    animation: wordRotate 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes wordRotate {
    to {
        opacity: 1;
        transform: rotateX(0);
    }
}

/* Word blur to focus */
.word-blur .word {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    animation: wordBlur 0.8s ease forwards;
}

@keyframes wordBlur {
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Word with glow effect */
.word-glow .word {
    display: inline-block;
    opacity: 0;
    animation: wordGlow 1s ease forwards;
}

@keyframes wordGlow {
    0% {
        opacity: 0;
        text-shadow: 0 0 0 transparent;
    }
    50% {
        text-shadow:
            0 0 20px rgba(201, 169, 97, 0.8),
            0 0 40px rgba(201, 169, 97, 0.6);
    }
    100% {
        opacity: 1;
        text-shadow:
            0 0 10px rgba(201, 169, 97, 0.4),
            0 0 20px rgba(201, 169, 97, 0.2);
    }
}

/* Elegant word reveal with mask (like Baresto) */
.word-mask-reveal .word-wrapper {
    display: inline-block;
    position: relative;
    overflow: hidden;
    margin: 0 8px;
}

.word-mask-reveal .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(120%);
    animation: wordMaskReveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.word-mask-reveal .word-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gold);
    transform: scaleX(0);
    transform-origin: left;
    animation: wordMask 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

@keyframes wordMask {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    50% {
        transform: scaleX(1);
        transform-origin: left;
    }
    51% {
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* Luxury split word animation */
.word-split .word {
    display: inline-block;
    position: relative;
}

.word-split .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(-90deg);
    animation: charReveal 0.6s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

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

/* Word bounce effect */
.word-bounce .word {
    display: inline-block;
    opacity: 0;
    animation: wordBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes wordBounce {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.3);
    }
    50% {
        transform: translateY(0) scale(1.05);
    }
    70% {
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger delays for words */
.word:nth-child(1) { animation-delay: 0.1s; }
.word:nth-child(2) { animation-delay: 0.2s; }
.word:nth-child(3) { animation-delay: 0.3s; }
.word:nth-child(4) { animation-delay: 0.4s; }
.word:nth-child(5) { animation-delay: 0.5s; }
.word:nth-child(6) { animation-delay: 0.6s; }
.word:nth-child(7) { animation-delay: 0.7s; }
.word:nth-child(8) { animation-delay: 0.8s; }

.word-wrapper:nth-child(1)::after { animation-delay: 0.1s; }
.word-wrapper:nth-child(2)::after { animation-delay: 0.3s; }
.word-wrapper:nth-child(3)::after { animation-delay: 0.5s; }
.word-wrapper:nth-child(4)::after { animation-delay: 0.7s; }
.word-wrapper:nth-child(5)::after { animation-delay: 0.9s; }
.word-wrapper:nth-child(6)::after { animation-delay: 1.1s; }

/* Char stagger delays */
.char:nth-child(1) { animation-delay: 0.05s; }
.char:nth-child(2) { animation-delay: 0.1s; }
.char:nth-child(3) { animation-delay: 0.15s; }
.char:nth-child(4) { animation-delay: 0.2s; }
.char:nth-child(5) { animation-delay: 0.25s; }
.char:nth-child(6) { animation-delay: 0.3s; }
.char:nth-child(7) { animation-delay: 0.35s; }
.char:nth-child(8) { animation-delay: 0.4s; }
.char:nth-child(9) { animation-delay: 0.45s; }
.char:nth-child(10) { animation-delay: 0.5s; }

/* ========================================
   CURSOR TRAIL EFFECT
   ======================================== */

.cursor-trail-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cursor-trail-dot.active {
    opacity: 0.6;
    animation: trailFade 0.8s ease forwards;
}

@keyframes trailFade {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* ========================================
   PAGE TRANSITION
   ======================================== */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-gray);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.page-transition-logo {
    font-size: 3rem;
    color: var(--primary-gold);
    animation: fadeInScale 0.6s ease;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .scroll-fade,
    .scroll-slide-left,
    .scroll-slide-right,
    .scroll-scale {
        transition-duration: 0.6s;
    }

    .card-lift:hover {
        transform: translateY(-5px);
    }

    /* Disable some effects on mobile for performance */
    .ken-burns img,
    .ken-burns .background-image {
        animation: none;
    }

    .particle {
        display: none;
    }
}

/* ========================================
   GLOBAL IMAGE ANIMATIONS
   ======================================== */

/* Animation globale pour toutes les images du site */
img:not(.logo):not(.no-animation) {
    animation: imageFloatGlobal 6s ease-in-out infinite;
}

@keyframes imageFloatGlobal {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-10px) scale(1.03);
        filter: brightness(1.05);
    }
}

/* Animation pour les images de galerie */
.gallery-item img,
.offer-card-image img,
.about-image img,
.service-image img {
    animation: imageZoomFloat 8s ease-in-out infinite;
}

@keyframes imageZoomFloat {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
        filter: brightness(1.08);
    }
}

/* Animation pour les backgrounds hero */
.page-hero,
.hero {
    animation: backgroundZoomGlobal 10s ease-in-out infinite;
    background-size: cover;
    background-position: center;
}

@keyframes backgroundZoomGlobal {
    0%, 100% {
        background-size: 100%;
        filter: brightness(0.7);
    }
    50% {
        background-size: 108%;
        filter: brightness(0.85);
    }
}

/* 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;
    }
}
