/* =============================================
   GRID WHOLESALE - FIBER OPTIC EFFECTS
   Effets de lumière et animations fibre optique
   ============================================= */

/* ----- FIBER LINES ANIMATION ----- */
.fiber-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--red), 
        var(--magenta), 
        transparent);
    opacity: 0;
    animation: fiberMove 4s linear infinite;
    filter: blur(1px);
    box-shadow: 0 0 10px var(--red), 0 0 20px var(--magenta);
}

@keyframes fiberMove {
    0% {
        opacity: 0;
        transform: translateX(-100%) scaleX(0.5);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(100vw) scaleX(0.5);
    }
}

/* ----- GLOW PULSE EFFECT ----- */
.glow-pulse {
    position: relative;
}

.glow-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, 
        rgba(175, 0, 0, 0.15) 0%, 
        rgba(129, 0, 129, 0.1) 30%,
        transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes glowPulse {
    0%, 100% { 
        opacity: 0.5; 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.1); 
    }
}

/* ----- FIBER OPTIC CONTAINER ----- */
.fiber-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.fiber-strand {
    position: absolute;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(175, 0, 0, 0.8) 20%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(129, 0, 129, 0.8) 80%,
        transparent 100%);
    filter: blur(1px);
    box-shadow: 
        0 0 10px rgba(175, 0, 0, 0.8),
        0 0 20px rgba(129, 0, 129, 0.6),
        0 0 30px rgba(255, 255, 255, 0.3);
    animation: fiberStrand 8s linear infinite;
    opacity: 0;
}

.fiber-strand:nth-child(1) { top: 10%; animation-delay: 0s; }
.fiber-strand:nth-child(2) { top: 25%; animation-delay: 1.5s; }
.fiber-strand:nth-child(3) { top: 40%; animation-delay: 3s; }
.fiber-strand:nth-child(4) { top: 55%; animation-delay: 4.5s; }
.fiber-strand:nth-child(5) { top: 70%; animation-delay: 6s; }
.fiber-strand:nth-child(6) { top: 85%; animation-delay: 7.5s; }

@keyframes fiberStrand {
    0% {
        left: -200px;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        left: calc(100% + 200px);
        opacity: 0;
    }
}

/* ----- VERTICAL FIBER STRANDS ----- */
.fiber-strand-vertical {
    position: absolute;
    width: 2px;
    height: 150px;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(129, 0, 129, 0.8) 20%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(175, 0, 0, 0.8) 80%,
        transparent 100%);
    filter: blur(1px);
    box-shadow: 
        0 0 10px rgba(129, 0, 129, 0.8),
        0 0 20px rgba(175, 0, 0, 0.6);
    animation: fiberStrandVertical 10s linear infinite;
    opacity: 0;
}

.fiber-strand-vertical:nth-child(7) { left: 5%; animation-delay: 0s; }
.fiber-strand-vertical:nth-child(8) { left: 20%; animation-delay: 2s; }
.fiber-strand-vertical:nth-child(9) { left: 35%; animation-delay: 4s; }
.fiber-strand-vertical:nth-child(10) { left: 50%; animation-delay: 6s; }
.fiber-strand-vertical:nth-child(11) { left: 65%; animation-delay: 8s; }
.fiber-strand-vertical:nth-child(12) { left: 80%; animation-delay: 1s; }
.fiber-strand-vertical:nth-child(13) { left: 95%; animation-delay: 3s; }

@keyframes fiberStrandVertical {
    0% {
        top: -150px;
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    95% {
        opacity: 0.7;
    }
    100% {
        top: calc(100% + 150px);
        opacity: 0;
    }
}

/* ----- CARD FIBER BORDER ----- */
.card-fiber {
    position: relative;
    overflow: hidden;
}

.card-fiber::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        var(--red),
        var(--magenta),
        var(--red),
        transparent);
    animation: fiberBorderTop 3s linear infinite;
}

.card-fiber::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        var(--magenta),
        var(--red),
        var(--magenta),
        transparent);
    animation: fiberBorderBottom 3s linear infinite;
    animation-delay: 1.5s;
}

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

@keyframes fiberBorderBottom {
    0% { right: -100%; }
    100% { right: 100%; }
}

/* ----- SIDE FIBER BORDERS ----- */
.card-fiber .fiber-left,
.card-fiber .fiber-right {
    position: absolute;
    width: 2px;
    height: 100%;
    top: 0;
}

.card-fiber .fiber-left {
    left: 0;
    background: linear-gradient(180deg, 
        transparent,
        var(--red),
        var(--magenta),
        transparent);
    animation: fiberBorderLeft 3s linear infinite;
    animation-delay: 0.75s;
}

.card-fiber .fiber-right {
    right: 0;
    background: linear-gradient(180deg, 
        transparent,
        var(--magenta),
        var(--red),
        transparent);
    animation: fiberBorderRight 3s linear infinite;
    animation-delay: 2.25s;
}

