/* Style global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh; /* IMPORTANT : Force le site à faire toute la hauteur de l'écran */
  font-family: "Outfit", sans-serif;
  font-weight: 400;
  font-style: normal;
  background-color: #000000;
  overflow: hidden;
  
  /* Flexbox pour empiler : Header en haut, Vidéo en dessous */
  display: flex;
  flex-direction: column; 
}

.background-container {
  position: relative; /* Plus de fixed */
  flex-grow: 1;       /* PREND TOUT L'ESPACE RESTANT */
  width: 100%;
  overflow: hidden;
  z-index: 0;
}

.background-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 'contain' pour voir toute la vidéo, ou 'cover' pour remplir sans bandes noires */
  transform: none; 
}

.header {
  position: relative; /* Était fixed. Permet au header de pousser le contenu vers le bas */
  width: 100%;
  background: rgba(0, 0, 0); 
  color: #c9e1b7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px 10px 15px;
  z-index: 100;
  border-bottom: 1px solid #83bb5c;
  flex-shrink: 0; /* Empêche le header de s'écraser si l'écran est petit */
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-content: space-between; 
  width: 100%; 
}

.header h1 {
  margin: 0;
  flex-grow: 1;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

.subtitle {
  margin-top: 8px;
  font-size: 20px;
  text-align: center;
  font-weight: normal;
  color: #c9e1b7;
}

.logo {
  width: auto;
  height: 50px;
}

.main-content {
  position: absolute;
  top: 50%;
  left: 30px;
  transform: translateY(-50%);
  z-index: 1;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.button-group a {
  background-color: rgba(255, 255, 255, 0.5);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 3rem;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-block;
  text-align: center;
}

.button-group a:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Version Mobile */
@media (max-width: 768px) {

  /* 1. On force le conteneur à être un flex-center pour la vidéo */
  .background-container {
    display: flex;
    align-items: center;     /* Centre verticalement la vidéo */
    justify-content: center;  /* Centre horizontalement la vidéo */
    height: 100%;
    position: relative;
    z-index: 0;
  }

  /* 2. Ajustement de la vidéo pour le centrage */
  .background-container video {
    position: relative;       /* Sort du flux absolute pour obéir au flex du parent */
    top: auto;
    left: auto;
    transform: none;
    width: 100vw;
    height: auto;
    max-height: 100%;         /* Empêche la vidéo de déborder verticalement */
    object-fit: contain;      /* 'contain' pour voir toute la vidéo centrée */
	margin-top: -30px;
  }

  /* 3. Interface et boutons */
  .main-content {
    position: fixed;
    top: auto;
    bottom: 20px;             /* Boutons collés en bas */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;              /* S'assure de passer par dessus la vidéo */
  }

  .button-group {
    flex-direction: row;      /* Boutons côte à côte sur mobile */
    gap: 10px;
  }

  .button-group a {
    font-size: 1.2rem;
    padding: 8px 15px;
  }

  /* 4. Réduction des textes du header */
  .header h1 {
    font-size: 14px;
  }
  
  .logo {
    height: 40px;
  }
  
  .subtitle {
    font-size: 12px;
    margin-top: 4px;
  }
}

/* --- Styles pour l'écran de chargement (inchangés mais inclus) --- */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.8s ease-out;
}

#loading-logo {
  width: 200px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease-out;
  transform-origin: top left;
}

body.loading #loading-screen {
  opacity: 1;
}

body:not(.loading) #loading-screen {
  opacity: 0;
  pointer-events: none;
}

body:not(.loading) #loading-logo {
  width: 70px;
  top: 0;
  left: 0;
  transform: translate(0, 0);
}
