/* ═══════════════════════════════════════════════════════════
   🎨 OPTIMISATION IMAGES ET EFFETS VISUELS - BSN FINANCEMENT 2025
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────── */
/* 1. HERO SECTIONS AVEC IMAGES DE FOND PROFESSIONNELLES      */
/* ─────────────────────────────────────────────────────────── */

/* Page d'accueil - Bank Service */
.hero-home {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%),
                url('../img/backgrounds/bank-service.html');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Effet parallax */
    position: relative;
    overflow: hidden;
}

/* Pages crédit - Bank Concepts */
.hero-credit {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.9) 0%, rgba(0, 242, 254, 0.9) 100%),
                url('../img/backgrounds/bank-concepts.html');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* Pages institutionnelles - Skyscrapers */
.hero-corporate {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.85) 0%, rgba(56, 249, 215, 0.85) 100%),
                url('../img/business-8577380_1280.jpg');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    position: relative;
}

/* Pages internationales - International */
.hero-international {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.88) 0%, rgba(245, 87, 108, 0.88) 100%),
                url('../img/backgrounds/international.html');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* Pages communauté - Global Hands */
.hero-community {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%),
                url('../img/backgrounds/global-hands.html');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* ─────────────────────────────────────────────────────────── */
/* 2. EFFETS VISUELS AVANCÉS                                   */
/* ─────────────────────────────────────────────────────────── */

/* Overlay animé */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.1), rgba(0,0,0,0.05));
    pointer-events: none;
    animation: overlayPulse 10s ease-in-out infinite;
}

@keyframes overlayPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* Formes décoratives animées */
.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.hero-shapes .shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation: float 20s ease-in-out infinite;
}

.hero-shapes .shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: 10%;
    animation: float 15s ease-in-out infinite reverse;
}

.hero-shapes .shape-3 {
    width: 150px;
    height: 150px;
    top: 30%;
    left: -75px;
    animation: float 18s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

/* ─────────────────────────────────────────────────────────── */
/* 3. LAZY LOADING OPTIMISÉ                                    */
/* ─────────────────────────────────────────────────────────── */

/* Image en cours de chargement */
img[loading="lazy"] {
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
    to { background-position-x: -200%; }
}

/* Image chargée */
img[loading="lazy"].loaded {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ─────────────────────────────────────────────────────────── */
/* 4. EFFETS HOVER AVANCÉS                                     */
/* ─────────────────────────────────────────────────────────── */

/* Cards avec effet glassmorphism */
.card-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glass:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

/* Effet shine sur les boutons */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ─────────────────────────────────────────────────────────── */
/* 5. ANIMATIONS D'APPARITION                                  */
/* ─────────────────────────────────────────────────────────── */

/* Fade in from bottom */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

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

/* Stagger animation pour listes */
.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up:nth-child(5) { animation-delay: 0.5s; }
.fade-in-up:nth-child(6) { animation-delay: 0.6s; }

/* Zoom in */
.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    animation: zoomIn 0.6s ease-out forwards;
}

@keyframes zoomIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide in from left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s ease-out forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─────────────────────────────────────────────────────────── */
/* 6. RESPONSIVE OPTIMISÉ                                      */
/* ─────────────────────────────────────────────────────────── */

/* Désactiver parallax sur mobile pour performance */
@media (max-width: 768px) {
    .hero-home,
    .hero-credit,
    .hero-corporate,
    .hero-international,
    .hero-community {
        background-attachment: scroll !important;
        background-size: cover;
        background-position: center;
    }
    
    /* Simplifier les animations sur mobile */
    .hero-shapes .shape {
        animation: none !important;
        opacity: 0.3;
    }
    
    /* Adapter les cards */
    .card-glass:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

/* Tablette */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-shapes .shape-1 { width: 200px; height: 200px; }
    .hero-shapes .shape-2 { width: 150px; height: 150px; }
    .hero-shapes .shape-3 { width: 100px; height: 100px; }
}

/* Desktop large */
@media (min-width: 1920px) {
    .hero-home,
    .hero-credit,
    .hero-corporate,
    .hero-international,
    .hero-community {
        background-size: cover;
        background-position: center;
    }
}

/* ─────────────────────────────────────────────────────────── */
/* 7. OPTIMISATION PERFORMANCES                                */
/* ─────────────────────────────────────────────────────────── */

/* Préchargement des images critiques */
@media (prefers-reduced-motion: no-preference) {
    /* Animations activées */
}

@media (prefers-reduced-motion: reduce) {
    /* Désactiver toutes les animations pour accessibilité */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU acceleration pour les éléments animés */
.hero-shapes .shape,
.card-glass,
.btn-shine {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ─────────────────────────────────────────────────────────── */
/* 8. EFFETS DE TEXTE PREMIUM                                  */
/* ─────────────────────────────────────────────────────────── */

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shadow-premium {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1),
                 0 4px 20px rgba(102, 126, 234, 0.2);
}

/* ─────────────────────────────────────────────────────────── */
/* 9. SKELETON LOADING                                         */
/* ─────────────────────────────────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 32px;
    margin-bottom: 16px;
    width: 60%;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* ─────────────────────────────────────────────────────────── */
/* 10. EFFETS INTERACTIFS AVANCÉS                              */
/* ─────────────────────────────────────────────────────────── */

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Tilt effect au survol */
.tilt-on-hover {
    transition: transform 0.3s ease;
}

.tilt-on-hover:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(2deg);
}

/* ─────────────────────────────────────────────────────────── */
/* 11. EFFETS DE PROFONDEUR 3D                                 */
/* ─────────────────────────────────────────────────────────── */

.depth-shadow {
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.12),
        0 1px 2px rgba(0,0,0,0.24);
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}

