/* ✅ Déclaration de la police Segoe UI */
@font-face {
    font-family: 'Cinzel';
    src: url('{% static "fonts/Cinzel-Regular.otf" %}') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Garamond';
    src: url('{% static "fonts/Garamond.ttf" %}') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* ✅ Appliquer la police sur tout le site */
body, html {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    
    background:#000 url("../images/bkg41.png") no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed; /* ✅ Active l'effet de parallaxe */
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    height: 100%;
    padding: 0;
}
body, p, h5 {
    font-family: 'Garamond';
    color: #f9f9f9;
}
h1, h2, h3 {
    font-family: 'Cinzel';
}

/* ✅ Animation d’apparition douce du formulaire apprenant */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADER LOGOS */
#logo-header {
    position: relative; /* ou 'fixed' si tu veux qu'il reste toujours visible */
    top: -80px;
    left: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Permet l'adaptation sur mobile */
    gap: 30px;
    padding: 10px;
    z-index: 100;
    margin-top: 0; /* Supprime les marges trop grandes */
    opacity: 0;
    visibility: hidden;
}
@media (max-width: 768px) {
    #logo-header img {
        width: 25vw; /* Adapte à la taille de l’écran */
        max-width: 200px; /* Taille maximale */
        height: auto;
    }
}
html, body {
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
}


.logos-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

/* Transition sur les images des logos */
.logo-center a img,
.logos-left a img,
.logo-right a img {
    transition: transform 0.3s ease;
}

/* Appliquer l'effet hover sur chacune de ces images */
.logo-center a img:hover,
.logos-left a img:hover,
.logo-right a img:hover {
  transform: scale(1.1);
}

.logo-center a img {
    /* Taille maximale définie en desktop (calculé sur 205px*1.7) */
    max-height: calc(205px * 1.7) !important;
}
.logo-right a img {
    max-height: calc(205px * 1.2) !important;
}
#logo-header img {
    max-height: 205px;
    width: auto;
    display: block;
}
#main-container {
    margin-top: 120px;
    padding: 20px;
    min-height: 400px;
}

/* ✅ Container principal */
.container {
    position: relative;
    opacity: 0;
    visibility: hidden;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 130px 25px;
    box-shadow: 0px 4px 10px 2px rgb(0, 0, 0);
    width: 400px;  /* Largeur fixe desktop */
    border: 1px solid rgb(0, 0, 0);
    margin-top: -250px;
}
.container-livre {
    padding: 10px;
    border-radius: 10px;
    max-width: 185px;
    max-height: 97px;
    /* overflow: hidden;  ❌ On enlève cette ligne */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -7px auto;
    width: 81px;
    transition: transform 0.3s ease;
    position: relative; /* ✅ Pour que l'image puisse se positionner relativement */
    z-index: 1;
}

.container-livre img {
    max-width: 102%;
    max-height: 119px;
    height: auto;
    width: auto;
    display: block;
    transition: transform 0.3s ease-in-out;
    z-index: 2;
    position: relative;
}

/* ✅ Effet zoom au survol avec débordement visible */
.container-livre:hover img {
    transform: scale(2);
}
.catalogue-link {
  display: inline-block;
  padding: 10px 20px;
  background-color: #d4a65bba;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: normal;
  transition: background-color 0.3s ease, transform 0.2s ease;
  position: relative;
  top: -30px;
}

.catalogue-link:hover {
  background-color: #e6bb79;
  transform: scale(1.02);
}



/* Apparition du container et header */
#logo-header.fade-in,
.container.fade-in,
.site-footer.fade-in {
    visibility: visible;
    animation: fadeInUp 1.5s ease-out forwards;
}

.title-container {
    position: relative;
    display: inline-block;
    top: -76px;
}
.custom-title {
    margin-top: -25px;
    margin-bottom: 0px;
    padding: 0;
}
.subtitle {
    position: absolute;
    bottom: -0.5;
    right: 0;
    margin: 0;
    font-size: 1em;
}

/* ✅ Styles textes et couleurs */
.phar {
    color: #d4a65b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: normal;
}
.ecbs {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.el {
    color: #d4a65b;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.con {
    margin-top: 0;
}
.colored {
    color: #d4a65b;
    font-weight: bold;
    font-size: 0.45em;
}
.size {
    font-size: 0.45em;
}
.phrase {
    position: relative;
    top: -63px;
    margin-bottom: -25px;
}

/* ✅ Formulaire apprenant */
.form-apprenant {
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}
.form-apprenant input {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #d4a65b63;
    border-radius: 5px;
    background-color: #000 !important;
    color: white;
}
.form-apprenant button {
    width: 97%;
    background-color: #d4a65bba;
    color: white;
    border: none;
    padding: 9px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
    border: 2px solid rgb(0, 0, 0);
}
.form-apprenant button:hover {
    background-color: #b37a00;
}
.btn-formateur {
    margin-top: 10px;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    text-decoration: underline;
}
.btn-formateur:hover {
    color: #ffffff59;
}

/* ✅ Pop-up de connexion formateur */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s;
}
.popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 400px;  /* Même largeur que le formulaire apprenant */
    position: relative;
    transform: translateY(0px);
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}
.popup-content h2 {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}
.popup-content input {
    width: calc(100% - 20px);
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    background: #f9f9f9;
    transition: border 0.3s;
}
.popup-content input:focus {
    border-color: #007bff;
    outline: none;
}
.popup-content button {
    width: 100%;
    background-color: #ffbb00;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
}
.popup-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
}
.popup-overlay.active .popup-content {
    opacity: 1;
    transform: translateY(0);
}
.popup-content button:hover {
    background-color: #b37a00;
}
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    font-weight: bold;
}
.close-btn:hover {
    color: #ff0000;
}

