* {
  margin: 0;
  padding: 0;
  transition: color 0.1s, background-color 0.5s;
  text-decoration: inherit;
  box-sizing: border-box;
}

body {
  --primary-color: #4fc6ce;
  --accent-01: #1d3a41;
  --accent-02: #225b60;
  --accent-03: #ffffff;
  --accent-04: #d5f3f9;

  font-family: Calibri, sanse-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  justify-content: center;
  text-align: center;
  background-color: var(--accent-04);
  color: var(--accent-01);
}

body.light {
  --primary-color: #4fc6ce;
  --accent-01: #dbdbdb;
  --accent-02: #98b1ba;
  --accent-03: #26333a;
  --accent-04: #1a2328;
}

.container {
  display: grid;
  column-gap: 40px;
  row-gap: 5px;
  max-width: 1300px;
  padding: 50px;
  margin: 0 auto;
}

.box {
  background-color: var(--accent-03);
  border-radius: 25px;
}

/*------------ navbar ----------- */

.navbar {
  display: grid;
  gap: 5px;
  text-align: center;
  grid-template-columns: max-content;
  grid-auto-rows: max-content;
  position: sticky;
  top: 50px;
  z-index: 5;
  cursor: pointer;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent-02);
}
.navbar > div {
  padding: 25px 10px;
}

.navbar ion-icon {
  font-size: 32px;
  margin: auto;
}

.navbar.active,
.navbar .item:hover {
  color: var(--primary-color);
}

.navbar a {
  color: var(--accent-02);
}

.navbar a:hover {
  color: var(--primary-color);
}

.divider {
  height: 2px;
  width: 100%;
  margin: 15px 0;
  padding: auto;
}

.ltr {
  background: radial-gradient(
    ellipse at left,
    var(--accent-02) -70%,
    transparent 80%
  );
}

.rtl {
  background: radial-gradient(
    ellipse at right,
    var(--accent-02) -70%,
    transparent 80%
  );
}

/*-------------- profil -----------*/

.profile {
  text-align: center;
  font-size: 20px;
}

.profile .header {
  max-height: 40vh;
  width: 100%;
  border-radius: 25px 25px 0 0;
  clip-path: polygon(100% 0, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 0);
}

.profile .img {
  width: 140px;
  position: relative;
  margin: -60px auto 0;
  border: var(--accent-04) 8px solid;
  border-radius: 35px;
}

.profile p {
  margin-top: 10px;
  height: 20px;
}
.profile ul {
  list-style-type: none;
  margin: 30px 0 80px 0;
}

.profile ul li {
  display: inline;
}

.profile .footer {
  position: sticky;
  top: calc(100vh - 100px);
}

.profile table {
  width: 100%;
  padding-bottom: 15px;
}

.profile ion-icon {
  color: var(--accent-02);
  transition: color 0.5s, border-color 0.5s, background-color 0.5s;
  margin-bottom: -7px;
}

.profile ul ion-icon {
  padding: 10 px;
  border-radius: 10px;
  background-color: var(--accent-04);
}

.profile ul ion-icon:hover {
  background-color: var(--accent-03);
}

.profile ion-icon:hover {
  background-color: var(--primary-color);
}

.profile table ion-icon {
  padding: 5px;
  border-radius: 10px;
  transition: color 0.5s, background-color 0.5s;
}

.profile td:hover ion-icon {
  background-color: var(--primary-color);
  color: var(--accent-04);
}

/********************* contenu *****************/
.content {
  padding: 20px 15px 20px 20px;
}
.content p {
  line-height: 1.5;
  font-size: 18px;
}

.colored {
  color: var(--primary-color);
}

.content h2 {
  font-size: 2em;
}

.content .wrapper {
  overflow: auto;
  max-height: 700px;
  padding-right: 10px;
  scroll-behavior: smooth;
}

.content ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.content ::-webkit-scrollbar-track {
  background: var(--accent-04);
}

.content ::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

.text {
  margin: 5px;
  padding: 15px;
}

.text p {
  color: var(--accent-02);
}

/******************** réalisations ********************/

section {
  margin: 10px;
}

.realisations {
  display: grid;
  justify-content: center;
  grid-template-columns: 1fr 1fr 1fr;
  background-color: var(--accent-04);
  padding: 20px 30px;
  gap: 10px;
  border-radius: 10px;
}

.realisations h3 {
  font-size: 2.3em;
}

