/* Variables CSS pour les couleurs et styles principaux */
:root {
  /* Couleur du fond principal */
  --color-violet: #431C53;

  /* Couleur du fond secondaire */
  --color-light-violet: #493178;

  /* Couleur des titres */
  --color-jeune: #FFDE59;

  /* Couleur du texte */
  --color-light-lilas: #ddd5ff;

  /* Couleur du texte du footer */
  --color-light-beige: #f8ebd5;

  /* Couleur supplémentaire */
  --color-orange: #FFA500;

  --transition-speed: 0.3s ease;
  --fade-duration: 0.8s ease;
}
/* Animations */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-violet);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeOut 1s ease-in-out 2s forwards; /* Desaparece após 2s */
}

.loader::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid var(--color-light-lilas);
  border-top: 5px solid var(--color-jeune);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* Animações de entrada para seções */
.section-accueil, .section-apropos, .section-competences, .section-projets, .section-experiences, .section-formations, .section-contact {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp var(--fade-duration) forwards;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Atraso para animações sequenciais (opcional, para efeito cascata) */
.section-apropos { animation-delay: 0.2s; }
.section-competences { animation-delay: 0.4s; }
.section-projets { animation-delay: 0.6s; }
.section-experiences { animation-delay: 0.8s; }
.section-formations { animation-delay: 1s; }
.section-contact { animation-delay: 1.2s; }

/* Hover melhorado em botões e links */
.btn, nav a, .contact-icons a {
  transition: all var(--transition-speed);
}

.btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 222, 89, 0.3);
}

nav a:hover {
  transform: translateY(-2px);
}

.contact-icons a:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Animação de ícones em competências/projetos */
.competence-item ul li .icon, .container-projet .icon {
  transition: transform var(--transition-speed);
}

.competence-item ul li:hover .icon, .container-projet a:hover .icon {
  transform: scale(1.2) rotate(10deg);
}

/* Parallax leve no fundo (opcional, para profundidade) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(67, 28, 83, 0.1), rgba(73, 49, 120, 0.1));
  z-index: -1;
  animation: parallax 10s ease-in-out infinite alternate;
}

@keyframes parallax {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* Transições no menu hambúrguer */
.hamburger .bar {
  transition: all var(--transition-speed);
}

.hamburger.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* Feedback visual no formulário (em vez de alertas) */
.form-row input, .form-row select, .form-row textarea {
  transition: border-color var(--transition-speed);
}

.form-row input:invalid, .form-row select:invalid, .form-row textarea:invalid {
  border-color: #ff6b6b; /* Vermelho suave para erro */
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Reset de base pour uniformiser les styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--color-violet);
  /* Fond violet foncé */
  color: var(--color-light-lilas);
  /* Texte lilas clair */
  line-height: 1.5;
  min-height: 100vh;
  padding-top: 60px;
  /* Ajustement pour compenser la hauteur du header fixe */
}

body h1 {
  color: var(--color-jeune);
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 40px;
}

p {
  padding: 10px;
}

/* Conteneur centralisé avec espacement */
.container {
  max-width: 960px;
  margin: 0px auto;
  padding: 0 20px;
}

/* Header - logo et menu de navigation */
header {
  background-color: var(--color-violet);
}

.header-content {
  position: fixed;
  /* Fixe en haut de la page */
  padding-top: 0px;
  top: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  right: 0px;
  left: 0px;
  background-color: var(--color-violet);
  z-index: 1000;
  /* Assure la superposition */
}

header h1 {
  color: var(--color-jeune);
  font-weight: bold;
  background-color: var(--color-violet);
  border-radius: 20px 20px 20px 20px;
  margin-left: 5px;
}

nav ul {
  list-style: none;
  margin-left: 0;
  padding: 0;
  display: flex;
}

nav ul li a {
  display: block;
  padding: 15px 10px;
  text-decoration: none;
  color: var(--color-light-lilas);
  background-color: var(--color-light-violet);
  transition: background-color 0.3s;
}