.depth-shadow:hover {
    box-shadow: 
        0 14px 28px rgba(0,0,0,0.15),
        0 10px 10px rgba(0,0,0,0.12);
}

.depth-shadow-premium {
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.15),
        0 5px 15px rgba(102, 126, 234, 0.1);
}

.depth-shadow-premium:hover {
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.25),
        0 10px 30px rgba(102, 126, 234, 0.15);
}

/* ─────────────────────────────────────────────────────────── */
/* 12. INDICATEURS DE CHARGEMENT                               */
/* ─────────────────────────────────────────────────────────── */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dots loading */
.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ─────────────────────────────────────────────────────────── */
/* 13. MAPS DE FONDS POUR HÉROS SPÉCIFIQUES                    */
/* ─────────────────────────────────────────────────────────── */

.hero-credit-personnel {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.9) 0%, rgba(0, 68, 136, 0.9) 50%, rgba(0, 188, 212, 0.9) 100%),
                url('../img/business-8577380_1280.jpg');
    background-size: cover;
    background-position: center;
}

.hero-credit-auto {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.9) 0%, rgba(0, 68, 136, 0.9) 50%, rgba(0, 188, 212, 0.9) 100%),
                url('../img/auto-financing.html');
    background-size: cover;
    background-position: center;
}

.hero-credit-travaux {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.9) 0%, rgba(0, 68, 136, 0.9) 50%, rgba(0, 188, 212, 0.9) 100%),
                url('../img/home-ownership.jpg');
    background-size: cover;
    background-position: center;
}

.hero-rachat {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.9) 0%, rgba(0, 68, 136, 0.9) 50%, rgba(0, 188, 212, 0.9) 100%),
                url('../img/electronic-payments.jpg');
    background-size: cover;
    background-position: center;
}

.hero-assurances {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.9) 0%, rgba(0, 68, 136, 0.9) 50%, rgba(0, 188, 212, 0.9) 100%),
                url('../img/insurance-(Petite.html).png');
    background-size: cover;
    background-position: center;
}

/* Taille et comportement par défaut des sections hero */
.hero {
    position: relative;
    color: #fff;
    min-height: 520px;
}

/* ═══════════════════════════════════════════════════════════
   FIN DU FICHIER - OPTIMISATION IMAGES BSN FINANCEMENT 2025
   ═══════════════════════════════════════════════════════════ */
