/* ===================================================
   NOUVEAU HERO - DESIGN COMPLET
   ================================================= */

/* Section hero principale avec fond uniforme et motifs */
.hero-new {
    width: 100%;
    min-height: auto; /* Hauteur automatique au lieu de 100vh */
    padding: 40px 0; /* Padding vertical contrôlé */
    background: linear-gradient(135deg, #1a2332 0%, #2c3e50 50%, #34495e 100%);
    position: relative;
    overflow: visible; /* Changé de hidden à visible pour ne jamais couper l'image */
}

/* Effet de particules animées en arrière-plan */
.hero-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 40% 60%, rgba(255, 165, 0, 0.04) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
    animation: particlesFloat 15s ease-in-out infinite;
}

/* Lignes décoratives diagonales */
.hero-new::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, transparent 48%, rgba(255, 215, 0, 0.03) 48%, rgba(255, 215, 0, 0.03) 52%, transparent 52%);
    background-size: 60px 60px;
    z-index: 1;
    opacity: 0.5;
    pointer-events: none;
}

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

/* ===================================================
   DESKTOP >= 900px
   ================================================= */

/* Container principal - Layout horizontal */
.hero-container {
    display: flex;
    align-items: center; /* Centrer verticalement au lieu de stretch */
    min-height: auto; /* Hauteur automatique */
    position: relative;
    z-index: 2;
    overflow: visible; /* Ne jamais couper le contenu */
    max-width: 100%; /* Ne jamais dépasser la largeur de l'écran */
    padding: 0 20px; /* Padding horizontal par défaut */
    box-sizing: border-box;
}

/* Section gauche - Contenu */
.hero-left {
    flex: 0 0 45%;
    max-width: 45%; /* Limite stricte */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 40px; /* Padding vertical réduit de 60px à 30px */
    position: relative;
    box-sizing: border-box;
}

/* Contenu du hero */
.hero-content {
    max-width: 550px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2; /* Au-dessus de l'effet particules */
}

/* Logo desktop */
.hero-logo-desktop {
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

.hero-logo-desktop img {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(255, 215, 0, 0.3));
    transition: all 0.3s ease;
}

.hero-logo-desktop img:hover {
    filter: brightness(0) invert(1) drop-shadow(0 6px 20px rgba(255, 215, 0, 0.5));
    transform: scale(1.02);
}

/* Barre diagonale supprimée - Plus besoin */
.hero-divider {
    display: none;
}

/* Section droite - Image */
.hero-right {
    flex: 1;
    max-width: 55%; /* Limite pour ne pas déborder */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 40px; /* Padding vertical réduit de 40px à 30px */
    position: relative;
    overflow: visible; /* Ne jamais couper l'image */
    box-sizing: border-box;
}

.hero-image {
    /* L'image définit sa propre taille et se réduit si nécessaire */
    max-width: 100%;
    max-height: none; /* Enlevé la contrainte 90vh qui pouvait couper */
    width: 100%; /* Force à prendre toute la largeur disponible */
    height: auto; /* Hauteur automatique pour garder le ratio */
    /* Aspect ratio de l'image: 1248/832 = 1.5 */
    object-fit: contain;
    animation: fadeInScale 1s ease-out;
    /* Joli cadre exactement à la taille de l'image */
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 215, 0, 0.03) 100%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 215, 0, 0.1);
    transition: all 0.4s ease;
    /* Le cadre épouse exactement la taille intrinsèque de l'image */
    display: block;
    box-sizing: border-box; /* Important pour inclure la bordure dans la largeur */
}

.hero-image:hover {
    transform: scale(1.02);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 215, 0, 0.2);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Texte - Titre */
.hero-title {
    font-size: 42px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
    text-align: center;
}

/* Texte - Sous-titre */
.hero-subtitle {
    font-size: 36px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 30px;
    text-shadow:
        2px 2px 6px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.4);
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.hero-subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        #FFD700 20%,
        #FFA500 50%,
        #FFD700 80%,
        transparent 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    /* Animation qui part du centre */
    animation: underlineExpandFromCenter 1.2s ease-out 0.8s backwards;
}

/* Animation du trait qui part du centre et s'étend */
@keyframes underlineExpandFromCenter {
    0% {
        width: 0%;
        opacity: 0;
    }
    100% {
        width: 80%;
        opacity: 1;
    }
}

/* Texte - Description */
.hero-description {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 20px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
    text-align: center;
}

.hero-description .highlight {
    color: #FFD700;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Ligne téléphone */
.hero-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 35px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.8s ease-out 0.8s backwards;
}