li:first-child a {
  border-radius: 20px 0px 0px 20px;
}

li:last-child a {
  border-radius: 0px 20px 20px 0px;
}

nav a:hover {
  background-color: var(--color-jeune);
  color: var(--color-violet);
}

/* Styles communs aux sections */
section h1 {
  color: var(--color-jeune);
  margin-bottom: 20px;
  font-weight: 900;

}

section h2 {
  color: var(--color-jeune);
  margin-bottom: 20px;
  font-weight: 700;
  text-align: center;
  /* Centralisation ajoutée pour uniformiser tous les titres h2 des sections */
}

/* Layout de la section Accueil */
.section-accueil {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  scroll-margin-top: 380px;
}

.intro-text {
  max-width: 420px;
}

.intro-text h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.intro-text p {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-light-lilas);
}

.intro-img img {
  max-width: 400px;
  border-radius: 25px;

}

/* Section À propos */
.section-apropos {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: center;
  padding: 20px 0;
  scroll-margin-top: 200px;
}

.apropos-img img {
  max-width: 350px;
  border-radius: 20px;
}


.apropos-text {
  background-color: var(--color-light-violet);
  color: var(--color-light-lilas);
  border-radius: 15px;
  padding: 20px;
  flex: 1 1 400px;
  font-size: 1rem;
  text-align: justify;
}

/* Icônes standardisées */
.icon {
  flex-shrink: 0;
  font-size: 1rem;
  max-width: 50px;
  opacity: 0.8;
  width: 50px;
  height: 50px;
  /* Uniformisation des icônes */
}

/* Section Compétences */
.section-competences,
.competences-list {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0px 0;
  scroll-margin-top: 200px;
}

.competence-item {
  background-color: var(--color-light-violet);
  flex: 1 1 280px;
  border-radius: 15px;
  padding: 15px 20px;
  text-align: center;
  color: var(--color-light-lilas);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.competence-item img {
  max-width: 70px;
}

.competence-item h3,
h3 {
  color: var(--color-jeune);
  margin-bottom: 10px;
}

.competence-item ul {
  list-style: none;
  font-size: 0.9rem;
  color: var(--color-light-lilas);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, max-content));
  /* Ajuste la largeur au contenu */
  justify-content: center;
  /* Centre la grille */
  gap: 20px;
}

.competence-item ul li {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Centre image et texte */
  justify-content: flex-start;
  /* Évite l'espacement du texte */
  gap: 5px;
  /* Espace entre image et texte */
}

.competence-item ul li .icon-name {
  text-align: center;
  font-size: 14px;
}


/* Section Projets */

.section-projets h1 {
  align-items: center;
}

.section-projets {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 20px 0;
  scroll-margin-top: 200px;
}

