/* Loading Animation */
@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logo-circle {
    animation: rotate 3s linear infinite;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-progress {
    animation: loading 2s ease-in-out forwards;
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.floating-element:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation: float 8s ease-in-out infinite reverse;
}

.floating-element:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 80%;
    left: 20%;
    animation: float 7s ease-in-out infinite 1s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
    }
}

/* Scroll Indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
    100% {
        opacity: 0;
        transform: translateY(30px) translateX(-50%);
    }
}

.scroll-indicator {
    animation: bounce 2s infinite;
}

.wheel {
    animation: scroll 2s infinite;
}

/* Circuit Lines Animation */
.circuit-line {
    animation: circuitFlow 3s linear infinite;
}

.line-1 {
    animation-delay: 0s;
}

.line-2 {
    animation-delay: 1s;
}

.line-3 {
    animation-delay: 2s;
}

@keyframes circuitFlow {
    0% {
        background: linear-gradient(90deg, transparent, var(--gold), transparent);
        background-position: -100% 0;
    }
    100% {
        background: linear-gradient(90deg, transparent, var(--gold), transparent);
        background-position: 200% 0;
    }
}

.circuit-node {
    animation: nodePulse 2s infinite alternate;
}

.node-1 {
    animation-delay: 0s;
}

.node-2 {
    animation-delay: 0.5s;
}

.node-3 {
    animation-delay: 1s;
}

@keyframes nodePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    100% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
}

/* Glow Effect */
.glow {
    position: relative;
}

.glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gold);
    filter: blur(15px);
    opacity: 0;
    z-index: -1;
    animation: glowPulse 2s infinite alternate;
}

@keyframes glowPulse {
    0% {
        opacity: 0.1;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

/* Float Animation */
.float-animation {
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse Animation */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gold);
    transform: translateX(-100%);
    animation: textReveal 1.5s ease-out forwards;
}

@keyframes textReveal {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(101%);
    }
}

/* Card Hover Effects */
.service-card, .av-card, .project-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.av-card:hover {
    transform: translateY(-5px) rotate(1deg);
}

.project-card:hover {
    transform: perspective(1000px) rotateX(5deg) translateY(-10px);
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-primary:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Menu Item Animation */
@keyframes menuItemReveal {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animate on scroll base */
.animate-on-scroll {
    opacity: 0;
}

/* Animation Classes */
.fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

.fade-down {
    animation: fadeDown 0.8s ease-out forwards;
}

.fade-left {
    animation: fadeLeft 0.8s ease-out forwards;
}

.fade-right {
    animation: fadeRight 0.8s ease-out forwards;
}

.zoom-in {
    animation: zoomIn 0.8s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.slide-right {
    animation: slideRight 0.8s ease-out forwards;
}

.slide-left {
    animation: slideLeft 0.8s ease-out forwards;
}

.flip {
    animation: flip 0.8s ease-out forwards;
}

/* Keyframes */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes flip {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

/* Count Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countNumber {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat.animated .stat-number {
    animation: countNumber 0.5s ease-out forwards;
}

/* Page Transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    z-index: 9998;
    transform: translateY(100%);
}

/* Hover Line Animation */
.hover-line {
    position: relative;
}

.hover-line::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.hover-line:hover::after {
    width: 100%;
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--gold);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--gold) }
}

/* Background Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: var(--gold);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    to {
        transform: translateY(-1000px) rotate(360deg);
    }
}

/* Slider Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Filter Button Animation */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(212, 175, 55, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.filter-btn.active::after {
    animation: ripple 0.6s ease-out;
}

/* Project Card Animation */
.project-card {
    animation: projectCardAppear 0.6s ease-out forwards;
}

@keyframes projectCardAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stat Counter Animation */
.stat-number.animating {
    animation: counterSpin 0.5s ease-out;
}

@keyframes counterSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* =========================================== */
/* ANIMATIONS POUR LES MODALS ET COOKIES */
/* =========================================== */

/* Animation d'entrée du modal */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay.show .modal {
    animation: modalSlideIn 0.4s ease-out;
}

/* Animation du banner cookies */
@keyframes cookieSlideUp {
    from {
        bottom: -100%;
    }
    to {
        bottom: 0;
    }
}

.cookie-banner.show {
    animation: cookieSlideUp 0.5s ease-out;
}

/* Animation de la notification */
@keyframes cookieNotificationSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cookie-notification.show {
    animation: cookieNotificationSlide 0.4s ease-out;
}

/* Animation du bouton de fermeture */
@keyframes closeButtonRotate {
    from {
        transform: rotate(0);
    }
    to {
        transform: rotate(90deg);
    }
}

.modal-close:hover {
    animation: closeButtonRotate 0.3s ease-out;
}

/* Pulse animation pour les liens cookies */
.cookie-link {
    position: relative;
}

.cookie-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold-light);
    transition: width 0.3s ease;
}

.cookie-link:hover::after {
    width: 100%;
}

/* Shake animation pour l'icône cookie */
@keyframes cookieShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

.cookie-text i {
    animation: cookieShake 2s infinite;
}

/* Fade in pour le contenu légal */
@keyframes legalContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-content > * {
    animation: legalContentFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.legal-content h3:nth-child(1) { animation-delay: 0.1s; }
.legal-content p:nth-child(2) { animation-delay: 0.2s; }
.legal-content ul:nth-child(3) { animation-delay: 0.3s; }
.legal-content h3:nth-child(4) { animation-delay: 0.4s; }
.legal-content p:nth-child(5) { animation-delay: 0.5s; }
.legal-content h3:nth-child(6) { animation-delay: 0.6s; }
.legal-content ul:nth-child(7) { animation-delay: 0.7s; }
.legal-content h3:nth-child(8) { animation-delay: 0.8s; }
.legal-content p:nth-child(9) { animation-delay: 0.9s; }
.legal-content em { animation-delay: 1s; }