/* ✅ Footer */
.site-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    margin-top: -110px;
    margin-bottom: 96px;
}
.site-footer p {
    margin-bottom: 10px;
}
.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
}
.download-btn {
    width: 100px;
    height: 35px;
    border: none;
    background: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.3s;
}
.download-btn:hover {
    transform: scale(1.05);
}
.windows-btn {
    background-image: url("../images/wd.png");
}
.android-btn {
    background-image: url("../images/gp.png");
}
.mac-btn {
    background-image: url("../images/as.png");
}


/* =============================================================================
   STYLES PAGE DE CONNEXION ADMINISTRATION
   ============================================================================= */
.admin-login-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background: url("../images/bkg4.svg") no-repeat top left fixed;
    background-size: cover;
}
.login-wrapper {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.admin-login-form {
    display: flex;
    flex-direction: row;
    gap: 2px;
    align-items: center;
    justify-content: center;
}
.admin-login-form input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 5px;
}
.admin-login-form button {
    background-color: #ffbb00;
    color: #fff;
    border: none;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}
.admin-login-form button:hover {
    background-color: #b37a00;
}

/* =============================================================================
   APPROCHE DE SCALING POUR MOBILE
   =============================================================================
   Pour conserver intégralement la vue desktop sans forcer le wrapping, on applique
   un transform: scale() sur les éléments majeurs quand la largeur d’écran est trop faible.
   Le facteur de scale est calculé en fonction de la dimension de base.
   Ici, la .container et la pop-up (400px) ainsi que le loader-logo (700px) seront redimensionnés.
============================================================================= */

/* Modifier la largeur des images à l'intérieur de #logo-header */
@media (max-width: 480px) {
    #logo-header img {
      width: 100%;      /* L'image occupe 90% de la largeur du conteneur */
      height: auto;    /* Garde les proportions */
      display: block;  /* Pour bien centrer via margin auto si besoin */
      margin: 0 auto;
    }
  
    
    #loader-logo {
        transform: scale(var(--scale-loader-logo));
        transform-origin: center;
    }
    
}

/* Pour les tablettes (< 768px), si vous souhaitez appliquer un scale léger */
@media (max-width: 768px) {
    .container,
    .popup-content {
        transform: scale(calc((100vw - 40px) / 400));
        transform-origin: top center;
    }
    #logo-header {
        transform: scale(calc((100vw - 40px) / 1366));
        transform-origin: top center;
        margin-top: 50px;
        gap:0px;
    }

    .container {
        margin-top: 70px; /* Réduit le décalage vertical */
        padding: 20px;
        width:84%;
      }

      .form-apprenant input {
        width: 95%;
      }
      .form-apprenant button {
        width: 97%;
    }
      
}

@media (max-width: 768px) {
    body, html {
      justify-content: flex-start; /* Commence l'affichage en haut */
    }
  }
    


@media (max-width: 768px) {
  html, body {
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
  }


 @media (max-width: 768px) {
  /* Masquer les autres logos */
  .logos-left,
  .logo-right {
    display: none !important;
  }

  /* Position absolue du logo central */
  .logo-center {
    position: absolute;
    top: 65px; /* ✅ Ajuste ici la hauteur verticale exacte */
    left: 45%;
    transform: translateX(-50%);
    z-index: 10;
  }

  .logo-center a img {
    max-height: 150px;
    height: auto;
    width: auto;
  }

  /* Supprimer tout comportement par défaut du conteneur logos */
  #logo-header {
    position: relative;
    height: 0;
    padding: 0;
    margin: 0;
  }
}


  .container {
    width: 76%;
    padding: 20px 15px;
    margin-top: 85px;
    min-height: auto;
  }

  .form-apprenant input,
  .form-apprenant button {
    width: 90%;
  }

  .container-livre img {
    max-width: 100%;
    max-height: 80px;
  }

  .title-container {
    top: -60px;
            margin-top: 85px;
  }

  .phrase {
    top: -50px;
    font-size: 0.9em;
    margin-bottom: -70px;
  }

  .site-footer {
    margin-top: -70px;
    margin-bottom: 15px;
    font-size: 0.75em;
  }

  .footer-buttons {
    flex-direction: row;
    gap: 5px;
  }

  .download-btn {
    width: 80px;
    height: 30px;
  }
    .catalogue-link{
    display: inline-block;
    padding: 10px 20px;
    background-color: #d4a65b;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: normal;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
    top: -60px;
    font-size: 10px;
}
}

.btn-formateur{
    margin-top: -15px;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 70px;
}

/* =============================================================================
   FIN DES MODIFICATIONS POUR RESPONSIVITÉ
============================================================================= */
