/* EFFETS AVANCÉS */

/* BARRE DE PROGRESSION */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark), #b8874e);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 2px 10px rgba(212, 165, 116, 0.6);
}

/* BOUTON RETOUR EN HAUT */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-bg-dark);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(212, 165, 116, 0.6);
}

.back-to-top:active {
    transform: translateY(-2px);
}

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

.particle {
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: float-up 6s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.8);
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* SCROLL REVEAL */
.reveal-element {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* EFFET 3D */
.card,
.ambiance-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* EFFET RIPPLE */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Position relative pour les éléments avec ripple */
.btn,
button,
a.nav-link {
    position: relative;
    overflow: hidden;
}

/* LOADING SCREEN */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2rem;
    animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.loader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(212, 165, 116, 0.2);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    animation: fade-pulse 1.5s ease-in-out infinite;
}

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

/* COMPTEURS ANIMÉS */
[data-counter] {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: Georgia, serif;
}

/* AMÉLIORATION DU PARALLAXE */
.hero {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* EFFET DE GLOW AMÉLIORÉ */
.card:hover,
.ambiance-card:hover {
    animation: card-glow 1.5s ease-in-out infinite;
}

@keyframes card-glow {
    0%, 100% {
        box-shadow: 0 15px 50px rgba(212, 165, 116, 0.3);
    }
    50% {
        box-shadow: 0 15px 50px rgba(212, 165, 116, 0.5),
                    0 0 30px rgba(212, 165, 116, 0.2);
    }
}

/* ANIMATION D'ENTRÉE POUR LES SECTIONS */
.section.revealed {
    animation: section-appear 0.8s ease-out;
}

@keyframes section-appear {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* EFFET DE SHINE SUR LES TITRES */
.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    20%, 100% {
        left: 100%;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.3rem;
    }

    .particle {
        width: 2px;
        height: 2px;
    }

    .loader-logo {
        font-size: 2rem;
    }

    .loader-spinner {
        width: 50px;
        height: 50px;
    }

    [data-counter] {
        font-size: 2rem;
    }
}

/* PERFORMANCE - Réduire les animations si demandé */
@media (prefers-reduced-motion: reduce) {
    .particle,
    .loader-spinner,
    .ripple {
        animation: none !important;
    }

    .reveal-element {
        opacity: 1;
        transform: none;
    }

    .hero {
        transform: none !important;
    }
}
