@import url("https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap");

:root {
   --main-bg-color: #f0f6ed;
   --main-h1-color: #0e433a;
   --main-h2-color: #648976;
   --main-p-color: #09391c;
   --main-section-color: #b0d8c56d;
}

html,
body {
   height: 100%;
   margin: 0;
   padding: 0;
}

body {
   display: flex;
   flex-direction: column;
   background-color: var(--main-bg-color);
   color: var(--main-p-color);
   font-family: "Titillium Web", sans-serif;
   max-width: 1440px;
   margin: auto;
}

header {
   padding: 0 20px;
   text-align: center;
}

header h2 {
   font-size: 1.6em;
   margin-top: 0;
}

header p {
   margin-bottom: 50px;
}

main {
   flex: 1;
   margin-left: 310px;
   padding: 20px;
}

h1,
h2,
h3 {
   margin-bottom: 10px;
}

h1 {
   font-size: 2.3em;
   color: var(--main-h1-color);
   margin: 0;
}

h2 {
   font-size: 2em;
   color: var(--main-h2-color);
   text-align: center;
}

h3 {
   font-size: 1.5em;
   color: var(--main-h2-color);
}

p {
   font-size: 1.4em;
}

.container {
   display: flex;
   flex: 1;
}

nav {
   position: fixed;
   top: 120px;
   left: 20px;
   width: 250px;
   padding: 20px;
   border-right: 4px solid var(--main-h2-color);
   background-color: var(--main-bg-color); /* Fond pour le menu */
   height: calc(100% - 40px); /* Prend toute la hauteur de l'écran avec une marge */
}

nav a {
   display: block;
   color: var(--main-h2-color);
   font-weight: 500;
   margin: 10px 0;
   text-decoration: none;
   font-size: 1.9em;
   cursor: pointer;
   transition: color 0.3s;
}

nav a:hover,
nav a.active {
   color: var(--main-h1-color);
}

nav a.active {
   font-size: 2.2em;
   padding-left: 10px;
}

.section {
   display: none;
   margin-bottom: 20px;
   padding: 20px;
   background: var(--main-bg-color);
   width: 80%;
   border: 0px solid var(--main-h2-color);
   position: relative;
   transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.section.active {
   display: flex;
   flex-direction: column;
}

#accueil img {
   min-width: 200px;
   max-width: 500px;
   margin: auto;
}

#competences p {
   margin-bottom: 5px;
}

.projects-container {
   display: flex;
   flex-wrap: wrap;
   justify-content: space-around;
}

.project {
   background: var(--main-section-color);
   margin: 20px;
   padding: 10px;
   width: 350px;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
   cursor: pointer;
   transition: transform 0.2s;
}

.project:hover {
   transform: scale(1.05);
}

.project img {
   max-width: 100%;
   border-radius: 3px;
   box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.project h3 {
   margin-top: 10px;
   color: var(--main-h1-color);
}

.project .technologies {
   margin-top: 10px;
   list-style: none;
   padding: 0;
}

.project .technologies li {
   display: inline-flex;
   background: var(--main-bg-color);
   color: var(--main-h1-color);
   padding: 2px 10px;
   border-radius: 3px;
   margin: 5px 5px 0 0;
   box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Modale */
.modal {
   display: none;
   position: fixed;
   z-index: 3;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   overflow: auto;
   background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
   background-color: var(--main-bg-color);
   margin: 7% auto;
   padding: 20px;
   border: 1px solid #888;
   width: 100%;
   max-width: 700px;
   box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
   border-radius: 5px;
   position: relative;
}

.close-button {
   background: none;
   border: none;
   cursor: pointer;
   color: inherit;
   right: 2%;
   position: absolute;
   top: 2%;
   width: 45px;
}

.modal-carousel {
   display: flex;
   align-items: center;
   justify-content: center;
   position: relative;
   height: 600px;
   padding: 0 50px;
}

.carousel-button {
   background: none;
   border: none;
   cursor: pointer;
   color: inherit;
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   z-index: 2;
   width: 45px;
}

#prev-image {
   left: 0px;
}

#next-image {
   right: 0px;
}

#modal-images img {
   max-width: 100%;
   max-height: 600px;
   border-radius: 5px;
}

button {
   padding: 10px;
   font-size: 1.2em;
   background-color: var(--main-h2-color);
   color: white;
   border: none;
   border-radius: 5px;
   cursor: pointer;
   transition: background-color 0.3s;
}

.contact-links {
   display: flex;
   justify-content: center;
   align-items: center;
   gap: 50px;
   margin-top: 20px;
}

.contact-links a {
   display: flex;
   align-items: center;
}

.contact-links img {
   width: 40px;
   height: 40px;
   transition: transform 0.2s;
}

.contact-links img:hover {
   transform: scale(1.2);
}

/* Styles pour le menu hamburger */
.hamburger {
   display: none;
   flex-direction: column;
   cursor: pointer;
   margin-left: auto;
   z-index: 2;
}

.hamburger span {
   height: 3px;
   width: 25px;
   background: var(--main-h1-color);
   margin: 2px 0;
   transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
   transform: rotate(-45deg) translate(-5px, 5px);
}