.realisations ion-icon {
  margin-bottom: -5px;
  color: var(--primary-color);
  font-size: 0.9em;
}

.realisations p {
  color: var(--accent-02);
  line-height: 1.2;
  font: 15px;
}

/***************** Comptétences ********************/

.competences {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  color: var(--accent-02);
  max-height: 0;
  transition: max-height 0.5s ease-out, opacity 0.5s ease;
  overflow: hidden;
}

.competences > div {
  position: relative;
  background-color: var(--accent-04);
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  border: var(--accent-04) 3px solid;
  transform: border-color 0.5s;
  cursor: pointer;
}

.competences img {
  color: var(--primary-color);
}

.competences > div:hover {
  border-color: var(--primary-color);
}

.competences ion-icon {
  color: var(--primary-color);
  font-size: 32px;
}

.competences1 {
  display: block;

  gap: 10px;
  color: var(--accent-02);
  max-height: 0;
  transition: max-height 0.5s ease-out, opacity 0.5s ease;
  overflow: hidden;
}

.competences1 > div {
  position: relative;
  background-color: var(--accent-04);
  text-align: center;
  padding: 20px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: var(--accent-04) 3px solid;
  transform: border-color 0.5s;
  cursor: pointer;
}

.competences1 img {
  color: var(--primary-color);
}

.competences1 > div:hover {
  border-color: var(--primary-color);
}

.competences.show {
  /* Ajustez cette valeur en fonction de votre contenu */
  max-height: fit-content;
  opacity: 1;
}

.competences1.show {
  /* Ajustez cette valeur en fonction de votre contenu */
  max-height: fit-content;
  opacity: 1;
}

.toggleCompetences {
  display: flex;
  align-items: center; /* Assure l'alignement vertical */
  background-color: var(--accent-04);
  cursor: pointer;
  padding: 20px;
  border-radius: 10px;
  border: var(--accent-04) 3px solid;
  transition: border-color 1s; /* Ajoute une transition pour un effet fluide */
}

.toggleCompetences:hover {
  border-color: var(
    --primary-color,
    #007bff
  ); /* Utilisez une couleur de repli */
}

.toggleCompetences ion-icon {
  color: var(--primary-color);
  font-size: 32px;
  margin-right: 10px; /* Ajoute une marge à droite de l'icône */
}
.toggleCompetences h3 {
  margin: 0; /* Supprime les marges par défaut de h3 */
}

.image {
  background-color: var(--accent-04);
  color: var(--accent-04);
}
.competences .circle {
  position: relative;
  width: 60px;
  height: 60px;
  margin: auto;
  background: conic-gradient(
    from 0deg,
    var(--primary-color) 0%,
    var(--primary-color) 0% var(--percent),
    var(--accent-03) 0% var(--percent)
  );
  border-radius: 50px;
  margin-bottom: 5px;
}

.competences .circle:before {
  content: "";
  position: absolute;
  inset: 8px;
  background-color: var(--accent-04);
  border-radius: 50%;
}

.competences .circle h4 {
  position: relative;
  text-align: center;
  font-size: 1.2em;
  line-height: 3;
}

.competences .progress-bar:nth-child(1) {
  margin-bottom: 10px;
}

.competences .progress-bar p {
  display: flex;
  justify-content: space-between;
}

.competences progress {
  width: 100%;
  appearance: none;
  height: 10px;
}

.competences progress::-webkit-progress-bar {
  border-radius: 10px;
  background-color: var(--accent-04);
}

.competences progress::-webkit-progress-value {
  border-radius: 10px;
}

/**************** Expériences **********************/

.experiences {
  margin: 15px 0;
}

.experiences p {
  padding-left: 20px;
  border-left: var(--accent-02) 2px solid;
  margin-left: 17px;
  color: var(--accent-02);
}

.experiences a {
  color: var(--accent-01);
}

.experiences a:hover {
  color: var(--primary-color);
  opacity: 0.65;
}

.experiences a:hover img {
  opacity: 0.5;
}

.experiences h4::before {
  content: "";
  position: absolute;
  background-color: var(--primary-color);
  width: 14px;
  height: 14px;
  border-radius: 20px;
  left: 0;
  top: 5px;
}

.experiences .date {
  padding: 5px 10px;
  background-color: var(--accent-04);
  border-radius: 4px;
  color: var();
  margin-top: 20px;
  font-size: 14px;
  font-weight: 400;
}

/******************** Projets  *****************************/

.projets {
  display: grid;
  gap: 10px;
}

