/* Style de la page index cours */
#centerBlock{
  display: grid; /* On active les grilles */
  justify-items: center; /* Centre horizontalement */
  align-items: center; /* Centre verticalement */
  height: auto;
}

form.niveau-container {
  display: flex;
  gap: 20px;
  padding: 20px;
  justify-content: center;
}

.niveau-box {
  width: 350px;
  height: 180px;
  border: none;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  font-family: sans-serif;
  cursor: pointer;
  transition: 0.3s ease;
  padding: 0;
  border: 1px solid white;
}

/* au survol */
.niveau-box:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

.niveau-box:hover .sous-titre{
    font-weight: 900;
    border-top: 2px solid white;
}

.niveau-box:hover .titre{
    font-weight: 900;
}

/* au actif */

.niveau-box.active {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border: 2px solid #2471a3;
}

.niveau-box.active .sous-titre, .niveau-box.active .titre{
    color: #2471a3;
    font-weight: 900;
}

.niveau-box.active .sous-titre{
    border-top: 2px solid #2471a3;
}


.niveau-box .titre {
  flex: 2;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.niveau-box .sous-titre {
  flex: 1;
  background-color: black;
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Couleurs */
.l1 .titre { background-color: #131313; }
.l2 .titre { background-color: #131313; }
.l3 .titre { background-color: #131313; }


.gridCurse{
  display: grid;
  grid-template-columns: 1fr 1fr ;
  margin: 5px;
  gap: 1rem;
}

@media (max-width: 850px) {
    .gridCurse{
      grid-template-columns: 1fr ;
    }
}

.curse {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.curse:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nomUE {
    margin-top: -5px;
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 15px;
    text-align: center;
    color: white;
}

.tuteur {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.initiales {
    background-color: #2471a3;
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 5px;
}

.contribueur {
    font-size: 20px;
    color: white;
    font-weight: 600;
    margin-right: 15px;
}

.resume {
    font-size: 13px;
    color: rgb(100, 100, 100);
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;       /* Limite à 2 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
 

/* Style commun pour les boutons */
.btn-ressources {
  display: inline-block;
  padding: 10px 20px;
  background-color: #2471a3;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  text-decoration: none; /* important pour <a> */
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

/* Hover pour boutons et liens */
.btn-ressources:hover {
  background-color: #1a5276;
  color: #fff;
}

/* Style pour boutons désactivés (optionnel) */
.btn-ressources:disabled,
.btn-ressources[disabled] {
  background-color: #999;
  cursor: not-allowed;
  color: #eee;
}

/* Pour liens (a) uniquement - évite que sous-ligne apparaisse */
.btn-ressources[href] {
  /* déjà géré par text-decoration:none */
}

/* Pour boutons <button> (au cas où) */
.btn-ressources[type="button"],
.btn-ressources[type="submit"] {
  border: none;
  outline: none;
}


/*ADMIN*/
/* Formulaire d'ajout (admin) */
#admin-form {
  margin: 1rem auto;
  max-width: 600px;
  background: black;
  color: white;
  padding: 1.5rem;
  flex: 1;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
#admin-form input,
#admin-form textarea {
  background: rgb(20, 20, 20);
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  color: white;
  font-size: 1rem;
}
#admin-form h3 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: #1e88e5;
}

/* Bouton d'ajout visible uniquement pour admin */
#toggle-form {
  width: 90%;
  display: block;
  margin: 15px auto;
  padding: 20px;
  color: white;
  border: dashed 2px white;
  font-size: 25px;
  background-color: transparent;
}

/*Previs et form*/
.form-previs-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#preview-bloc {
  flex: 1;
  padding: 1rem;
  background:  rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}


/* Styles pour les pages de cours */
#cours-detail {
  max-width: 90%;
  margin: 0px auto;
  padding: 30px;
  border-radius: 10px;
}

#cours-detail .nomUE {
  font-size: 2.2em;
  margin-bottom: 20px;
  color: white;
  border-bottom: 2px solid rgb(100, 100, 100);
  padding-bottom: 10px;
}

#cours-detail .tuteur {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

#cours-detail .initiales {
  background: #2471a3;
  color: white;
  font-weight: bold;
  font-size: 1.1em;
  padding: 10px 15px;
  border-radius: 50px;
  text-transform: uppercase;
}

#cours-detail .contribueur {
  font-size: 1.1em;
  color: white;
}

#cours-detail .resume {
  font-size: 1.15em;
  line-height: 1.6;
  color: rgb(200,200,200);
  margin-top: 15px;
  white-space: pre-line;
}

/* NOUVEAU */

#bloc-control {
  margin-top: 20px;
  padding: 10px;
  border: 1px dashed #aaa;
  background-color: #f9f9f9;
}

#bloc-control select, #bloc-control button {
  margin: 5px 0;
}

.bloc {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #ccc;
  background-color: #fff;
}

.bloc h3 {
  margin-top: 0;
}