@keyframes fiberBorderLeft {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

@keyframes fiberBorderRight {
    0% { transform: translateY(100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-100%); opacity: 0; }
}

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

.light-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        0 0 10px var(--red),
        0 0 20px var(--magenta),
        0 0 30px white;
    animation: particleFloat 6s ease-in-out infinite;
    opacity: 0;
}

.light-particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.light-particle:nth-child(2) { left: 20%; animation-delay: 0.5s; }
.light-particle:nth-child(3) { left: 30%; animation-delay: 1s; }
.light-particle:nth-child(4) { left: 40%; animation-delay: 1.5s; }
.light-particle:nth-child(5) { left: 50%; animation-delay: 2s; }
.light-particle:nth-child(6) { left: 60%; animation-delay: 2.5s; }
.light-particle:nth-child(7) { left: 70%; animation-delay: 3s; }
.light-particle:nth-child(8) { left: 80%; animation-delay: 3.5s; }
.light-particle:nth-child(9) { left: 90%; animation-delay: 4s; }

@keyframes particleFloat {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: scale(0.5);
    }
}

/* ----- HERO FIBER EFFECT ----- */
.hero-fiber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(175, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 0, 129, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ----- NODE POINTS ----- */
.fiber-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gradient);
    border-radius: 50%;
    box-shadow: 
        0 0 10px var(--red),
        0 0 20px var(--magenta),
        0 0 40px rgba(255, 255, 255, 0.5);
    animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 10px var(--red),
            0 0 20px var(--magenta),
            0 0 40px rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: scale(1.5);
        box-shadow: 
            0 0 20px var(--red),
            0 0 40px var(--magenta),
            0 0 60px rgba(255, 255, 255, 0.8);
    }
}

/* ----- SECTION DIVIDER FIBER ----- */
.fiber-divider {
    position: relative;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 60px 0;
    overflow: hidden;
}

.fiber-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        var(--red),
        var(--magenta),
        transparent);
    animation: dividerLight 3s linear infinite;
    box-shadow: 0 0 20px var(--red), 0 0 40px var(--magenta);
}

@keyframes dividerLight {
    0% { left: -100px; }
    100% { left: calc(100% + 100px); }
}

/* ----- FEATURE ICON FIBER RING ----- */
.feature-icon-fiber {
    position: relative;
}

.feature-icon-fiber::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent,
        var(--red),
        var(--magenta),
        transparent
    );
    animation: fiberRing 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-item:hover .feature-icon-fiber::before {
    opacity: 1;
}

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

/* ----- CTA BOX FIBER GLOW ----- */
.cta-box-fiber {
    position: relative;
}

.cta-box-fiber::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--red), 
        var(--magenta), 
        var(--red), 
        var(--magenta));
    background-size: 400% 400%;
    border-radius: 32px;
    z-index: -1;
    animation: gradientBorder 4s ease infinite;
    opacity: 0.5;
    filter: blur(10px);
}

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

/* ----- DATA STREAM EFFECT ----- */
.data-stream {
    position: absolute;
    width: 1px;
    background: linear-gradient(180deg,
        transparent,
        rgba(175, 0, 0, 0.5),
        rgba(255, 255, 255, 0.8),
        rgba(129, 0, 129, 0.5),
        transparent);
    animation: dataStream 1.5s linear infinite;
    opacity: 0.7;
}

@keyframes dataStream {
    0% {
        height: 0;
        top: 0;
    }
    50% {
        height: 100px;
    }
    100% {
        height: 0;
        top: 100%;
    }
}

/* ----- LOGO FIBER GLOW ----- */
.logo-fiber {
    position: relative;
}

.logo-fiber::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(
        ellipse at center,
        rgba(175, 0, 0, 0.3) 0%,
        rgba(129, 0, 129, 0.2) 30%,
        transparent 70%
    );
    animation: logoGlow 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes logoGlow {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ----- CONNECTION LINES ----- */
.connection-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(175, 0, 0, 0.5),
        rgba(129, 0, 129, 0.5),
        transparent);
    transform-origin: left center;
}

.connection-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--red), 0 0 20px var(--magenta);
    animation: connectionPulse 1s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.5); }
}

/* ----- SCANNING LINE ----- */
.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--red) 20%,
        white 50%,
        var(--magenta) 80%,
        transparent 100%);
    box-shadow: 
        0 0 10px var(--red),
        0 0 20px var(--magenta),
        0 -10px 20px rgba(175, 0, 0, 0.3),
        0 10px 20px rgba(129, 0, 129, 0.3);
    animation: scanMove 4s linear infinite;
    opacity: 0.8;
}

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

/* ----- REDUCED MOTION ----- */
@media (prefers-reduced-motion: reduce) {
    .fiber-strand,
    .fiber-strand-vertical,
    .light-particle,
    .fiber-line,
    .scan-line,
    .data-stream {
        animation: none;
        opacity: 0;
    }
    
    .card-fiber::before,
    .card-fiber::after,
    .fiber-divider::before {
        animation: none;
    }
}
