/* ==========================================================================
   1. CONTENEUR PRINCIPAL
   ========================================================================== */

.loading-screen {
  position: fixed;
  inset: 0; /* Raccourci pour top/left/right/bottom: 0 */
  background: #000;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

/* ==========================================================================
   2. ÉLÉMENTS DE FOND (POSTER & VIDÉO) AVEC FONDU ENCHAÎNÉ
   ========================================================================== */

.loading-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.8s ease-in-out;
}

.loading-screen > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

/* Déclenchement du fondu enchaîné */
.loading-screen.loaded .loading-poster {
  opacity: 0;
}
.loading-screen.loaded > video {
  opacity: 1;
}

/* ==========================================================================
   3. CONTENU SUPERPOSÉ (TEXTES, LOGOS, BOUTONS)
   ========================================================================== */

.loading-items {
  position: relative;
  z-index: 3; /* Placé au-dessus du fond */
  width: 100%;
  height: 100%;
  display: flex; /* Utiliser flex pour gérer les items à l'intérieur */
  justify-content: center;
  align-items: center;
  text-align: center;
}

.loading-item {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.5em, 2vw, 2em);
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
}

.loading-item.active {
  opacity: 1;
}

.loading-content {
  width: 70%;
  margin-bottom: 20px;
}

/* Styles spécifiques pour chaque item */
.loading-item#loading-item1 .loading-content {
  text-align: left;
  font-size: clamp(1em, 1.5vw, 1.5em);
  margin-bottom: 2vw;
}

.loading-titre {
  font-size: clamp(2rem, 3vw, 3em);
  font-weight: 400;
  font-family: "Libre Baskerville", serif;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: 0;
}
.loading-soustitre {
  font-size: 1.5em !important;
  font-weight: 400;
  font-family: "Libre Baskerville", serif;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: 0;
}

.def-texte {
  text-indent: 5vw;
}

.loading-item#loading-item3 .loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: clamp(1em, 1.2vw, 1.2 em);
}

.universites {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80%;
  max-width: 400px;
  margin: 20px auto 0 auto;
  gap: 30px;
}

.universites img {
  display: block; /* évite les décalages basés sur la baseline */
  height: clamp(50px, 6vw, 80px);
  max-height: 80px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0; /* réinitialise tout décalage */
}

/* S'assurer que les logos se centrent aussi quand ils passent sur plusieurs lignes */
.universites {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* Sur écrans moyens et larges : forcer côte-à-côte et espacement symétrique */
@media (min-width: 520px) {
  .universites {
    flex-wrap: nowrap; /* rester sur une ligne */
    justify-content: space-evenly; /* espacement symétrique */
    gap: clamp(24px, 4vw, 48px);
    width: 60%;
    max-width: 560px; /* zone centrée où les logos se répartissent */
  }
  .universites img {
    height: clamp(56px, 5vw, 80px);
    max-height: 80px;
  }
}

/* Ajustement spécifique pour le logo UGE (plus petit que DE) */
.universites img[src$="uge_white.svg"] {
  /* Rendre UGE sensiblement plus petit que Dong-Eui */
  height: clamp(28px, 4vw, 48px);
  max-height: 48px;
  width: auto;
  opacity: 0.98; /* léger ajustement visuel possible */
  transform: translateY(0.5px); /* ajuste l'alignement optique si nécessaire */
  display: block;
}

/* ==========================================================================
   4. BOUTON "ENTRER"
   ========================================================================== */

.loading-button {
  width: 100%;
  font-size: clamp(1em, 2vw, 1.5em);
  display: flex;
  justify-content: center;
}

#enter-button {
  background-color: transparent;
  font-family: "Figtree", sans-serif;
  font-size: clamp(0.8em, 1vw, 2em);
  color: white;
  margin-top: 20px;
  padding: clamp(8px, 1.5vw, 12px) clamp(15px, 2.5vw, 25px);
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: color 0.3s ease;
}

#enter-button span {
  position: relative;
  display: inline-block;
}

#enter-button span::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #ddd;
  transition: width 0.5s ease;
  border-radius: 2px;
}

#enter-button:hover,
#enter-button:focus {
  color: #ddd;
}

#enter-button:hover span::after,
#enter-button:focus span::after {
  width: 100%;
}
