/* ========================================
   ADEQUAT VOSGES - SPLASH SCREEN
   Couleurs du logo:
   - Marron clair: #A67C52
   - Marron foncé: #5D4037
   - Rouge: #C62828
   - Vert Vosges: #2E7D32
   ======================================== */

body fuse-splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1209 0%, #3E2723 50%, #1a1209 100%);
    color: #F9FAFB;
    z-index: 999999;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* ========================================
   ANIMATED BACKGROUND - Particules flottantes
   ======================================== */

body fuse-splash-screen .bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

body fuse-splash-screen .particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: particle-float 15s infinite ease-in-out;
}

body fuse-splash-screen .particle:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(166, 124, 82, 0.3) 0%, transparent 70%);
    top: -150px;
    left: -100px;
    animation-delay: 0s;
    animation-duration: 20s;
}

body fuse-splash-screen .particle:nth-child(2) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(93, 64, 55, 0.25) 0%, transparent 70%);
    top: 50%;
    right: -200px;
    animation-delay: -5s;
    animation-duration: 25s;
}

body fuse-splash-screen .particle:nth-child(3) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(198, 40, 40, 0.25) 0%, transparent 70%);
    bottom: -100px;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 18s;
}

body fuse-splash-screen .particle:nth-child(4) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(46, 125, 50, 0.25) 0%, transparent 70%);
    top: 30%;
    left: 10%;
    animation-delay: -3s;
    animation-duration: 22s;
}

body fuse-splash-screen .particle:nth-child(5) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(166, 124, 82, 0.2) 0%, transparent 70%);
    bottom: 20%;
    right: 10%;
    animation-delay: -8s;
    animation-duration: 28s;
}

@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(50px, -30px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(20px, 50px) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translate(-30px, 20px) rotate(270deg) scale(1.05);
    }
}

/* ========================================
   GEOMETRIC SHAPES - Formes géométriques animées
   ======================================== */

body fuse-splash-screen .geo-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

body fuse-splash-screen .geo-shape {
    position: absolute;
    border: 2px solid rgba(166, 124, 82, 0.3);
    animation: geo-rotate 20s linear infinite;
}

body fuse-splash-screen .geo-shape:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 5%;
    border-radius: 20%;
    border-color: rgba(166, 124, 82, 0.3);
    animation-duration: 25s;
}

body fuse-splash-screen .geo-shape:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 70%;
    right: 8%;
    border-radius: 30%;
    border-color: rgba(198, 40, 40, 0.3);
    animation-duration: 30s;
    animation-direction: reverse;
}

body fuse-splash-screen .geo-shape:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 40%;
    right: 15%;
    border-radius: 50%;
    border-color: rgba(46, 125, 50, 0.3);
    animation-duration: 15s;
}

body fuse-splash-screen .geo-shape:nth-child(4) {
    width: 120px;
    height: 120px;
    bottom: 15%;
    left: 10%;
    border-radius: 25%;
    border-color: rgba(93, 64, 55, 0.3);
    animation-duration: 35s;
    animation-direction: reverse;
}

@keyframes geo-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   GRID LINES - Grille animée
   ======================================== */

body fuse-splash-screen .grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(166, 124, 82, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(166, 124, 82, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 50px); }
}

/* ========================================
   LOGO CONTAINER
   ======================================== */

body fuse-splash-screen .logo-container {
    position: relative;
    z-index: 10;
    animation: logo-entrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

body fuse-splash-screen img {
    width: 220px;
    max-width: 220px;
    filter: drop-shadow(0 0 60px rgba(166, 124, 82, 0.6));
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-entrance {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes logo-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 40px rgba(166, 124, 82, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 80px rgba(166, 124, 82, 0.8)) drop-shadow(0 0 120px rgba(198, 40, 40, 0.3));
        transform: scale(1.05);
    }
}

/* ========================================
   ORBITAL RINGS - Anneaux orbitaux
   ======================================== */

body fuse-splash-screen .orbital-container {
    position: absolute;
    width: 400px;
    height: 400px;
    z-index: 5;
}

body fuse-splash-screen .orbital-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 2px solid transparent;
    transform: translate(-50%, -50%);
}

body fuse-splash-screen .orbital-ring:nth-child(1) {
    width: 280px;
    height: 280px;
    border-top-color: #A67C52;
    border-right-color: #A67C52;
    animation: orbit 3s linear infinite;
}

body fuse-splash-screen .orbital-ring:nth-child(2) {
    width: 340px;
    height: 340px;
    border-bottom-color: #C62828;
    border-left-color: #C62828;
    animation: orbit 4s linear infinite reverse;
}

body fuse-splash-screen .orbital-ring:nth-child(3) {
    width: 400px;
    height: 400px;
    border-top-color: #2E7D32;
    animation: orbit 5s linear infinite;
}

@keyframes orbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   LOADING BAR - Barre de progression
   ======================================== */

body fuse-splash-screen .loading-bar-container {
    position: relative;
    width: 280px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 60px;
    z-index: 10;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

body fuse-splash-screen .loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #A67C52, #5D4037, #C62828, #A67C52);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: loading-progress 2s ease-in-out infinite, gradient-shift 1s linear infinite;
}

@keyframes loading-progress {
    0% {
        left: -30%;
        width: 30%;
    }
    50% {
        width: 50%;
    }
    100% {
        left: 100%;
        width: 30%;
    }
}

@keyframes gradient-shift {
    from { background-position: 0% 0%; }
    to { background-position: 200% 0%; }
}

/* ========================================
   LOADING TEXT
   ======================================== */

body fuse-splash-screen .loading-text {
    margin-top: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    animation: fadeInUp 0.8s ease-out 0.7s both;
    text-shadow: 0 0 20px rgba(166, 124, 82, 0.5);
}

