/* ===== HEADER PROFESSIONNEL ===== */
.hero-header {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem 0;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.header-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: url("../images/portailBackground.jpg") no-repeat center center; */
    background-size: cover;
    animation: kenburns 30s ease-in-out infinite alternate;
}

@keyframes kenburns {
    0% {
        transform: scale(1) translateX(0) translateY(0);
    }
    50% {
        transform: scale(1.1) translateX(-20px) translateY(10px);
    }
    100% {
        transform: scale(1.05) translateX(20px) translateY(-10px);
    }
}

.overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 141, 54, 0.85) 0%,
        rgba(0, 100, 35, 0.8) 25%,
        rgba(202, 202, 202, 0.7) 100%
    );
    backdrop-filter: blur(2px);
}

.header-content{
    position: relative;
    z-index: 3;
    text-align: center;
    padding-bottom: 120px; /* réserve ~120px pour la barre de stats */
    display: flex;
    flex-direction: column;
    justify-content: center; /* centre le bloc branding sans toucher aux stats */
  }

/* Branding */
.university-brand {
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.university-logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.institution-name {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ffffff, #e8f5e8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.institution-acronym {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 2px;
}

.institution-tagline {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    font-weight: 300;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Statistiques */
.stats-container {
    margin: 3rem 0;
    position: absolute;
    left: 0; right: 0; bottom: 8px;
    margin: 0;
    z-index: 3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.stat-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-label {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 3rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-arrow:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.scroll-arrow i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.element-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    width: 50px;
    height: 50px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.element-3 {
    width: 30px;
    height: 30px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.element-4 {
    width: 40px;
    height: 40px;
    top: 30%;
    right: 25%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .institution-name {
        font-size: 2rem;
    }
    
    .institution-acronym {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .hero-header {
        min-height: 80vh;
        padding: 1rem 0;
    }
    
    .university-logo {
        height: 80px;
    }
    
    .logo-glow {
        width: 100px;
        height: 100px;
    }
    
    .institution-name {
        font-size: 1.5rem;
    }
    
    .institution-acronym {
        font-size: 2.5rem;
    }
    
    .institution-tagline {
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.5rem 0.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .institution-name {
        font-size: 1.2rem;
    }
    
    .institution-acronym {
        font-size: 2rem;
    }
}


/* Animation d'entrée séquentielle pour les stats */
.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }
.stat-item:nth-child(5) { animation-delay: 0.5s; }

.stat-item {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}


/* Hauteur stricte du header */
.hero-header{
    height:410px; max-height:410px; min-height:unset;
    padding:0.75rem 0; overflow:hidden;
  }
  
  /* Ken Burns plus doux (évite le débord) */
  .header-background::before{
    animation: kenburns 20s ease-in-out infinite alternate;
  }
  @keyframes kenburns{
    0%{transform:scale(1) translate(0,0)}
    50%{transform:scale(1.02) translate(-8px,6px)}
    100%{transform:scale(1.01) translate(8px,-6px)}
  }
  

  @media (max-width: 576px){
    .header-content{ padding-bottom: 136px; }
    .stat-number{ font-size: 1.15rem; }
    .institution-acronym{ font-size: 1.7rem; }
  }
  /* Branding compact */
  .university-logo{height:70px}
  .logo-glow{width:84px;height:84px}
  .institution-name{font-size:2.1rem;margin-bottom:.25rem}
  .institution-acronym{font-size:2rem;margin-bottom:.25rem;letter-spacing:1px}
  .institution-tagline{font-size:.9rem}
  
  /* Stats compactes en bas */
  .stats-container{position:absolute;left:0;right:0;bottom:10px;margin:0}
  .stats-grid{
    max-width:980px;margin:0 auto;gap:.75rem;
    grid-template-columns:repeat(4,minmax(120px,1fr));
  }
  .stat-item{padding:.75rem .5rem;border-radius:14px}
  .stat-icon{font-size:1.25rem;margin-bottom:.25rem}
  .stat-number{font-size:1.4rem}
  .stat-label{font-size:.75rem;letter-spacing:.5px}
  
  /* Masquer l’indicateur de scroll sur ce layout */
  .scroll-indicator{display:none}
  
  /* Responsive: garder 350px et réduire la typo si besoin */
  @media (max-width:768px){
    .university-logo{height:56px}
    .institution-acronym{font-size:1.6rem}
    .institution-name{font-size:.5rem}
    .institution-tagline{font-size:.85rem}
    .stats-grid{gap:.5rem}
    .stat-number{font-size:1.2rem}
  }
  

  /* Réduction légère des stats pour gagner de la place visuelle */
.stats-grid{ gap: .6rem; }
.stat-item{ padding: .6rem .5rem; }
.stat-icon{ font-size: 1.1rem; margin-bottom: .2rem; }
.stat-number{ font-size: 1.25rem; }
.stat-label{ font-size: .7rem; letter-spacing: .4px; }

/* Branding : marge réduite pour éviter de descendre trop bas */
.university-brand{ margin-bottom: .35rem; }
.logo-container{ margin-bottom: .6rem; }
.institution-name{ font-size: 1.5rem;  }
.institution-acronym{ font-size: 1.8rem;  }
.institution-tagline{ font-size: 1.3rem; font-weight: bolder; margin-bottom: .1rem; }


/* --- Responsive: stats en ligne scrollable sous 768px --- */
@media (max-width: 768px){
    /* on garde le header à 350px, on réserve un peu d'espace */
    .header-content{ padding-bottom: 136px; }
  
    .stats-container{ bottom: 1px; }
  
    .stats-grid{
      display: grid;
      grid-auto-flow: column;                 /* une ligne, colonnes successives */
      grid-auto-columns: minmax(140px, 1fr);  /* largeur mini des cartes */
      overflow-x: auto;                       /* scroll horizontal */
      gap: .6rem;
      padding: 0 .5rem;
      -webkit-overflow-scrolling: touch;
      scroll-snap-type: x mandatory;          /* snap confortable */
      scrollbar-width: none;                  /* Firefox */
    }
    .stats-grid::-webkit-scrollbar{ display: none; } /* Chrome/Safari */
  
    .stat-item{
      scroll-snap-align: start;
      padding: .2rem .1rem;
    }
    .stat-icon{ font-size: 1.1rem; margin-bottom: .2rem; }
    .stat-number{ font-size: 1.2rem; }
    .stat-label{ font-size: .7rem; }
  }
  
  /* Option tablette étroite : un peu plus compact */
  @media (max-width: 576px){
    .stats-grid{ grid-auto-columns: minmax(130px, 1fr); gap: .5rem; }
    .stat-number{ font-size: 1.1rem; }
  }
  


  


/* Version minimaliste pour maximiser la visibilité */
/* Version minimaliste … */
.hero-header { background: url('../images/portailBackground.jpg') center/cover no-repeat; }
.header-background,
.overlay-gradient,
.floating-elements {
  display: none;            /*  ⛔ cache aussi ton diaporama placé DANS .header-background  */
}


.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.4); /* Léger fond sombre pour le texte */
    border-radius: 10px;
    margin: 0 auto;
    border: #ffffff46 solid 1px;
    /* max-width: 90%; */
}

/* Supprimer tous les effets qui cachent l'image */
.header-background,
.overlay-gradient,
.floating-elements {
    display: none;
}


/* === FIX DIAPORAMA (forcer l'affichage des couches) === */
.hero-header .header-background,
.hero-header .overlay-gradient,
.hero-header .floating-elements {
  display: block !important;
}

/* Désactiver l'image unique animée si on utilise le slideshow */
.hero-header .header-background::before {
  content: none !important;
}

/* Remettre l'empilement correct: slideshow (hc) au-dessus du ::before, puis overlay, puis contenu */
.hero-header .header-background { z-index: 0 !important; }   /* conteneur de base */
.hero-header .hc { z-index: 1 !important; }                  /* TON diaporama JS (A/B layers) */
.hero-header .overlay-gradient { z-index: 2 !important; }    /* voile de lecture */
.hero-header .header-content { z-index: 3 !important; }      /* textes / logo devant tout */

/* Option: activer explicitement la “version minimaliste” en ajoutant la classe .hero--minimal au header */
.hero--minimal.hero-header {
  background: url('../images/portailBackground.jpg') center/cover no-repeat !important;
}
.hero--minimal .header-background,
.hero--minimal .overlay-gradient,
.hero--minimal .floating-elements {
  display: none !important;
}

/* ==== NETTETÉ & EMPILAGE (override) ==== */
.hero-header { position:relative; overflow:hidden; }
.header-background { position:absolute; inset:0; z-index:0; }
.hero-header .header-background::before { content:none !important; } /* coupe l'ancien fond animé */
.hero-header .overlay-gradient { position:absolute; inset:0; z-index:2; pointer-events:none; }
.hero-header .header-content { position:relative; z-index:3; }

/* PAS DE BLUR SUR L'IMAGE DE FOND */
.hero-header .overlay-gradient { 
  /* garde ton dégradé si tu veux, mais SANS blur */
  background: linear-gradient(180deg, rgba(2,6,23,.35) 0%, rgba(2,6,23,.15) 50%, rgba(2,6,23,.35) 100%) !important;
  backdrop-filter: none !important;
}

/* Les cartes ne doivent plus flouter l'image derrière */
.stat-item { backdrop-filter: none !important; }

/* ===== Slideshow A/B (net) ===== */
.hc { position:absolute; inset:0; z-index:1; overflow:hidden; }
.hc-layer { position:absolute; inset:0; visibility:hidden; }
.hc-layer.is-visible { visibility:visible; }
.hc-layer > img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  image-rendering:auto;   /* rendu natif, pas de pixelisation */
  filter:none !important; /* aucune altération */
  transform: translate3d(0,0,0); /* perf sans effet visuel */
  backface-visibility:hidden;
}

/* Transitions pro et douces (fade + léger slide) */
.hc-layer.prep-in{ opacity:0; }
.hc-layer.prep-out{ opacity:1; }
.hc-layer.go{ transition: transform var(--dur,700ms) cubic-bezier(.22,.61,.36,1), opacity var(--dur,700ms) cubic-bezier(.22,.61,.36,1); }
/* Directions */
.from-left.prep-in  { transform: translate3d(-2.5vw,0,0); }
.from-right.prep-in { transform: translate3d( 2.5vw,0,0); }
.from-top.prep-in   { transform: translate3d(0,-2.5vh,0); }
.from-bottom.prep-in{ transform: translate3d(0, 2.5vh,0); }
.to-left.go  { transform: translate3d(-0.8vw,0,0); opacity:0; }
.to-right.go { transform: translate3d( 0.8vw,0,0); opacity:0; }
.to-top.go   { transform: translate3d(0,-0.8vh,0); opacity:0; }
.to-bottom.go{ transform: translate3d(0, 0.8vh,0); opacity:0; }

/* Option zoom (désactivé par défaut). Si activé, zoom très léger, net. */
@keyframes kb {
  0%   { transform: scale(var(--kb-start,1)) translate(var(--kb-x,0), var(--kb-y,0)); }
  100% { transform: scale(calc(var(--kb-start,1) + var(--kb-delta,0))) translate(var(--kb-x,0), var(--kb-y,0)); }
}


/* --- Supprime toute légende/overlay/credit sur les images du header --- */
.hero-header .header-background .carousel-caption,
.hero-header .header-background figcaption,
.hero-header .header-background .caption,
.hero-header .header-background [class*="caption"],
.hero-header .header-background [class*="legend"],
.hero-header .header-background [class*="credit"],
.hero-header .header-background [data-caption],
.hero-header .header-background [data-credit]{
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Désactive les pseudo-éléments qui utiliseraient content: attr(title) */
#HeroCycler img[title]::before,
#HeroCycler img[title]::after{
  content: none !important;
}

/* Pas d’effet visuel parasite sur l’image : */
#HeroCycler img{
  filter: none !important;
  backdrop-filter: none !important;
  image-rendering: auto !important;
  user-select: none;
  pointer-events: none; /* on ne clique pas l’image, évite tooltips/extensions */
}

/* Le dégradé du header ne doit pas flouter l'image */
.hero-header .overlay-gradient{
  backdrop-filter: none !important;
}

/* IMPORTANT : couper l'ancien fond animé éventuel */
.hero-header .header-background::before{
  content: none !important;
}