.phone-icon {
    font-size: 26px;
    animation: phonePulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

@keyframes phonePulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-5deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.15) rotate(5deg); }
}

/* Bouton CTA */
.hero-btn {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    color: #1a2332;
    padding: 18px 45px;
    font-size: 19px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 6px 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.2);
    animation: fadeInUp 0.8s ease-out 1s backwards;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 10px 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.3);
}

.hero-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Trust indicator */
.hero-trust {
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 1.2s backwards;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===================================================
   INTERMÉDIAIRE 1151px - 1300px
   ================================================= */

@media (min-width: 1151px) and (max-width: 1300px) {
    .hero-new {
        overflow: visible !important;
    }

    .hero-container {
        padding: 30px 15px;
        overflow: visible !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero-left {
        flex: 0 0 47%;
        max-width: 47%;
        padding: 30px 20px;
    }

    .hero-right {
        flex: 0 0 47%;
        max-width: 47%;
        padding: 30px 15px;
        overflow: visible !important;
        box-sizing: border-box;
    }

    .hero-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        box-sizing: border-box;
    }

    .language-switcher-hero {
        gap: 6px;
        padding: 6px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .language-btn-hero {
        padding: 10px 16px;
        font-size: 14px;
    }

    .language-flag {
        font-size: 20px;
    }
}

/* ===================================================
   INTERMÉDIAIRE 900px - 1150px
   ================================================= */

@media (min-width: 900px) and (max-width: 1150px) {
    /* Réduire la hauteur minimale du hero */
    .hero-new {
        min-height: auto; /* Enlever le min-height: 100vh */
        padding: 30px 0; /* Padding réduit de 40px à 30px */
        overflow: visible !important; /* JAMAIS couper */
    }

    .hero-container {
        min-height: auto;
        padding: 20px 10px 15px 10px; /* Ajout padding horizontal pour éviter débordement */
        overflow: visible !important; /* JAMAIS couper */
        max-width: 100%; /* Ne jamais dépasser la largeur de l'écran */
        box-sizing: border-box;
    }

    /* Section gauche - texte - padding réduit */
    .hero-left {
        flex: 0 0 48%; /* Réduit de 50% à 48% */
        padding: 20px 20px; /* Réduit padding horizontal */
        max-width: 48%;
    }

    /* Section droite - image avec structure flex pour logo au-dessus */
    .hero-right {
        flex: 0 0 48%; /* Réduit de 50% à 48% */
        padding: 15px 10px; /* Padding horizontal encore plus réduit */
        overflow: visible !important; /* JAMAIS couper */
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        max-width: 48%; /* Limite stricte */
    }

    /* Logo dans la section droite - JUSTE au-dessus de l'image */
    .hero-left .hero-logo-desktop {
        display: none; /* Cacher le logo de la section gauche */
    }

    /* Créer un pseudo-logo via ::before JUSTE au-dessus de l'image */
    .hero-right::before {
        content: '';
        width: 220px; /* Réduit de 260px à 220px */
        height: 70px; /* Réduit de 80px à 70px */
        background-image: url('../images/VMAIL_logo_EN_transparent.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(255, 215, 0, 0.3));
        flex-shrink: 0;
        margin-bottom: 15px; /* Espacement plus contrôlé */
    }

    /* Masquer le logo du content */
    .hero-content .hero-logo-desktop {
        display: none;
    }

    /* L'image prend sa place naturellement après le logo */
    .hero-right .hero-image {
        max-width: 100%;
        width: 100%; /* Prend toute la largeur disponible */
        height: auto; /* Hauteur auto pour garder ratio */
        max-height: none; /* Pas de limite de hauteur */
        object-fit: contain; /* Ne jamais couper */
        flex-shrink: 1; /* Peut se réduire si nécessaire */
        box-sizing: border-box; /* Inclut border et padding dans la largeur */
    }

    /* Ajuster les tailles de texte */
    .hero-title {
        font-size: 34px;
    }

    .hero-subtitle {
        font-size: 28px;
    }

    .hero-description {
        font-size: 17px;
    }

    .hero-phone {
        font-size: 19px;
    }

    .hero-btn {
        font-size: 17px;
        padding: 16px 38px;
    }

    /* Réduire le sélecteur de langue pour économiser de l'espace */
    .language-switcher-hero {
        gap: 5px;
        padding: 5px;
        margin-bottom: 10px;
        max-width: 100%; /* Ne jamais dépasser */
        box-sizing: border-box;
    }

    .language-btn-hero {
        padding: 8px 12px; /* Encore plus réduit */
        font-size: 13px;
        gap: 6px;
    }

    .language-flag {
        font-size: 18px;
    }

    .language-name {
        font-size: 13px;
    }
}

/* ===================================================
   MOBILE < 900px
   ================================================= */

/* Cacher les éléments desktop en mobile */
.hero-logo-mobile,
.hero-image-mobile,
.hero-text-mobile {
    display: none;
}

@media (max-width: 899px) {
    /* Cacher les éléments desktop */
    .hero-container {
        display: none;
    }

    /* Afficher les éléments mobile */
    .hero-logo-mobile,
    .hero-image-mobile,
    .hero-text-mobile {
        display: block;
    }

    /* Structure mobile: Logo > Image > Texte */
    .hero-new {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
        min-height: auto;
        overflow: visible; /* Important: ne jamais couper le contenu */
    }

    /* Logo mobile en haut */
    .hero-logo-mobile {
        width: 100%;
        max-width: 300px;
        margin: 0 auto 40px auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        animation: fadeInDown 0.8s ease-out;
    }

    .hero-logo-mobile img {
        width: 100%;
        height: auto;
        filter: brightness(0) invert(1) drop-shadow(0 4px 12px rgba(255, 215, 0, 0.3));
    }

    /* Image mobile au milieu avec cadre */
    .hero-image-mobile {
        width: 100%;
        max-width: 500px;
        margin: 0 auto 40px auto;
        animation: fadeInScale 1s ease-out 0.3s backwards;
    }

    .hero-image-mobile img {
        width: 100%;
        height: auto;
        object-fit: contain;
        /* Joli cadre exactement à la taille de l'image */
        border-radius: 20px;
        border: 3px solid rgba(255, 255, 255, 0.15);
        background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 215, 0, 0.03) 100%);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 0 60px rgba(255, 215, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            inset 0 -1px 0 rgba(255, 215, 0, 0.1);
        transition: all 0.4s ease;
        display: block;
    }

    .hero-image-mobile img:hover {
        transform: scale(1.02);
        border-color: rgba(255, 215, 0, 0.3);
        box-shadow:
            0 12px 48px rgba(0, 0, 0, 0.4),
            0 0 80px rgba(255, 215, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3),
            inset 0 -1px 0 rgba(255, 215, 0, 0.2);
    }

    /* Texte mobile en bas */
    .hero-text-mobile {
        width: 100%;
        max-width: 600px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-text-mobile .hero-title {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .hero-text-mobile .hero-subtitle {
        font-size: 28px;
        margin-bottom: 25px;
    }

    .hero-text-mobile .hero-description {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .hero-text-mobile .hero-phone {
        font-size: 20px;
        margin-bottom: 30px;
    }

    .hero-text-mobile .hero-btn {
        font-size: 18px;
        padding: 16px 40px;
    }

    .hero-text-mobile .hero-trust {
        font-size: 14px;
        margin-top: 20px;
    }
}

/* Responsive très petit écran */
@media (max-width: 600px) {
    .hero-text-mobile .hero-title {
        font-size: 28px;
    }

    .hero-text-mobile .hero-subtitle {
        font-size: 24px;
    }

    .hero-text-mobile .hero-description {
        font-size: 16px;
    }

    .hero-text-mobile .hero-phone {
        font-size: 18px;
        flex-wrap: wrap;
    }

    .hero-text-mobile .hero-btn {
        font-size: 16px;
        padding: 14px 35px;
    }
}

/* ===================================================
   RTL SUPPORT - Mode Hébreu - Logo
   ================================================= */

/* Cadre premium pour le logo hébreu */
html[dir="rtl"] .hero-logo-desktop img,
html[dir="rtl"] .hero-logo-mobile img {
    filter: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px 35px;
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 3px solid transparent;
    background-image:
        linear-gradient(white, white),
        linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

/* Effet de brillance douce sur le cadre */
html[dir="rtl"] .hero-logo-desktop img::before,
html[dir="rtl"] .hero-logo-mobile img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

html[dir="rtl"] .hero-logo-desktop img:hover,
html[dir="rtl"] .hero-logo-mobile img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    html[dir="rtl"] .hero-logo-desktop img,
    html[dir="rtl"] .hero-logo-mobile img {
        padding: 20px 30px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    html[dir="rtl"] .hero-logo-desktop img,
    html[dir="rtl"] .hero-logo-mobile img {
        padding: 15px 25px;
        border-radius: 14px;
    }
}
