/* ===============================
   Base & Reset
=============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #3c3c3c;
  text-align: justify;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}

/* Clear float helper */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ===============================
   Header
=============================== */
header {
  background: linear-gradient(135deg, #3E5C90 0%, #2a4066 100%);
  color: white;
  padding: 15px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 100;
}

.branding {
  margin-bottom: 10px;
}

.logo {
  float: left;
  width: 80px;
  margin-right: 15px;
}

.logo img {
  max-width: 100%;
  height: auto;
  display: block;
}

.titles {
  float: left;
  width: calc(100% - 95px);
  text-align: left;
  margin-top: 12px;
}

.titles h1 {
  font-size: 1.2rem;
  margin-bottom: 3px;
}

.titles h2 {
  font-size: 0.8rem;
  font-weight: normal;
}

nav {
  clear: both;
  text-align: center;
}

nav ul {
  list-style: none;
}

nav li {
  display: inline-block;
  margin: 3px;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  display: inline-block;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

nav a:hover::before {
  left: 0;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

nav a:active,
nav a:focus {
  background-color: rgba(255, 255, 255, 0.3);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* ===============================
   Main – Mobile
=============================== */
main {
  padding: 30px 0;
}

main .container {
  padding: 10px;
}

#about, #formations, #experiences {
  width: 100%;
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#about:hover, #formations:hover, #experiences:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#about h2, #formations h2, #experiences h2 {
  color: #3E5C90;
  font-size: 1.5rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 3px solid #3E5C90;
  position: relative;
}

#about h2::after, #formations h2::after, #experiences h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3E5C90, transparent);
}

#about::after {
  content: "";
  display: table;
  clear: both;
}

.about-text {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

.about-image {
  width: 100%;
  text-align: center;
}

.about-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.about-image img:hover {
  transform: scale(1.03);
}

#formations ul, #experiences ul {
  list-style: disc;
  padding-left: 25px;
}

#formations li, #experiences li {
  margin-bottom: 10px;
}

.sidebar {
  width: 100%;
  margin-top: 20px;
}

.sidebar section {
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.88);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border-left: 4px solid #3E5C90;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar section:hover {
  transform: translateX(5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.sidebar h2 {
  color: #3E5C90;
  font-size: 1.3rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.sidebar ul {
  list-style: disc;
  padding-left: 25px;
}

.sidebar li {
  margin-bottom: 8px;
}

/* Icônes contact personnalisées */
#contact ul {
  list-style: none;
  padding-left: 0;
}

#contact li {
  margin-bottom: 12px;
}

#contact li i {
  width: 20px;
  margin-right: 10px;
  color: #3E5C90;
  font-size: 1.1rem;
}

/* ===============================
   Mobile intermédiaire ≥ 480px
   → sidebar en 2 colonnes
=============================== */
@media (min-width: 480px) {
  #hard-skills, #soft-skills,
  #extra-pro, #langues {
    float: left;
    width: 48%;
    margin-right: 4%;
    margin-bottom: 20px;
  }

  #soft-skills, #langues {
    margin-right: 0;
  }

  #contact {
    clear: both;
    float: none;
    width: 100%;
  }
}

/* ===============================
   Desktop ≥ 768px
   → sidebar repositionnée à gauche
=============================== */
@media (min-width: 768px) {
  header .container {
    max-width: 900px; 
  }
  
  main .container {  
    max-width: 900px;
  }

  .titles h1 {
    font-size: 1.5rem;
  }

  .titles h2 {
    font-size: 1rem;
  }

  .logo {
    width: 100px;
    margin-right: 20px;
  }

  .titles {
    width: calc(100% - 120px);
  }

  /* Sidebar flottante à gauche */
  .sidebar {
    float: left;
    width: 28%;
    margin-right: 4%;
    margin-top: 0;
  }

  .sidebar section {
    margin-bottom: 25px;
  }

  /* Réinitialiser les floats des sections sidebar sur desktop */
  .sidebar section,
  #hard-skills, #soft-skills, #extra-pro, #langues, #contact {
    float: none;
    width: 100%;
    margin-right: 0;
  }

  /* Contenu principal flotté à droite */
  #about, #formations, #experiences {
    float: right;
    width: 68%;
    margin-bottom: 30px;
  }

  #about .about-text {
    float: left;
    width: 58%;
    text-align: left;
    margin-bottom: 0;
  }

  #about .about-image {
    float: right;
    width: 38%;
    text-align: center;
  }

  #about .about-image img {
    width: 100%;
    max-height: none;
  }
}

/* Desktop large ≥ 1024px */
@media (min-width: 1024px) {
  header .container,
  main .container {
    max-width: 1100px;
  }

  .sidebar {
    width: 26%;
    margin-right: 4%;
  }

  #about, #formations, #experiences {
    width: 70%;
  }
}

/* ===============================
   Footer
=============================== */
footer {
  background: linear-gradient(135deg, #3E5C90 0%, #2a4066 100%);
  color: white;
  text-align: center;
  padding: 20px 0;
  font-size: 0.9rem;
  clear: both;
  margin-top: 40px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

/* ===============================
   Bouton retour en haut
=============================== */
#btn-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #3E5C90 0%, #2a4066 100%);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

#btn-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#btn-top:hover {
  background: linear-gradient(135deg, #4a6ba8 0%, #3a5078 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#btn-top:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#btn-top:focus {
  outline: 3px solid rgba(62, 92, 144, 0.5);
  outline-offset: 3px;
}

/* Responsive mobile */
@media (max-width: 480px) {
  #btn-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 1.3rem;
  }
}