:root {
      --primary-color: #3498db;
      --secondary-color: #2c3e50;
      --text-color: #333;
      --background-color: #f4f4f4;
      --typing-speed: 0.1s;
    }

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.pp img{
  background-position: center center;
  background-size: cover;
  width: 150px;
  border-radius: 50%;
  border: 5px solid #f1f1f1;
}

header {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

header h1, header p {
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  border-right: 0.15em solid var(--text-color);
  animation: typing var(--typing-speed) steps(40, end), blink-caret 0.75s step-end infinite;
}

header h1 {
  font-size: 2.5rem;
  animation-duration: 3.5s;
}

header p {
  font-size: 1.2rem;
  opacity: 0;
  animation: typing var(--typing-speed) steps(40, end), blink-caret 0.75s step-end infinite;
  animation-duration: 2.0s;
  animation-delay: 3.5s;
  animation-fill-mode: forwards;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: white; }
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
}

nav {
  background-color: var(--secondary-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
}

nav ul li {
  margin: 0 1rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--primary-color);
}

main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

section {
  background-color: white;
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  scroll-margin-top: 70px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h2 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.skill {
  display: flex;
  align-items: center;
  background-color: var(--primary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.skill img {
  margin-right: 0.5rem;
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.skill.visible {
  opacity: 1;
  transform: scale(1);
}

.skill:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.skill:hover img {
  transform: rotate(360deg);
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background-color: var(--primary-color);
}

.timeline-item {
  margin-bottom: 1.5rem;
  position: relative;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.3rem;
  top: 0.2rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background-color: var(--primary-color);
}

#apropos h2{
  text-transform: capitalize;
}

footer {
  background-color: var(--secondary-color);
  color: white;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
}

#print-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #4CAF50; /* Vert élégant */
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 20px;
    left: 10px;
}

#print-btn:hover {
    background-color: #45a049; /* Plus sombre au survol */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

#print-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-size: 20px;
  cursor: pointer;
  transition: opacity 0.3s, visibility 0.3s;
  opacity: 0;
  visibility: hidden;
}

#scroll-to-top:hover {
  background-color: var(--secondary-color);
}

/* Styles pour l'animation de chargement */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid var(--secondary-color);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Style pour la fenêtre modale */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 80%;
    animation: fadeIn 0.5s;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover, .modal-close:focus {
    color: #bbb;
}

/* Animation pour la modale */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 2px 0;
  transition: 0.4s;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
  }

  .nav-links.active {
    display: flex;
  }

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

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

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

.modal-prev, .modal-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.modal-next {
    right: 20px;
}

.modal-prev {
    left: 20px;
}

.modal-prev:hover, .modal-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

@media print {
    /* Forcer l'orientation paysage */
    @page {
        size: A4 landscape; /* Taille A4 en mode paysage */
        margin: 1cm; /* Marges personnalisées */
    }

    /* Styles pour adapter le contenu à une page */
    body {
        font-size: 12px; /* Ajuster la taille des polices */
        line-height: 1.2; /* Ajuster l'espacement des lignes */
    }

    /* Masquer des éléments inutiles à l'impression */
    #print-btn, 
    nav, 
    footer { /* Masquer les boutons, la navigation et le footer */
        display: none !important;
    }

    /* Adapter les sections à l'impression */
    section {
        page-break-inside: avoid; /* Empêcher les coupures au milieu des sections */
    }

    /* Ajuster les images pour être fluides et ne pas dépasser la largeur */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Adapter les marges internes des sections */
    section {
        margin: 0;
        padding: 0;
    }
}

@media (max-width: 768px) {

  main {
    grid-template-columns: 1fr;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
  }

  nav ul li {
    margin: 0.5rem 0;
  }
}

@media (max-width: 1286px){
    #print-btn {
        display: none;
  }
}

@media (max-width: 496px) {
  header h1, header p {
    white-space: normal;
    border-right: none;
    animation: none;
    padding: 0 10px;
  }

  header h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  header p {
    font-size: 1rem;
    opacity: 1;
  }

  .container {
    padding: 1rem;
  }
}