.hamburger.active span:nth-child(2) {
   opacity: 0;
}

.hamburger.active span:nth-child(3) {
   transform: rotate(45deg) translate(-5px, -5px);
}

footer {
   background-color: var(--main-bg-color);
   color: var(--main-p-color);
   text-align: center;
   margin: 0 20px;
   z-index: 10;
}

footer p {
   border-top: 2px solid var(--main-h2-color);
   padding-top: 10px;
   margin: 0;
   font-size: 1em;
}

footer a {
   display: block;
   margin-top: 10px;
}

footer img {
   margin: 0 20px 10px 20px;
   max-width: 400px;
   height: auto;
}

@media (max-width: 1024px) {
   .container {
      flex-direction: column;
   }

   .header-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      background-color: var(--main-bg-color);
      padding: 10px;
      position: fixed;
      top: 0;
      left: 0;
      z-index: 10;
   }

   main {
      padding: 0 20px;
      margin-left: inherit;
   }

   nav {
      display: none;
      flex-direction: column;
      width: 100%;
      padding: 0;
      text-align: center;
      position: fixed;
      top: 60px;
      right: 0;
      background-color: var(--main-bg-color);
      z-index: 10;
      border-right: 0px solid var(--main-h2-color);
   }

   nav a {
      margin: 0;
   }

   nav a.active {
      padding-left: inherit;
   }

   .hamburger {
      position: relative;
   }

   .modal-content {
      margin: 10% auto;
   }

   h1 {
      font-size: 2em;
   }

   h2 {
      font-size: 1.7em;
   }

   h3 {
      font-size: 1em;
   }

   p {
      font-size: 1em;
   }
   nav a {
      font-size: 1.5em;
   }

   nav a.active {
      font-size: 1.5em;
   }

   nav a {
      padding: 5px 0;
      border-bottom: 1px solid var(--main-h2-color);
   }

   .hamburger {
      display: flex;
      padding-right: 20px;
   }

   nav.active {
      display: flex;
   }

   .section {
      width: inherit;
      padding: 0;
   }

   .modal-carousel {
      height: 400px;
   }

   #modal-images img {
      max-height: 400px;
   }
}

@media (max-width: 767px) {
   .modal-content {
      width: 80%;
   }

   .modal-carousel {
      padding: 0;
      max-height: 40vh;
   }

   #modal-images img {
      max-height: 40vh;
      border-radius: 5px;
   }

   .modal-content {
      margin: 20% auto;
   }
}

/* Animation pour l'ouverture de la modale */
@keyframes modalFadeIn {
   from {
      opacity: 0;
      transform: translateY(-20px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

/* Animation pour la fermeture de la modale */
@keyframes modalFadeOut {
   from {
      opacity: 1;
      transform: translateY(0);
   }
   to {
      opacity: 0;
      transform: translateY(-20px);
   }
}

.modal.show .modal-content {
   animation: modalFadeIn 0.3s forwards;
}

.modal.hide .modal-content {
   animation: modalFadeOut 0.3s forwards;
}

.modal.hide {
   display: block;
   pointer-events: none;
}

/* Animation pour le déplacement latéral */
@keyframes slideInLeft {
   from {
      opacity: 0;
      transform: translateX(-20%);
   }
   to {
      opacity: 1;
      transform: translateX(0);
   }
}

.section h2 {
   opacity: 0;
   transform: translateX(-100%);
   transition: opacity 0.4s ease, transform 0.4s ease;
}

.section.active h2 {
   animation: slideInLeft 0.4s forwards;
}

/* Animation pour le Welcome */
@keyframes popping {
   0% {
      opacity: 0;
      transform: scale(0.5);
   }
   50% {
      opacity: 0.5;
      transform: scale(1.1);
   }
   100% {
      opacity: 1;
      transform: scale(1);
   }
}

#accueil img {
   animation: popping 1s ease-out forwards;
}

/* Animation pour le changement de sections */
@keyframes fadeInDown {
   from {
      opacity: 0;
      transform: translateY(-20px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes fadeOutUp {
   from {
      opacity: 1;
      transform: translateY(0);
   }
   to {
      opacity: 0;
      transform: translateY(-20px);
   }
}

.section.active {
   animation: fadeInDown 0.3s ease-in-out;
}

.section.exiting {
   animation: fadeOutUp 0.3s ease-in-out;
   display: block;
}

/* Animation pour le changement d'images du carrousel */

@keyframes slideInFromRight {
   from {
      opacity: 0;
      transform: translateX(10%);
   }
   to {
      opacity: 1;
      transform: translateX(0);
   }
}

@keyframes slideOutToLeft {
   from {
      opacity: 0;
      transform: translateX(0);
   }
   to {
      opacity: 1;
      transform: translateX(-10%);
   }
}

.modal-carousel img {
   width: 100%;
   transition: opacity 0.5s ease-in-out;
}

.modal-carousel img.active {
   animation: slideInFromRight 0.3s forwards;
}

.modal-carousel img.exiting {
   animation: slideInFromRight 0.3s forwards;
}