.projet-item {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: nowrap;
  align-items: center;
  background-color: var(--color-light-violet);
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

.projet-item img {
  max-width: 400px;
  border-radius: 15px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.projet-description {
  max-width: 570px;
  color: var(--color-light-lilas);
  font-weight: 300;
  text-align: justify;
}

.container-projet {
  padding: 15px;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

.projet-description h3 {
  color: var(--color-jeune);
}

.btn {
  display: inline-block;
  margin-top: 15px;
  background-color: var(--color-jeune);
  color: var(--color-violet);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 25px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: var(--color-jeune);
  color: var(--color-violet);
  transform: scale(1.05);  /* Zoom leve para interatividade */
}

.projet-item img:hover {
   transform: scale(1.3); }

/* Section Expériences */
.section-experiences {
  scroll-margin-top: 200px;
}

.experience-item {
  background-color: var(--color-light-violet);
  border-radius: 15px;
  margin-bottom: 25px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  color: var(--color-light-lilas);
  padding: 20px;
}

.experience-item h3 {
  color: var(--color-jeune);
  margin-bottom: 6px;
}

.experience-item span {
  font-style: italic;
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 10px;
}

.experience-item ul {
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-light-lilas);
}

/* Section Formations */
.section-formations {
  max-width: 960px;
  margin: 60px auto;
  padding: 0 20px;
  scroll-margin-top: 200px;

}

.timeline {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 80px;
  flex-direction: row-reverse;
}

.timeline li {
  text-align: center;
  flex: 1;
  position: relative;
}

.complete h2 {
  color: var(--color-jeune);
  margin-bottom: 6px;
}

.complete h3 {
  color: var(--color-light-beige);
  margin-bottom: 6px;
}

.complete p {
  color: var(--color-light-lilas);
  font-style: italic;
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 6px;
}

.timestamp {
  font-weight: 600;
  margin-bottom: 0px;
}

.status {
  border-top: 5px solid var(--color-light-violet);
  margin-top: 10px;
  padding-top: 20px;
  position: relative;
}

.timeline li .status::before {
  content: "";
  width: 20px;
  height: 20px;
  background: var(--color-light-violet);
  border-radius: 50%;
  border: 2px solid var(--color-light-violet);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

/* Section Contact */
.section-contact {
  scroll-margin-top: 200px;
  /* Déplacement du scroll-margin-top de 'form' vers la section entière pour une meilleure couverture */
}

.section-contact form {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

input,
select,
textarea {
  flex: 1 1 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  color: var(--color-light-lilas);
  background-color: var(--color-light-violet);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-jeune);
}

textarea {
  min-height: 100px;
}

button[type="submit"] {
  background-color: var(--color-light-violet);
  border: 2px solid var(--color-light-violet);
  color: var(--color-jeune);
  font-weight: 700;
  padding: 10px 25px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

button[type="submit"]:hover {
  background-color: var(--color-jeune);
  color: var(--color-violet);
}

/* Icônes de contact */
.contact-icons {
  margin-top: 20px;
  text-align: center;

}

.contact-icons a {
  color: var(--color-jeune);
  font-size: 1.8rem;
  margin: 0 15px;
  text-decoration: none;

}

.contact-icons a:hover {
  color: var(--color-violet);
  transform: scale(1.05);
  /* Zoom leve para interatividade */
}

/* Footer */
footer {
  background-color: var(--color-light-violet);
  text-align: center;
  padding: 50px 0;
  color: var(--color-light-beige);
  margin-top: 0px;
  user-select: none;
}

/* Estilos para o botão hambúrguer */
.hamburger {
  display: none;
  /* Escondido por padrão (telas grandes) */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 20px;
}

.hamburger .bar {
  width: 100%;
  height: 3px;
  background-color: var(--color-light-lilas);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Menu fechado por padrão em telas pequenas */
nav ul {
  display: flex;
  /* Mantém visível em telas grandes */
}

/* Classe para menu aberto (adicionada via JS) */
nav.active ul {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-violet);
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

nav.active ul li {
  margin: 10px 0;
}

nav.active ul li a {
  padding: 10px;
  border-radius: 10px;
}

/* Responsivité générale */
@media (max-width: 768px) {

  .section-accueil,
  .section-apropos,
  .projet-item,
  .section-competences {
    flex-direction: column;
    align-items: center;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .competences-list {
    flex-direction: column;
    gap: 25px;
  }

  .timeline {
    flex-direction: column;
    gap: 50px;
  }

  .timeline li {
    width: 100%;
  }

  .timeline li .status::before {
    left: 10px;
    transform: none;
  }

  .status {
    border-left: 2px solid var(--color-jeune);
    border-top: none;
    padding-left: 35px;
  }

  .hamburger {
    display: flex;
    /* Mostra o hambúrguer em telas pequenas */
  }

  nav ul {
    display: none;
    /* Esconde o menu por padrão em telas pequenas */
  }

  nav.active ul {
    display: flex;
    /* Mostra o menu quando a classe 'active' é adicionada */
  }


}