/**
 * Header Principal - QuantisDigitale
 * Navigation, Logo, Actions, Menu Burger
 */

/* ========================================
   HEADER PRINCIPAL
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--couleur-fond-principal);
    border-bottom: var(--bordure-1) solid var(--couleur-bordure);
    transition: all var(--duree-normale) var(--easing-smooth);
    backdrop-filter: blur(10px);
}

/* Header scrollé - Mode sombre */
.header.scrolled {
    box-shadow: var(--ombre-md);
    background: rgba(11, 15, 14, 0.95);
}

/* Header scrollé - Mode clair */
:root.clair .header.scrolled,
[data-theme="clair"] .header.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

/* Container du header */
.header-container {
    max-width: var(--conteneur-2xl);
    margin: 0 auto;
    padding: 0 var(--espace-6);
    height: var(--hauteur-header-desktop);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--espace-8);
}

/* ========================================
   LOGO
   ======================================== */

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--espace-3);
    text-decoration: none;
    transition: var(--transition-normale);
    flex-shrink: 0;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* Logo Q (mobile uniquement) */
.logo-q {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--couleur-accent);
    border-radius: var(--rayon-md);
    align-items: center;
    justify-content: center;
    font-family: var(--polices-titres);
    font-weight: var(--poids-bold);
    font-size: var(--texte-xl);
    color: var(--couleur-fond-principal);
}

/* Mobile : afficher Q, cacher texte */
@media (max-width: 768px) {
    .logo-q {
        display: flex;
    }
    
    .logo-texte {
        display: none;
    }
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-texte {
    font-family: var(--polices-titres);
    font-size: var(--texte-xl);
    font-weight: var(--poids-bold);
    color: var(--couleur-texte);
    letter-spacing: -0.5px;
}

/* ========================================
   NAVIGATION DESKTOP
   ======================================== */

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-liste {
    display: flex;
    align-items: center;
    gap: var(--espace-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-lien {
    display: flex;
    align-items: center;
    gap: var(--espace-2);
    padding: var(--espace-3) var(--espace-4);
    color: var(--couleur-texte-secondaire);
    text-decoration: none;
    font-family: var(--polices-texte);
    font-size: var(--texte-base);
    font-weight: var(--poids-medium);
    border-radius: var(--rayon-lg);
    transition: var(--transition-rapide);
    position: relative;
}

.nav-lien i {
    font-size: var(--texte-lg);
    transition: var(--transition-rapide);
}

/* Hover */
.nav-lien:hover {
    color: var(--couleur-texte);
    background: var(--couleur-fond-carte-hover);
}

.nav-lien:hover i {
    color: var(--couleur-accent);
    transform: translateY(-2px);
}

/* Active */
.nav-lien.active {
    color: var(--couleur-accent);
    background: var(--couleur-succes-fond);
    font-weight: var(--poids-semibold);
}

.nav-lien.active i {
    color: var(--couleur-accent);
}

/* Indicateur actif */
.nav-lien.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--couleur-accent);
    border-radius: var(--rayon-pilule);
}

/* ========================================
   ACTIONS (Toggle + CTA)
   ======================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--espace-3);
    flex-shrink: 0;
}

/* Bouton CTA Espace Client */
.bouton-cta {
    display: flex;
    align-items: center;
    gap: var(--espace-2);
    padding: var(--espace-3) var(--espace-5);
    background: var(--couleur-accent);
    color: var(--couleur-fond-principal);
    text-decoration: none;
    font-family: var(--polices-texte);
    font-size: var(--texte-base);
    font-weight: var(--poids-semibold);
    border-radius: var(--rayon-pilule);
    transition: all var(--duree-normale) var(--easing-bounce);
    box-shadow: var(--ombre-sm);
}

.bouton-cta:hover {
    background: var(--couleur-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--ombre-accent);
}

.bouton-cta i {
    font-size: var(--texte-lg);
}

/* ========================================
   SÉLECTEUR DE LANGUE
   ======================================== */

.selecteur-langue {
    position: relative;
}

.langue-trigger {
    display: flex;
    align-items: center;
    gap: var(--espace-2);
    padding: var(--espace-2) var(--espace-3);
    background: var(--couleur-fond-carte);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-lg);
    cursor: pointer;
    transition: var(--transition-rapide);
    color: var(--couleur-texte);
    font-family: var(--polices-texte);
    font-size: var(--texte-sm);
    font-weight: var(--poids-medium);
}

.langue-trigger:hover {
    background: var(--couleur-fond-carte-hover);
    border-color: var(--couleur-bordure-hover);
}

.langue-trigger.active {
    border-color: var(--couleur-accent);
    background: var(--couleur-succes-fond);
}

.langue-drapeau {
    font-size: var(--texte-xl);
    line-height: 1;
    flex-shrink: 0;
}

