/**
 * BIIS Consulting - Intro Sequence Styles
 * Styles pour la séquence d'ouverture spectaculaire
 */

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

#biis-intro-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: all;
}

.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-overlay::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(45, 125, 46, 0.15) 0%,
        rgba(59, 130, 246, 0.1) 25%,
        rgba(139, 92, 246, 0.05) 50%,
        transparent 70%
    );
    animation: rotateGradient 20s linear infinite;
    pointer-events: none;
}

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

.intro-overlay.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ========================================
   PHASES
   ======================================== */

.intro-phase {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.intro-phase.active {
    opacity: 1;
    pointer-events: all;
}

/* ========================================
   PHASE 1: LOGO PULSE
   ======================================== */

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-pulse {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.logo-pulse.animate {
    animation: rotate3D 3s ease-in-out infinite;
}

@keyframes rotate3D {
    0%, 100% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    50% {
        transform: rotateY(10deg) rotateX(5deg);
    }
}

.logo-pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(45, 125, 46, 0.3), 
        transparent
    );
    animation: scanEffect 2s ease-in-out infinite;
}

@keyframes scanEffect {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.logo-text {
    font-size: 64px;
    font-weight: bold;
    background: linear-gradient(135deg, #2D7D2E, #3B82F6, #8B5CF6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 2;
    animation: logoFadeIn 0.5s ease-out, gradientFlow 3s ease infinite;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #2D7D2E;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 20px rgba(45, 125, 46, 0.5);
}

.logo-pulse.animate .pulse-ring:nth-child(1) {
    animation: pulse 1.5s ease-out infinite;
}

.logo-pulse.animate .pulse-ring:nth-child(2) {
    animation: pulse 1.5s ease-out 0.5s infinite;
}

.logo-pulse.animate .pulse-ring:nth-child(3) {
    animation: pulse 1.5s ease-out 1s infinite;
}

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

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   PHASE 2: DATA LOADING
   ======================================== */

.loading-container {
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.2;
    z-index: 0;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #10B981;
    display: flex;
    flex-direction: column;
    animation: matrixFall 3s linear infinite;
}

@keyframes matrixFall {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(120vh);
    }
}

.loading-text {
    font-size: 24px;
    background: linear-gradient(90deg, #2D7D2E, #3B82F6);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: textPulse 1s ease-in-out infinite, gradientFlow 3s ease infinite;
    position: relative;
    z-index: 1;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.progress-container {
    position: relative;
    z-index: 1;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2D7D2E, #3B82F6, #8B5CF6);
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 15px rgba(45, 125, 46, 0.6), 0 0 30px rgba(59, 130, 246, 0.4);
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(45, 125, 46, 0.6), 0 0 30px rgba(59, 130, 246, 0.4);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 20px rgba(45, 125, 46, 0.8), 0 0 40px rgba(59, 130, 246, 0.6);
    }
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat {
    background: rgba(31, 41, 55, 0.5);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 16px;
    color: #3B82F6;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* ========================================
   PHASE 3: NEURAL NETWORK
   ======================================== */

#neural-intro-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(45, 125, 46, 0.3));
    animation: canvasPulse 3s ease-in-out infinite;
}

@keyframes canvasPulse {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(45, 125, 46, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 50px rgba(59, 130, 246, 0.5));
    }
}

.neural-text {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #8B5CF6;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
    animation: textPulse 1s ease-in-out infinite;
}

/* ========================================
   PHASE 4: TITLE REVEAL
   ======================================== */

.title-container {
    text-align: center;
    transform-style: preserve-3d;
    perspective: 1200px;
    animation: titleFloat 4s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateZ(0px) rotateY(0deg);
    }
    50% {
        transform: translateZ(20px) rotateY(2deg);
    }
}

.main-title {
    font-size: 72px;
    font-weight: bold;
    background: linear-gradient(135deg, #2D7D2E, #3B82F6, #8B5CF6, #2D7D2E);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite, glitchAnim 3s infinite;
    margin: 0;
    position: relative;
    filter: drop-shadow(0 0 20px rgba(45, 125, 46, 0.3));
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Glitch effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glitch::before {
    animation: glitch1 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
    animation: glitch2 2s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch2 {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(2px, -2px);
    }
    94% {
        transform: translate(-2px, 2px);
    }
}

.subtitle {
    font-size: 28px;
    color: #E5E7EB;
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    min-height: 35px;
}

.cursor {
    display: inline-block;
    animation: blink 1s step-start infinite;
    color: #3B82F6;
    font-weight: bold;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.tagline {
    font-size: 16px;
    color: #9CA3AF;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

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

/* ========================================
   PHASE 5: PARTICLE EXPLOSION
   ======================================== */

.particle-explosion {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #2D7D2E, #3B82F6, #8B5CF6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(45, 125, 46, 0.8);
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(720deg);
        opacity: 0;
    }
}

/* Advanced particles */
.advanced-particle {
    filter: blur(0.5px);
    animation: explode 1s ease-out forwards, particleTwinkle 0.5s ease-in-out infinite;
}

@keyframes particleTwinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.trail-particle {
    animation: trailExplode 1.2s ease-out forwards;
}

@keyframes trailExplode {
    0% {
        transform: translate(0, 0) scaleX(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scaleX(3);
        opacity: 0;
    }
}

/* ========================================
   SKIP BUTTON
   ======================================== */

.skip-intro-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(45, 125, 46, 0.5);
    color: #2D7D2E;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(45, 125, 46, 0.2);
}

.skip-intro-btn.visible {
    opacity: 1;
    pointer-events: all;
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(45, 125, 46, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(45, 125, 46, 0.4);
    }
}

.skip-intro-btn:hover {
    background: linear-gradient(135deg, rgba(45, 125, 46, 0.2), rgba(59, 130, 246, 0.2));
    border-color: #2D7D2E;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(45, 125, 46, 0.5), 0 4px 30px rgba(59, 130, 246, 0.3);
    color: #3B82F6;
}

.skip-intro-btn i {
    margin-right: 8px;
}

/* ========================================
   EFFETS SUPPLÉMENTAIRES
   ======================================== */

/* Hexagones flottants en arrière-plan */
.intro-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(45, 125, 46, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: floatBubbles 10s ease-in-out infinite;
    z-index: 0;
}

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

/* Data points flottants */
.phase-2::after,
.phase-3::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, #2D7D2E 1px, transparent 1px),
        radial-gradient(circle, #3B82F6 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px;
    background-position: 0 0, 40px 40px;
    opacity: 0.1;
    animation: dataFlow 20s linear infinite;
}

@keyframes dataFlow {
    0% {
        background-position: 0 0, 40px 40px;
    }
    100% {
        background-position: 50px 50px, 90px 90px;
    }
}

/* Effet holographique sur le neural network */
.phase-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(45, 125, 46, 0.5), 
        rgba(59, 130, 246, 0.5),
        transparent
    );
    animation: scanLine 3s linear infinite;
    z-index: 10;
}

@keyframes scanLine {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

/* Glow pulsant sur les stats */
.stat {
    animation: statGlow 2s ease-in-out infinite;
}

@keyframes statGlow {
    0%, 100% {
        border-color: rgba(45, 125, 46, 0.3);
        box-shadow: 0 0 5px rgba(45, 125, 46, 0.2);
    }
    50% {
        border-color: rgba(59, 130, 246, 0.5);
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    }
}

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

@media (max-width: 768px) {
    .logo-text {
        font-size: 48px;
    }

    .main-title {
        font-size: 42px;
    }

    .subtitle {
        font-size: 18px;
    }

    .tagline {
        font-size: 12px;
    }

    .loading-text {
        font-size: 18px;
    }

    .progress-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .skip-intro-btn {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .intro-phase,
    .logo-pulse,
    .progress-fill,
    .particle,
    .skip-intro-btn {
        animation: none !important;
        transition: none !important;
    }
}
