/* ==================== IMMERSIVE ENHANCEMENTS FOR SHADOWVAULT ====================
   
   Ce fichier contient les améliorations visuelles et interactives pour créer
   une expérience immersive, mystérieuse et addictive. Les animations sont
   optimisées pour les performances avec transform et opacity.
   
   ============================================================================== */

:root {
    /* Palette étendue pour l'immersion */
    --glitch-green: #00FF00;
    --glitch-cyan: #00FFFF;
    --glitch-purple: #9D00FF;
    --void-black: #040404;
    --pulse-red: #FF1744;
    
    /* Timings pour les animations */
    --anim-fast: 200ms;
    --anim-normal: 400ms;
    --anim-slow: 800ms;
    --anim-drift: 6s;
}

/* ==================== DIGITAL VEIL: Particules de Données Tombantes ====================
   
   Le "Voile Numérique" est l'effet signature de Shadowvault. Des particules
   subtiles tombent en arrière-plan, créant une ambiance de matrice sans être
   trop envahissant. Cet effet est interactif avec la souris.
   
   ============================================================================== */

.digital-veil {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: transparent;
}

.digital-veil::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(0, 255, 0, 0.15), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(0, 255, 0, 0.1), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(139, 0, 0, 0.08), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(0, 255, 0, 0.12), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(139, 0, 0, 0.1), transparent);
    background-size: 200px 200px;
    background-position: 0 0;
    animation: veilDrift 20s linear infinite;
    opacity: 0.4;
}

@keyframes veilDrift {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 200px 200px;
    }
}

/* Particules tombantes individuelles (générées par JavaScript) */
.data-particle {
    position: fixed;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(0, 255, 0, 0.3);
    pointer-events: none;
    z-index: 1;
    animation: particleFall linear forwards;
    text-shadow: 0 0 4px rgba(0, 255, 0, 0.4);
}

@keyframes particleFall {
    0% {
        transform: translateY(-100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) translateX(var(--drift, 0));
        opacity: 0;
    }
}

/* ==================== ENHANCED CARD INTERACTIONS ====================
   
   Les cartes de produits et les panneaux auront des interactions plus
   prononcées et immersives.
   
   ============================================================================== */

.product-card,
.glass-card,
.card-hover {
    position: relative;
    overflow: hidden;
    transition: all var(--anim-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Effet de bordure lumineuse au survol */
.product-card::after,
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(139, 0, 0, 0.3) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity var(--anim-normal) ease-out;
    pointer-events: none;
    animation: none;
}

.product-card:hover::after,
.glass-card:hover::after {
    animation: borderGlow var(--anim-slow) ease-in-out infinite;
}

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

/* Effet de profondeur au survol */
.product-card:hover,
.glass-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 0 20px rgba(139, 0, 0, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ==================== DECRYPTION EFFECT: Apparition des Éléments ====================
   
   Les éléments apparaissent avec un effet de "décryptage", comme si le
   système révélait progressivement les données.
   
   ============================================================================== */

.decrypt-in {
    animation: decryptIn var(--anim-normal) ease-out both;
}

@keyframes decryptIn {
    0% {
        opacity: 0;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        filter: blur(8px);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        filter: blur(0);
    }
}

/* ==================== BUTTON ENHANCEMENTS ====================
   
   Les boutons auront des interactions plus viscérales et satisfaisantes.
   
   ============================================================================== */

.btn-primary,
.btn-dark,
.btn-dark-outline {
    position: relative;
    overflow: hidden;
    transition: all var(--anim-fast) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Effet de pulse au survol */
.btn-primary::before,
.btn-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transform: scale(0);
    transition: all var(--anim-normal) ease-out;
}

.btn-primary:hover::before,
.btn-dark:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Effet de clic (press) */
.btn-primary:active,
.btn-dark:active,
.btn-dark-outline:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(139, 0, 0, 0.2);
}

/* ==================== INPUT FIELD ENHANCEMENTS ====================
   
   Les champs de saisie auront une animation de focus plus engageante.
   
   ============================================================================== */

input,
textarea,
select {
    position: relative;
    transition: all var(--anim-fast) ease-out;
}

input::placeholder,
textarea::placeholder {
    transition: color var(--anim-fast) ease-out;
}

input:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
    box-shadow: 
        0 0 0 2px rgba(139, 0, 0, 0.2),
        0 0 16px rgba(139, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: rgba(215, 210, 202, 0.6);
}

/* ==================== GLITCH EFFECT (Optionnel, utilisé avec parcimonie) ====================
   
   Un effet de glitch subtil pour les éléments critiques ou les erreurs.
   
   ============================================================================== */

.glitch-effect {
    position: relative;
    animation: glitchShake 200ms ease-in-out;
}

@keyframes glitchShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

/* ==================== NOTIFICATION ANIMATIONS ====================
   
   Les notifications (toasts) apparaissent avec style et disparaissent
   en douceur.
   
   ============================================================================== */

.toast,
.notification {
    animation: toastSlideIn var(--anim-normal) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.is-leaving,
.notification.is-leaving {
    animation: toastSlideOut var(--anim-fast) ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ==================== SCROLL-TRIGGERED ANIMATIONS ====================
   
   Les éléments s'animent lorsqu'ils entrent dans le champ de vision.
   
   ============================================================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--anim-normal) ease-out;
}

.scroll-reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== PARALLAX EFFECT ====================
   
   Effet de parallaxe subtil sur les sections principales.
   
   ============================================================================== */

.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

/* ==================== ACCESSIBILITY: REDUCED MOTION ====================
   
   Respecter les préférences de mouvement réduit des utilisateurs.
   
   ============================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== DARK MODE ENHANCEMENTS ====================
   
   Assurer que tout fonctionne parfaitement en mode sombre (par défaut ici).
   
   ============================================================================== */

@media (prefers-color-scheme: dark) {
    body {
        background: var(--void-black);
        color: var(--text);
    }
}

/* ==================== RESPONSIVE ADJUSTMENTS ====================
   
   Adapter les animations et les espacements pour les petits écrans.
   
   ============================================================================== */

@media (max-width: 768px) {
    .product-card:hover,
    .glass-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .btn-primary,
    .btn-dark {
        min-height: 44px; /* Taille minimale pour les touches tactiles */
    }
    
    .data-particle {
        font-size: 0.6rem;
    }
}

/* ==================== PERFORMANCE OPTIMIZATION ====================
   
   Utiliser will-change et transform3d pour optimiser les performances.
   
   ============================================================================== */

.product-card,
.glass-card,
.btn-primary,
.btn-dark {
    will-change: transform, box-shadow;
    transform: translate3d(0, 0, 0);
}

.digital-veil::before {
    will-change: background-position;
}
