* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

:root {
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #ffffff;
  --sidebar-hover: #4ac0ee;
  --sidebar-active: #007bff;
  --content-bg: #f4f4f4;
  --text-color: #333333;
  --heading-color: #0056cc;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --border-color: #e0e0e0;
  --input-bg: #ffffff;
  --input-text: #333333;
  --input-border: #cccccc;
  --button-bg: #007bff;
  --button-text: #ffffff;
  --button-hover: #0056cc;
  --popup-bg: rgba(0, 0, 0, 0.7);
  --popup-content-bg: #ffffff;
  --timeline-line: #007bff;
  --timeline-dot: #007bff;
  --timeline-date: #007bff;
}

/* Correction pour le mode sombre */
.dark {
  --sidebar-bg: #121212;
  --sidebar-text: #e0e0e0;
  --sidebar-hover: #4ac0ee;
  --sidebar-active: #4ac0ee;
  --content-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --heading-color: #4ac0ee;
  --card-bg: #2d2d2d;
  --card-shadow: rgba(0, 0, 0, 0.3);
  --border-color: #444444;
  --input-bg: #333333;
  --input-text: #e0e0e0;
  --input-border: #555555;
  --button-bg: #4ac0ee;
  --button-text: #121212;
  --button-hover: #7ad0f0;
  --popup-bg: rgba(0, 0, 0, 0.8);
  --popup-content-bg: #2d2d2d;
  --timeline-line: #4ac0ee;
  --timeline-dot: #4ac0ee;
  --timeline-date: #4ac0ee;
}

/* Assurer que le contenu principal a le bon fond en mode sombre */
.dark .content {
  background-color: var(--content-bg);
}

.dark .page {
  background-color: var(--content-bg);
}

.dark .page:nth-child(odd),
.dark .page:nth-child(even) {
  background-color: var(--content-bg);
}

/* Correction pour les sections spécifiques */
.dark #parcours {
  background-color: var(--content-bg) !important;
}

.dark .timeline {
  background-color: var(--content-bg);
}

.dark .certif-section {
  background-color: var(--content-bg);
}

body {
  font-family: "Poppins", "Arial", sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: var(--content-bg);
  color: var(--text-color);
}

.container {
  display: flex;
  width: 100%;
}

/* Ajustement de la sidebar pour qu'elle utilise toute la hauteur sans débordement */
.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 20px;
  color: var(--sidebar-text);
  position: fixed;
  height: 100vh;
  z-index: 1000;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
}

/* Cacher la sidebar */
.sidebar.hidden {
  display: none !important; /* Force le cache de la sidebar */
}

.photo-container {
  text-align: center;
  margin-bottom: 30px;
}

.photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 15px;
  border: 3px solid var(--sidebar-hover);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
}

.photo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.photo-container h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--sidebar-text);
}

/* Ajustement du menu pour qu'il ne prenne pas trop de place */
.menu {
  flex-grow: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}

.menu ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  font-size: 1.1em;
}

/* Ajustement des marges des éléments du menu */
.menu li {
  margin: 8px 0;
  width: 100%;
}

.menu a {
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
  padding: 12px 15px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.menu a:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.menu a:hover:before {
  left: 100%;
}

.menu a.active {
  color: var(--sidebar-active);
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.menu a:hover {
  color: var(--sidebar-hover);
  transform: translateX(5px);
}

/* Ajustement du footer pour qu'il reste en bas */
footer.copyright {
  margin-top: 10px;
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  opacity: 0.8;
}

/* Style amélioré pour le lien des mentions légales */
footer.copyright a {
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-block;
}

footer.copyright a:hover {
  color: var(--sidebar-hover);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

footer.copyright a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--sidebar-hover);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

footer.copyright a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.content {
  width: 100%;
  margin-left: 280px;
  padding: 0;
  overflow-y: scroll;
  height: 100vh;
  scroll-behavior: smooth;
}

.page {
  min-height: 100vh;
  padding: 60px 40px;
  background-color: var(--content-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.page:nth-child(odd) {
  background-color: var(--content-bg);
}

.page:nth-child(even) {
  background-color: var(--content-bg);
}

.accueil {
  background: linear-gradient(120deg, #007bff, #00c6ff);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}

.accueil .hero {
  text-align: center;
}

.accueil h1 {
  font-size: 70px;
  margin-bottom: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.accueil p {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 1px;
}

h2 {
  text-align: left;
  color: var(--heading-color);
}

.message-box {
  height: 200px;
  width: 380px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -100px;
  margin-left: -190px;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  text-align: center;
}

.message-box h1 {
  font-size: 60px;
  line-height: 46px;
  margin-bottom: 40px;
}

/* Mode toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-toggle i {
  font-size: 24px;
}

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  border: none;
  border-radius: 8px;
  width: 50px;
  height: 50px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1002;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive styles */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .content {
    margin-left: 240px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    transition: transform 0.3s ease;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .page {
    padding: 80px 20px 40px;
  }
}

@media (max-width: 480px) {
  .accueil h1 {
    font-size: 50px;
  }

  .accueil p {
    font-size: 18px;
  }
}

/* Ajustement pour les petits écrans */
@media (max-height: 700px) {
  .photo {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
  }

  .photo-container h2 {
    font-size: 1.2rem;
  }

  .menu ul {
    font-size: 1rem;
  }

  .menu a {
    padding: 8px 12px;
  }

  footer.copyright {
    font-size: 10px;
  }
}

/* Améliorations pour le mode sombre */
.dark .accueil {
  background: linear-gradient(120deg, #4ac0ee, #0077cc);
}

.dark .page {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.dark .theme-toggle {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.dark .mobile-menu-toggle {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.dark .menu a.active {
  background-color: rgba(74, 192, 238, 0.15);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Amélioration des transitions */
.page,
.sidebar,
.menu a,
.photo,
.theme-toggle {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