.langue-code {
    font-weight: var(--poids-semibold);
    min-width: 24px;
    flex-shrink: 0;
}

.langue-arrow {
    font-size: var(--texte-xs);
    transition: transform var(--duree-rapide);
    color: var(--couleur-texte-secondaire);
    margin-left: auto;
}

.langue-trigger.active .langue-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.langue-dropdown {
    position: absolute;
    top: calc(100% + var(--espace-2));
    right: 0;
    background: var(--couleur-fond-secondaire);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-lg);
    box-shadow: var(--ombre-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--duree-rapide) var(--easing-smooth);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.langue-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.langue-option {
    display: flex;
    align-items: center;
    gap: var(--espace-3);
    padding: var(--espace-3) var(--espace-4);
    color: var(--couleur-texte);
    text-decoration: none;
    transition: var(--transition-rapide);
    font-size: var(--texte-sm);
    position: relative;
}

.langue-option:hover {
    background: var(--couleur-fond-carte-hover);
}

.langue-option.active {
    background: var(--couleur-succes-fond);
    color: var(--couleur-accent);
    font-weight: var(--poids-semibold);
}

.langue-option .langue-drapeau {
    font-size: var(--texte-2xl);
    flex-shrink: 0;
}

.langue-option .langue-nom {
    flex: 1;
}

/* Check mark pour langue active */
.langue-option.active::after {
    content: '✓';
    color: var(--couleur-accent);
    font-weight: var(--poids-bold);
    font-size: var(--texte-lg);
}

/* ========================================
   RESPONSIVE LANGUE
   ======================================== */

@media (max-width: 768px) {
    .langue-trigger {
        padding: var(--espace-2);
    }
    
    .langue-code {
        display: none;
    }
    
    .langue-trigger .langue-drapeau {
        font-size: var(--texte-2xl);
    }
    
    .langue-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .langue-dropdown.active {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .langue-dropdown {
        min-width: 180px;
    }
}

/* ========================================
   MENU BURGER (MOBILE)
   ======================================== */

.bouton-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--espace-2);
    position: relative;
    z-index:10000;
}

.burger-ligne {
    width: 100%;
    height: 3px;
    background: var(--couleur-texte);
    border-radius: var(--rayon-pilule);
    transition: all var(--duree-normale) var(--easing-smooth);
}

/* Animation burger actif (X complet) */
.bouton-burger.active .burger-ligne:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.bouton-burger.active .burger-ligne:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.bouton-burger.active .burger-ligne:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ========================================
   NAVIGATION MOBILE (PLEIN ÉCRAN)
   ======================================== */

.nav-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--couleur-fond-principal);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: var(--espace-8) var(--espace-6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--duree-normale) var(--easing-smooth);
}

.nav-mobile.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Header du menu mobile */
.nav-mobile-header {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--espace-8);
}

/* Logo dans menu mobile */
.nav-mobile-logo {
    display: flex;
    align-items: center;
    gap: var(--espace-3);
    text-decoration: none;
    transition: var(--transition-normale);
}

.nav-mobile-logo:hover {
    transform: scale(1.05);
}

.nav-mobile-logo .logo-q {
    display: flex;
    width: 50px;
    height: 50px;
    background: var(--couleur-accent);
    border-radius: var(--rayon-lg);
    align-items: center;
    justify-content: center;
    font-family: var(--polices-titres);
    font-weight: var(--poids-bold);
    font-size: var(--texte-2xl);
    color: var(--couleur-fond-principal);
    box-shadow: var(--ombre-accent);
}

.nav-mobile-logo .logo-texte {
    font-family: var(--polices-titres);
    font-size: var(--texte-2xl);
    font-weight: var(--poids-bold);
    color: var(--couleur-texte);
}

/* Animation d'entrée du logo */
.nav-mobile.active .nav-mobile-logo {
    animation: logoZoomIn 0.5s var(--easing-bounce);
}

@keyframes logoZoomIn {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Bouton fermeture menu mobile */
.nav-mobile-close {
    width: 50px;
    height: 50px;
    background: var(--couleur-fond-carte);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-rond);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normale);
    color: var(--couleur-texte);
}

.nav-mobile-close:hover {
    background: var(--couleur-accent);
    border-color: var(--couleur-accent);
    color: var(--couleur-fond-principal);
    transform: rotate(90deg) scale(1.1);
}

.nav-mobile-close i {
    font-size: var(--texte-2xl);
}

/* Animation d'entrée du bouton fermeture */
.nav-mobile.active .nav-mobile-close {
    animation: bounceIn 0.6s var(--easing-bounce);
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Navigation */
.nav-mobile nav {
    width: 100%;
    max-width: 500px;
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-mobile-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--espace-3);
    width: 100%;
}