#Gestion_Contact {
  grid-area: p1;
}
#projet2 {
  grid-area: p2;
}
#projet3 {
  grid-area: p3;
}
#projet4 {
  grid-area: p4;
}

.projets div img {
  object-fit: cover;
  height: 100%;
  width: 100%;
  transition: 0.5s;
}

.projets div video {
  object-fit: cover;
  height: 100%;
  width: 100%;
  transition: 0.5s;
}

.projets div {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.projets div:hover img {
  filter: brightness(0.5);
}

.projets div:hover video {
  filter: brightness(0.5);
}

.projets h3 {
  position: absolute;
  inset: 0;
  width: fit-content;
  height: fit-content;
  margin: auto;
  opacity: 0;
  transition: opacity 0.5s;
}

.projets div:hover h3 {
  opacity: 1;
}

body.light .projets h3 {
  color: var(--accent-04);
}

/* Ajout de CSS directement dans le fichier HTML pour la démonstration */
.project-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--accent-03);
  padding: 20px 15px 20px 20px;

  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 80%;
  max-width: 500px;
  overflow: auto;
  max-height: 500px;

  scroll-behavior: smooth;
}
.project-modal p,
.project-modal h2 {
  color: var(--accent-02);
}
.project-modal.show {
  display: block;
}

.project-modal::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  padding: auto;
}

.project-modal::-webkit-scrollbar-track {
  background: var(--accent-04);
}

.project-modal::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

.close-btn {
  position: sticky;
  top: 10px; /* Reste en haut par rapport au conteneur lors du défilement */
  left: 10px;
  color: var(--accent-02);
  background-color: var(--accent-03);
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 1001; /* Assurez-vous que le bouton reste au-dessus du contenu */
  transform: translate(-50%, -50%);
  margin-top: -30px; /* Ajustez ce margin pour positionner correctement */
  margin-left: -10px;
}

.download-section {
  margin: 20px;
  padding: 20px;
  border: 1px solid #ccc;
  background-color: var(--accent-03);
  text-align: center;
}

.download-section h2,
.download-section p {
  color: var(--accent-02);
}
.download-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}
.download-link:hover {
  background-color: #0056b3;
}

/******************** responsiveness  *******************/

/* Ordinateur */

@media screen and (width >= 1024px) {
  .container {
    grid-template-columns: 85px 430px 1fr;
  }

  /*
  .competences div:nth-child(7) {
    grid-column: 3 / span 2;
  }

  */
  .projets {
    grid-template-areas:
      "p1 p2 p3"
      "p4 p4 p4";
  }
}

/* tablette */
@media screen and (width >= 768px) and (width <= 1024px) {
  .container {
    grid-template-columns: 85px 1fr;
    max-width: 650px;
  }
  .content {
    grid-column-start: 2;
    grid-column-end: 4;
  }
  .realisations {
    grid-template-columns: 1fr 1fr;
  }
  .competences {
    grid-template-columns: 1fr 1fr 1fr;
  }

  /*
  .competences div:nth-child(7) {
    grid-column: 1/4;
  }

  */
  .projets {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "p1 p2"
      "p3 p4";
  }
}

/* telephone */
@media screen and (orientation: portrait) and (width <= 769px) {
  .container {
    grid-template-columns: 1fr;
    max-width: 500px;
    padding: 20px;
    padding-top: 50px;
    margin-right: 10px;
  }
  .navbar {
    display: inline-grid;
    position: fixed;
    grid-template-columns: 1fr;
    width: 5%;
    opacity: 0.65;
  }
  .nav {
    display: grid;
    flex-direction: column;
    grid-template-columns: 1fr;
    padding: 5px;
    border: var(--primary-color) 3px solid;
  }

  .theme {
    border: var(--primary-color) 3px solid;
  }

  nav p {
    display: none;
  }
  .navbar {
    box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
      rgba(0, 0, 0, 0.06) Opx 0px 0px 1px;
  }
  .realisations {
    grid-template-columns: 1fr 1fr;
    text-align: center;
  }
  .competences {
    grid-template-columns: 1fr 1fr;
  }
  ion-icon.toggleIcon {
    font-size: 40px;
  }

  /*
  .competences div:nth-child(7) {
    grid-column: 1/3;
  }
    */
  .projets {
    grid-template-columns: repeat(1, 1fr);
    grid-template-areas:
      "p1"
      "p2"
      "p3"
      "p4";
  }
}