body fuse-splash-screen .loading-text span {
    display: inline-block;
    animation: letter-bounce 1.5s ease-in-out infinite;
}

body fuse-splash-screen .loading-text span:nth-child(1) { animation-delay: 0s; }
body fuse-splash-screen .loading-text span:nth-child(2) { animation-delay: 0.05s; }
body fuse-splash-screen .loading-text span:nth-child(3) { animation-delay: 0.1s; }
body fuse-splash-screen .loading-text span:nth-child(4) { animation-delay: 0.15s; }
body fuse-splash-screen .loading-text span:nth-child(5) { animation-delay: 0.2s; }
body fuse-splash-screen .loading-text span:nth-child(6) { animation-delay: 0.25s; }
body fuse-splash-screen .loading-text span:nth-child(7) { animation-delay: 0.3s; }
body fuse-splash-screen .loading-text span:nth-child(8) { animation-delay: 0.35s; }
body fuse-splash-screen .loading-text span:nth-child(9) { animation-delay: 0.4s; }
body fuse-splash-screen .loading-text span:nth-child(10) { animation-delay: 0.45s; }
body fuse-splash-screen .loading-text span:nth-child(11) { animation-delay: 0.5s; }
body fuse-splash-screen .loading-text span:nth-child(12) { animation-delay: 0.55s; }
body fuse-splash-screen .loading-text span:nth-child(13) { animation-delay: 0.6s; }

@keyframes letter-bounce {
    0%, 100% {
        transform: translateY(0);
        color: rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: translateY(-5px);
        color: #A67C52;
        text-shadow: 0 0 15px rgba(166, 124, 82, 0.8);
    }
}

/* ========================================
   PULSE DOTS
   ======================================== */

body fuse-splash-screen .pulse-dots {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    z-index: 10;
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

body fuse-splash-screen .pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse-dot 1.4s ease-in-out infinite;
}

body fuse-splash-screen .pulse-dot:nth-child(1) {
    background: #A67C52;
    animation-delay: 0s;
}

body fuse-splash-screen .pulse-dot:nth-child(2) {
    background: #C62828;
    animation-delay: 0.2s;
}

body fuse-splash-screen .pulse-dot:nth-child(3) {
    background: #2E7D32;
    animation-delay: 0.4s;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(166, 124, 82, 0.7);
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 20px 5px rgba(166, 124, 82, 0.4);
    }
}

/* ========================================
   CORNER ACCENTS
   ======================================== */

body fuse-splash-screen .corner-accent {
    position: absolute;
    width: 100px;
    height: 100px;
    z-index: 2;
}

body fuse-splash-screen .corner-accent.top-left {
    top: 30px;
    left: 30px;
    border: 2px solid rgba(166, 124, 82, 0.4);
    border-right: none;
    border-bottom: none;
    animation: corner-fade 2s ease-in-out infinite;
}

body fuse-splash-screen .corner-accent.top-right {
    top: 30px;
    right: 30px;
    border: 2px solid rgba(198, 40, 40, 0.4);
    border-left: none;
    border-bottom: none;
    animation: corner-fade 2s ease-in-out infinite 0.5s;
}

body fuse-splash-screen .corner-accent.bottom-left {
    bottom: 30px;
    left: 30px;
    border: 2px solid rgba(46, 125, 50, 0.4);
    border-right: none;
    border-top: none;
    animation: corner-fade 2s ease-in-out infinite 1s;
}

body fuse-splash-screen .corner-accent.bottom-right {
    bottom: 30px;
    right: 30px;
    border: 2px solid rgba(93, 64, 55, 0.4);
    border-left: none;
    border-top: none;
    animation: corner-fade 2s ease-in-out infinite 1.5s;
}

@keyframes corner-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ========================================
   FADEUP ANIMATION
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   FADING STATE - Transition élégante de sortie
   ======================================== */

body.fuse-splash-screen-fading fuse-splash-screen {
    opacity: 0;
    transform: scale(1.1);
    transition:
        opacity 800ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo zoom out effect during fade */
body.fuse-splash-screen-fading fuse-splash-screen .logo-container {
    animation: logo-exit 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logo-exit {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 60px rgba(166, 124, 82, 0.6));
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
        filter: drop-shadow(0 0 100px rgba(166, 124, 82, 1));
    }
}

/* Orbital rings expand during fade */
body.fuse-splash-screen-fading fuse-splash-screen .orbital-container {
    animation: orbital-exit 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes orbital-exit {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Loading elements fade out */
body.fuse-splash-screen-fading fuse-splash-screen .loading-bar-container,
body.fuse-splash-screen-fading fuse-splash-screen .loading-text,
body.fuse-splash-screen-fading fuse-splash-screen .pulse-dots {
    animation: elements-exit 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes elements-exit {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Corner accents fade and expand */
body.fuse-splash-screen-fading fuse-splash-screen .corner-accent {
    animation: corner-exit 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes corner-exit {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Particles dissolve */
body.fuse-splash-screen-fading fuse-splash-screen .particle {
    animation: particle-exit 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes particle-exit {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Grid fades */
body.fuse-splash-screen-fading fuse-splash-screen .grid-overlay {
    animation: grid-exit 600ms ease-out forwards;
}

@keyframes grid-exit {
    to {
        opacity: 0;
    }
}

/* ========================================
   HIDE STATE - Final hidden state
   ======================================== */

body:not(.fuse-splash-screen-hidden) {
    overflow: hidden;
}

body.fuse-splash-screen-hidden fuse-splash-screen {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   SPINNER (hidden - keeping for compatibility)
   ======================================== */

body fuse-splash-screen .spinner {
    display: none;
}