.nav-mobile-lien {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--espace-4);
    padding: var(--espace-5) var(--espace-6);
    color: var(--couleur-texte-secondaire);
    text-decoration: none;
    font-family: var(--polices-texte);
    font-size: var(--texte-2xl);
    font-weight: var(--poids-medium);
    transition: all var(--duree-rapide);
    border-radius: var(--rayon-xl);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Effet de fond au hover */
.nav-mobile-lien::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--couleur-fond-carte-hover);
    transition: left var(--duree-rapide) var(--easing-smooth);
    z-index: -1;
}

.nav-mobile-lien:hover::before {
    left: 0;
}

.nav-mobile-lien i:first-child {
    font-size: var(--texte-3xl);
    width: 40px;
    text-align: center;
    transition: var(--transition-normale);
}

.nav-mobile-lien span {
    flex: 1;
}

/* Flèche à droite */
.nav-arrow {
    font-size: var(--texte-lg);
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--duree-rapide);
}

.nav-mobile-lien:hover {
    color: var(--couleur-texte);
    border-left-color: var(--couleur-accent);
    padding-left: calc(var(--espace-6) + var(--espace-2));
}

.nav-mobile-lien:hover i:first-child {
    color: var(--couleur-accent);
    transform: scale(1.2) rotate(5deg);
}

.nav-mobile-lien:hover .nav-arrow {
    opacity: 1;
    transform: translateX(0);
}

.nav-mobile-lien.active {
    background: var(--couleur-succes-fond);
    color: var(--couleur-accent);
    border-left-color: var(--couleur-accent);
    font-weight: var(--poids-semibold);
}

.nav-mobile-lien.active i:first-child {
    color: var(--couleur-accent);
}

.nav-mobile-lien.active .nav-arrow {
    opacity: 1;
    color: var(--couleur-accent);
}

/* Animation d'entrée des liens */
.nav-mobile.active .nav-mobile-lien {
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
}

.nav-mobile.active .nav-mobile-lien:nth-child(1) { animation-delay: 0.1s; }
.nav-mobile.active .nav-mobile-lien:nth-child(2) { animation-delay: 0.15s; }
.nav-mobile.active .nav-mobile-lien:nth-child(3) { animation-delay: 0.2s; }
.nav-mobile.active .nav-mobile-lien:nth-child(4) { animation-delay: 0.25s; }
.nav-mobile.active .nav-mobile-lien:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Footer du menu mobile */
.nav-mobile-footer {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding-top: var(--espace-6);
    border-top: var(--bordure-1) solid var(--couleur-bordure);
}

.nav-mobile-tagline {
    font-family: var(--polices-texte);
    font-size: var(--texte-base);
    color: var(--couleur-texte-secondaire);
    margin-bottom: var(--espace-4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--espace-2);
}

.nav-mobile-tagline i {
    color: var(--couleur-accent);
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 0.8; }
}

/* Réseaux sociaux */
.nav-mobile-socials {
    display: flex;
    justify-content: center;
    gap: var(--espace-3);
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--couleur-fond-carte);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-rond);
    color: var(--couleur-texte);
    text-decoration: none;
    transition: all var(--duree-normale);
}

.social-link:hover {
    background: var(--couleur-accent);
    border-color: var(--couleur-accent);
    color: var(--couleur-fond-principal);
    transform: translateY(-5px) rotate(5deg);
}

.social-link i {
    font-size: var(--texte-xl);
}

/* Animation d'entrée du footer */
.nav-mobile.active .nav-mobile-footer {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-mobile {
        padding: var(--espace-6) var(--espace-4);
    }
    
    .nav-mobile-lien {
        font-size: var(--texte-xl);
        padding: var(--espace-4) var(--espace-5);
    }
    
    .nav-mobile-lien i:first-child {
        font-size: var(--texte-2xl);
        width: 32px;
    }
}

/* Masquer CTA dans menu mobile */
.nav-mobile-cta {
    display: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }
    
    .bouton-burger {
        display: flex;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: var(--hauteur-header-mobile);
        padding: 0 var(--espace-4);
    }
    
    .bouton-cta {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: var(--rayon-rond);
    }
    
    .bouton-cta span {
        display: none;
    }
    
    .bouton-cta i {
        font-size: var(--texte-lg);
        margin: 0;
    }
    
    .nav-mobile-lien {
        font-size: var(--texte-xl);
        padding: var(--espace-4) var(--espace-5);
    }
    
    .nav-mobile-lien i {
        font-size: var(--texte-2xl);
        width: 32px;
    }
}

@media (max-width: 480px) {
    .header-container {
        gap: var(--espace-3);
        padding: 0 var(--espace-3);
    }
    
    .header-actions {
        gap: var(--espace-2);
    }
    
    .bouton-burger {
        width: 36px;
        height: 36px;
    }
    
    .burger-ligne {
        height: 2.5px;
    }
}