/* Styles généraux */
:root {
  --primary: #007BFF;
  --primary-dark: #0056b3;
  --secondary: #ffd700;
  --dark: #212529;
  --light: #f8f9fa;
  --transition: all 0.3s ease;
  --text-color: #444;
  --heading-color: #212529;
  --focus-ring-color: rgba(0, 123, 255, 0.5);
  --mobile-breakpoint: 576px;
  --tablet-breakpoint: 768px;
  --laptop-breakpoint: 992px;
  --desktop-breakpoint: 1200px;
  --large-desktop-breakpoint: 1400px;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
}

body {
  font-family: 'Poppins', 'Roboto', sans-serif;
  background-color: #f7f7f7;
  scroll-behavior: smooth;
  line-height: 1.6;
  color: var(--text-color);
  overflow-x: hidden;
}

/* Préchargeur */
#preloader {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Navigation améliorée et responsive - VERSION SANS AUTO-HIDE */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.6rem 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1030;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
  .navbar {
    padding: 0.9rem 0;
  }
}

.navbar.scrolled {
  padding: 0.4rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid rgba(0, 123, 255, 0.1);
}

@media (min-width: 768px) {
  .navbar.scrolled {
    padding: 0.6rem 0;
  }
}

/* Indicateur de progression de lecture */
.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--info), var(--success));
  width: var(--scroll-progress, 0%);
  transition: width 0.1s ease-out;
  z-index: 2;
  border-radius: 0 0 3px 3px;
}

/* Container avec espace maximisé pour tous les boutons */
.navbar .container {
  max-width: 100%;
  padding: 0 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

@media (min-width: 576px) {
  .navbar .container {
    padding: 0 0.3rem;
  }
}

@media (min-width: 768px) {
  .navbar .container {
    padding: 0 0.5rem;
  }
}

@media (min-width: 992px) {
  .navbar .container {
    padding: 0 0.75rem;
  }
}

@media (min-width: 1200px) {
  .navbar .container {
    max-width: 1140px;
    padding: 0 1rem;
  }
}

@media (min-width: 1400px) {
  .navbar .container {
    max-width: 1320px;
    padding: 0 1.5rem;
  }
}

/* Navbar-brand avec effet glass morphism amélioré */
.navbar-brand {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0px;
  padding: 2px 3px;
  position: relative;
  overflow: hidden;
  color: var(--primary) !important;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  max-width: fit-content;
  flex-shrink: 0;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tailles progressives COMPACTES */
@media (min-width: 400px) {
  .navbar-brand {
    font-size: 0.75rem;
    padding: 2px 4px;
  }
}

@media (min-width: 576px) {
  .navbar-brand {
    font-size: 0.85rem;
    padding: 3px 5px;
  }
}

@media (min-width: 768px) {
  .navbar-brand {
    font-size: 0.95rem;
    padding: 4px 6px;
  }
}

@media (min-width: 992px) {
  .navbar-brand {
    font-size: 1.05rem;
    padding: 5px 7px;
  }
}

@media (min-width: 1200px) {
  .navbar-brand {
    font-size: 1.15rem;
    padding: 6px 9px;
  }
}

@media (min-width: 1400px) {
  .navbar-brand {
    font-size: 1.25rem;
    padding: 7px 11px;
  }
}

/* Icône navbar-brand avec animation */
.navbar-brand i {
  margin-right: 2px;
  color: var(--primary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.75em;
  flex-shrink: 0;
  display: inline-block;
}

@media (min-width: 576px) {
  .navbar-brand i {
    margin-right: 3px;
    font-size: 0.8em;
  }
}

@media (min-width: 768px) {
  .navbar-brand i {
    margin-right: 4px;
    font-size: 0.85em;
  }
}

@media (min-width: 992px) {
  .navbar-brand i {
    margin-right: 4px;
    font-size: 0.9em;
  }
}

@media (min-width: 1200px) {
  .navbar-brand i {
    margin-right: 5px;
    font-size: 0.95em;
  }
}

/* Navigation avec effets améliorés */
.nav-item {
  position: relative;
  margin: 0;
}

@media (min-width: 768px) {
  .nav-item {
    margin: 0 0.5px;
  }
}

@media (min-width: 992px) {
  .nav-item {
    margin: 0 1px;
  }
}

@media (min-width: 1200px) {
  .nav-item {
    margin: 0 2px;
  }
}

@media (min-width: 1400px) {
  .nav-item {
    margin: 0 3px;
  }
}

.nav-link {
  font-weight: 500;
  font-size: 0.7rem;
  padding: 4px 5px !important;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  color: var(--dark) !important;
  white-space: nowrap;
  overflow: hidden;
}

@media (min-width: 576px) {
  .nav-link {
    font-size: 0.75rem;
    padding: 5px 6px !important;
  }
}

@media (min-width: 768px) {
  .nav-link {
    font-size: 0.8rem;
    padding: 6px 7px !important;
  }
}

@media (min-width: 992px) {
  .nav-link {
    font-size: 0.85rem;
    padding: 7px 9px !important;
  }
}

@media (min-width: 1200px) {
  .nav-link {
    font-size: 0.9rem;
    padding: 8px 11px !important;
  }
}

@media (min-width: 1400px) {
  .nav-link {
    font-size: 0.95rem;
    padding: 9px 13px !important;
  }
}

/* Effet de fond animé pour les nav-links */
.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
  border-radius: 8px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--info));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover::before,
.nav-item.active .nav-link::before {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
  width: 80%;
}

.nav-link:hover {
  transform: translateY(-1px);
  color: var(--primary) !important;
  text-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}

/* Indicateur de section active avec pulse */
.nav-item.active .nav-link {
  color: var(--primary) !important;
  font-weight: 600;
}

.nav-item.active .nav-link::after {
  animation: pulse-active 2s infinite;
}

@keyframes pulse-active {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.8);
  }
}

/* Theme toggle avec effets modernes */
#theme-toggle {
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--primary);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-left: 4px;
  flex-shrink: 0;
}

@media (min-width: 576px) {
  #theme-toggle {
    width: 36px;
    height: 36px;
    margin-left: 5px;
  }
}

@media (min-width: 768px) {
  #theme-toggle {
    width: 38px;
    height: 38px;
    margin-left: 6px;
  }
}

@media (min-width: 992px) {
  #theme-toggle {
    width: 40px;
    height: 40px;
    margin-left: 8px;
  }
}

@media (min-width: 1200px) {
  #theme-toggle {
    width: 42px;
    height: 42px;
    margin-left: 10px;
  }
}

/* Effet de hover sophistiqué pour le theme toggle */
#theme-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 123, 255, 0.2), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 50%;
}

#theme-toggle:hover::before {
  opacity: 1;
}

#theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
  border-color: var(--info);
}

/* Icône du theme toggle avec rotation fluide */
#theme-toggle i {
  font-size: 0.9rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  position: relative;
  color: var(--primary);
}

#theme-toggle:hover i {
  transform: rotate(180deg) scale(1.1);
  color: var(--info);
}

@media (min-width: 992px) {
  #theme-toggle i {
    font-size: 1rem;
  }
}

/* Burger menu animé moderne - VERSION AMÉLIORÉE */
.navbar-toggler {
  padding: 0;
  border: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 15px rgba(0, 123, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary), var(--info));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
  z-index: 0;
}

.navbar-toggler:hover::before {
  opacity: 0.1;
}

.navbar-toggler:focus {
  box-shadow: 
    0 0 0 3px rgba(0, 123, 255, 0.3),
    0 4px 15px rgba(0, 123, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  outline: none;
  transform: scale(1.05);
}

.navbar-toggler:active {
  transform: scale(0.95);
  box-shadow: 
    0 2px 8px rgba(0, 123, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.navbar-toggler-icon {
  width: 24px;
  height: 18px;
  background-image: none;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.navbar-toggler-icon,
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--info));
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  left: 0;
}

.navbar-toggler-icon::before {
  top: -7px;
  transform-origin: center;
}

.navbar-toggler-icon::after {
  top: 7px;
  transform-origin: center;
}

/* Animation du burger vers X améliorée */
.navbar-toggler[aria-expanded="true"] {
  transform: rotate(180deg);
  background: linear-gradient(145deg, rgba(0, 123, 255, 0.1), rgba(0, 188, 212, 0.1));
}

.navbar-toggler[aria-expanded="true"]::before {
  opacity: 0.2;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  background: transparent;
  transform: rotate(180deg);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
  top: 0;
  transform: rotate(45deg) scale(1.1);
  background: linear-gradient(90deg, #dc3545, #e74c3c);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
  top: 0;
  transform: rotate(-45deg) scale(1.1);
  background: linear-gradient(90deg, #dc3545, #e74c3c);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Effet hover sophistiqué */
.navbar-toggler:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 25px rgba(0, 123, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.navbar-toggler:hover .navbar-toggler-icon,
.navbar-toggler:hover .navbar-toggler-icon::before,
.navbar-toggler:hover .navbar-toggler-icon::after {
  background: linear-gradient(90deg, var(--primary), var(--success));
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Responsive navbar collapse avec glassmorphism - CORRIGÉ */
@media (max-width: 991px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    max-height: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
  }

  .navbar-collapse.show {
    max-height: 500px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .navbar-collapse.collapsing {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  body.dark-mode .navbar-collapse {
    background: rgba(20, 20, 20, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
  }

  /* Navigation mobile avec espacement optimal */
  .navbar-nav {
    padding: 1.5rem 0 1rem;
    width: 100%;
  }

  .nav-item {
    margin: 0 !important;
    width: 100%;
  }

  .nav-link {
    padding: 16px 24px !important;
    font-size: 1.1rem !important;
    font-weight: 500;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    margin: 0;
  }

  .nav-link::before,
  .nav-link::after {
    display: none;
  }

  .nav-link:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    transform: translateX(8px);
    color: var(--primary) !important;
    padding-left: 32px !important;
  }

  .nav-link:active {
    background: rgba(0, 123, 255, 0.1);
    transform: scale(0.98);
  }

  /* Animation en cascade pour les liens */
  .navbar-collapse.show .nav-link {
    animation: slideInUp 0.4s ease-out both;
  }

  .navbar-collapse.show .nav-item:nth-child(1) .nav-link { animation-delay: 0.1s; }
  .navbar-collapse.show .nav-item:nth-child(2) .nav-link { animation-delay: 0.15s; }
  .navbar-collapse.show .nav-item:nth-child(3) .nav-link { animation-delay: 0.2s; }
  .navbar-collapse.show .nav-item:nth-child(4) .nav-link { animation-delay: 0.25s; }
  .navbar-collapse.show .nav-item:nth-child(5) .nav-link { animation-delay: 0.3s; }
  .navbar-collapse.show .nav-item:nth-child(6) .nav-link { animation-delay: 0.35s; }
  .navbar-collapse.show .nav-item:nth-child(7) .nav-link { animation-delay: 0.4s; }
  .navbar-collapse.show .nav-item:nth-child(8) .nav-link { animation-delay: 0.45s; }

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

  /* Theme toggle mobile repositionné */
  #theme-toggle {
    margin: 1rem auto 0;
    display: flex;
    width: 44px !important;
    height: 44px !important;
  }

  /* Mode sombre pour navigation mobile */
  body.dark-mode .nav-link {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: #eee !important;
  }

  body.dark-mode .nav-link:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.2), rgba(0, 123, 255, 0.1));
  }
}

/* Mode sombre pour navbar */
body.dark-mode .navbar {
  background: rgba(20, 20, 20, 0.95) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .navbar.scrolled {
  background: rgba(20, 20, 20, 0.98) !important;
  border-bottom: 1px solid rgba(0, 123, 255, 0.2);
}

/* Mode sombre pour le bouton burger amélioré */
body.dark-mode .navbar-toggler {
  background: linear-gradient(145deg, rgba(45, 45, 45, 0.9), rgba(30, 30, 30, 0.8));
  box-shadow: 
    0 4px 15px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.dark-mode .navbar-toggler::before {
  background: linear-gradient(135deg, var(--primary), var(--info));
}

body.dark-mode .navbar-toggler:hover {
  background: linear-gradient(145deg, rgba(55, 55, 55, 0.9), rgba(40, 40, 40, 0.8));
  box-shadow: 
    0 8px 25px rgba(0, 123, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.dark-mode .navbar-toggler:focus {
  box-shadow: 
    0 0 0 3px rgba(0, 123, 255, 0.4),
    0 4px 15px rgba(0, 123, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.dark-mode .navbar-toggler[aria-expanded="true"] {
  background: linear-gradient(145deg, rgba(0, 123, 255, 0.2), rgba(0, 188, 212, 0.1));
}

body.dark-mode .navbar-toggler-icon,
body.dark-mode .navbar-toggler-icon::before,
body.dark-mode .navbar-toggler-icon::after {
  background: linear-gradient(90deg, #ffffff, #e0e0e0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .navbar-toggler:hover .navbar-toggler-icon,
body.dark-mode .navbar-toggler:hover .navbar-toggler-icon::before,
body.dark-mode .navbar-toggler:hover .navbar-toggler-icon::after {
  background: linear-gradient(90deg, var(--primary), var(--info));
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.4);
}

body.dark-mode .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before,
body.dark-mode .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
  background: linear-gradient(90deg, #ff6b6b, #ee5a52);
  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
}

/* Très petits écrans - simplification */
@media (max-width: 350px) {
  .navbar-brand {
    font-size: 0.7rem !important;
    padding: 1px 3px !important;
  }
  
  .navbar-brand i {
    margin-right: 2px !important;
    font-size: 0.7em !important;
  }
  
  .navbar .container {
    padding: 0 0.1rem !important;
  }
}

/* Écrans ultra-larges */
@media (min-width: 1600px) {
  .navbar .container {
    max-width: 1500px;
  }
  
  .navbar-brand {
    font-size: 1.4rem !important;
    padding: 10px 15px !important;
  }
  
  .nav-link {
    font-size: 1.1rem !important;
    padding: 12px 16px !important;
  }
  
  #theme-toggle {
    width: 46px !important;
    height: 46px !important;
  }
}

/* Ajustements de l'ensemble navbar-collapse */
.navbar-collapse {
  flex-shrink: 1;
  min-width: 0;
}

/* Styles pour les nav-links desktop */
.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  opacity: 0;
}

.nav-link:hover::before,
.nav-item.active .nav-link::before {
  width: 80%;
  opacity: 1;
}

.nav-link:hover {
  background: rgba(0, 123, 255, 0.1);
  transform: translateY(-2px);
  color: var(--primary) !important;
}

/* Correction des badges d'entreprises en mode sombre */
body.dark-mode .project-tools .badge {
  background-color: #495057 !important;
  color: #fff !important;
  border: 1px solid #6c757d;
}

body.dark-mode .project-tools .badge.bg-primary {
  background-color: var(--primary) !important;
  color: #fff !important;
}

body.dark-mode .project-tools .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

body.dark-mode .project-tools .badge.bg-success {
  background-color: var(--success) !important;
  color: #fff !important;
}

body.dark-mode .project-tools .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

body.dark-mode .project-tools .badge.bg-info {
  background-color: var(--info) !important;
  color: #fff !important;
}

/* Amélioration des features list en mode sombre */
body.dark-mode .project-features ul li {
  color: #e0e0e0 !important;
}

body.dark-mode .project-features ul li i {
  color: var(--primary) !important;
}

/* Card footer en mode sombre */
body.dark-mode .card-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Effet glassmorphism pour navbar-brand */
.navbar-brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 188, 212, 0.05));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  z-index: -1;
}

.navbar-brand:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.navbar-brand:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.navbar-brand:hover i {
  transform: translateY(-1px) rotate(-8deg) scale(1.1);
  color: var(--info);
}

/* Section Hero avec améliorations */
.hero {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  background-size: 400% 400%;
  color: #fff;
  padding: 180px 0 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: gradientBackground 15s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

@keyframes gradientBackground {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.3)"/></svg>');
  background-size: 30px 30px;
  opacity: 0.3;
  pointer-events: none;
}

.hero h1 {
  font-size: 4em;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  animation: fadeInDown 1.2s ease-out;
}

.hero p {
  font-size: 1.8em;
  margin-top: 20px;
  opacity: 0.9;
  animation: fadeInUp 1.2s ease-out 0.3s;
  animation-fill-mode: both;
}

.hero .typed-text {
  font-size: 1.8em;
  color: var(--secondary);
  min-height: 40px;
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.hero-actions {
  margin-top: 2rem;
}

.hero-actions .btn {
  margin: 0.5rem;
  transition: all 0.3s ease;
}

.hero-actions .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero .btn-primary {
  padding: 12px 30px;
  font-size: 1.1em;
  font-weight: 600;
  border-radius: 30px;
  background-color: var(--primary);
  border: none;
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
  transition: var(--transition);
  cursor: pointer;
}

.hero .btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}

/* Indicateur de scroll animé */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

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

/* Section À propos - Cards améliorées */
.profile-wrapper {
  position: relative;
  display: inline-block;
}

.profile-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.2rem;
}

.about-card {
  border-radius: 15px;
  overflow: hidden;
  border: none;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.about-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.profile-img {
  border: 5px solid white;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.profile-img:hover {
  transform: scale(1.05);
}

/* Statistiques rapides */
.stat-item {
  padding: 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, var(--primary), var(--info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0;
  font-weight: 500;
}

/* Section Projets - CORRIGÉE */
.project-filters {
  margin-bottom: 3rem;
}

.filter-btn {
  margin: 0.25rem 0.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.project-item {
  transition: all 0.3s ease;
  display: block; /* S'assurer que les projets sont visibles par défaut */
  opacity: 1;
}

.project-item.hide {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s ease;
}

.project-item.show {
  opacity: 1;
  transform: scale(1);
  transition: all 0.4s ease;
}

.project-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s ease;
  height: 100%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  display: block; /* S'assurer que les cards sont visibles */
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
  height: 200px;
  background: linear-gradient(135deg, var(--primary), var(--info));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-icon {
  font-size: 3rem;
  color: white;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.project-card:hover .project-icon {
  transform: scale(1.2) rotate(10deg);
  opacity: 1;
}

.project-overlay {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
}

.project-tools .badge {
  margin: 0.2rem;
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
}

.project-features {
  margin-top: 1rem;
}

.project-features ul li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.project-features ul li i {
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

.card-footer {
  background: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Section Compétences - Design moderne */
.skills-card {
  border-radius: 15px;
  padding: 30px;
  height: 100%;
  background: white;
  border: none;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.skills-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.skills-icon {
  font-size: 3.5rem;
  margin-bottom: 25px;
  color: var(--primary);
  transition: var(--transition);
}

.skills-card:hover .skills-icon {
  transform: scale(1.1);
  color: var(--primary-dark);
}

.skills-card h4 {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--dark);
}

/* Barres de progression pour les compétences */
.skills-progress {
  margin-top: 1.5rem;
  text-align: left;
}

.skill-item {
  margin-bottom: 1rem;
}

.skill-item span {
  font-size: 0.9rem;
  font-weight: 500;
}

.progress {
  height: 8px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.progress-bar {
  border-radius: 10px;
  transition: width 1.5s ease-in-out;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    45deg,
    transparent 35%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 65%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Animation des barres au scroll */
.skills-card.aos-animate .progress-bar {
  animation: progressLoad 1.5s ease-in-out;
}

@keyframes progressLoad {
  0% {
    width: 0 !important;
  }
}

/* Bouton retour en haut */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

#back-to-top i {
  font-size: 1.2rem;
}

/* Notification toast */
.toast-container {
  z-index: 9999;
}

.toast {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.toast .btn-close {
  filter: brightness(0) invert(1);
}

/* Styles pour la section contact */
.contact-info-card, .contact-form-card {
  background-color: #fff;
  border-radius: 15px;
  padding: 30px;
  height: 100%;
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.contact-info-card:hover, .contact-form-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 15px;
  transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
  transform: scale(1.1) rotate(10deg);
  background-color: var(--primary-dark);
}

.contact-details h5 {
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 1.1rem;
}

.contact-details a, .contact-details p {
  color: #555;
  margin-bottom: 0;
  text-decoration: none;
  transition: all 0.3s ease;
}

.contact-details a:hover {
  color: var(--primary);
}

/* Styles pour le formulaire flottant */
.form-floating > .form-control, .form-floating > .form-control-plaintext {
  height: calc(3.5rem + 2px);
  line-height: 1.25;
}

.form-floating > label {
  padding: 1rem 0.75rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.contact-btn {
  padding: 12px 25px;
  font-weight: 500;
  border-radius: 30px;
  border: none;
  background: var(--primary);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
  transition: all 0.3s ease;
}

.contact-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.contact-description {
  color: #666;
  font-style: italic;
  border-left: 3px solid var(--primary);
  padding-left: 15px;
}

/* Footer amélioré */
footer {
  background: linear-gradient(135deg, #111, #333);
  color: #fff;
  text-align: center;
  padding: 40px 0;
}

footer p {
  margin-bottom: 0;
  opacity: 0.8;
}

/* Styles pour les liens du footer */
footer a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0.8;
}

footer a:hover {
  color: var(--primary);
  opacity: 1;
  text-decoration: underline;
}

/* Footer en mode sombre */
body.dark-mode footer {
  background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
  color: #eee;
}

body.dark-mode footer p {
  color: #eee;
  opacity: 0.9;
}

body.dark-mode footer a {
  color: #eee;
  opacity: 0.9;
}

body.dark-mode footer a:hover {
  color: var(--primary);
  opacity: 1;
}

/* Timeline Experience */
.timeline {
  position: relative;
  padding: 2rem 0;
}
.timeline::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #007BFF;
  transform: translateX(-50%);
}
.timeline-item {
  position: relative;
  margin: 2rem 0;
  width: 50%;
  padding: 1rem 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }
.timeline-item::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 20px;
  height: 20px;
  background: #007BFF;
  border-radius: 50%;
  z-index: 1;
}
.timeline-item.left::before { right: -10px; }
.timeline-item.right::before { left: -10px; }

/* Section Titres */
.section-heading {
  position: relative;
  border-bottom: none;
  display: inline-block;
  padding-bottom: 10px;
  margin-bottom: 50px;
  font-size: 2.5em;
  font-weight: 700;
  color: var(--heading-color);
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

section {
  padding: 100px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .timeline::after { left: 8%; }
  .timeline-item {
    width: 90%;
    margin-left: 10%;
  }
  .timeline-item.right { left: 10%; }
  
  .project-filters {
    margin-bottom: 2rem;
  }
  
  .filter-btn {
    margin: 0.25rem;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }
  
  .project-image {
    height: 150px;
  }
  
  .project-icon {
    font-size: 2rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* Améliorations pour petits écrans */
@media (max-width: 480px) {
  .hero-actions .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }
  
  .stat-item {
    padding: 0.5rem;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .skills-progress {
    margin-top: 1rem;
  }
  
  .skill-item span {
    font-size: 0.85rem;
  }
  
  .project-tools .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
}

/* Adaptations pour le mode sombre */
body.dark-mode {
  background-color: #121212;
  color: #eee;
}

body.dark-mode .bg-light {
  background-color: #1e1e1e !important;
}

body.dark-mode .bg-white {
  background-color: #1e1e1e !important;
}

body.dark-mode .contact-info-card, 
body.dark-mode .contact-form-card, 
body.dark-mode .skills-card, 
body.dark-mode .timeline-item,
body.dark-mode .about-card,
body.dark-mode .project-card {
  background-color: #2d2d2d;
  color: #eee;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .project-card:hover {
  border-color: rgba(0, 123, 255, 0.3);
  background: linear-gradient(145deg, #2d2d2d, #3a3a3a);
}

body.dark-mode .project-card .card-title {
  color: #fff !important;
}

body.dark-mode .project-card .card-text {
  color: #ddd !important;
}

body.dark-mode .filter-btn {
  border-color: var(--primary);
  color: var(--primary);
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
  background: var(--primary);
  color: white;
}

body.dark-mode .form-control {
  background-color: #333;
  color: #eee;
  border-color: #444;
}

body.dark-mode .form-floating label {
  color: #bbb;
}

body.dark-mode .contact-details a, 
body.dark-mode .contact-details p,
body.dark-mode .timeline-item p,
body.dark-mode .skills-card p {
  color: #bbb;
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6, 
body.dark-mode .section-heading {
  color: #fff;
}

body.dark-mode .stat-label {
  color: #aaa;
}

body.dark-mode .project-features ul li {
  color: #e0e0e0 !important;
}

body.dark-mode .project-features ul li i {
  color: var(--primary) !important;
}

body.dark-mode .card-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .progress {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Support pour les préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
  .animate-bounce,
  .progress-bar::after {
    animation: none;
  }
  
  .project-card:hover,
  .skills-card:hover,
  .btn:hover {
    transform: none;
  }
  
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Responsive viewport units */
.hero {
  min-height: calc(var(--vh, 1vh) * 100);
}

/* Styles pour les logos d'entreprises */
.company-logo {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 15px;
}

.timeline-item.left .company-logo {
  justify-content: flex-end;
}

.timeline-item.right .company-logo {
  justify-content: flex-start;
}

.company-logo img {
  max-height: 60px;
  max-width: 150px;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
  padding: 5px;
}

.company-logo img:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

@media (max-width: 991px) {
  .company-logo {
    justify-content: flex-start !important;
  }
  
  .company-logo img {
    max-height: 50px;
    max-width: 120px;
  }
}

@media (max-width: 576px) {
  .company-logo img {
    max-height: 40px;
    max-width: 100px;
  }
}

body.dark-mode .company-logo img {
  background-color: #f5f5f5;
}

/* Correction des badges d'entreprises en mode sombre */
body.dark-mode .project-tools .badge {
  background-color: #495057 !important;
  color: #fff !important;
  border: 1px solid #6c757d;
}

body.dark-mode .project-tools .badge.bg-primary {
  background-color: var(--primary) !important;
  color: #fff !important;
}

body.dark-mode .project-tools .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

body.dark-mode .project-tools .badge.bg-success {
  background-color: var(--success) !important;
  color: #fff !important;
}

body.dark-mode .project-tools .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

body.dark-mode .project-tools .badge.bg-info {
  background-color: var(--info) !important;
  color: #fff !important;
}

/* Amélioration des features list en mode sombre */
body.dark-mode .project-features ul li {
  color: #e0e0e0 !important;
}

body.dark-mode .project-features ul li i {
  color: var(--primary) !important;
}

/* Card footer en mode sombre */
body.dark-mode .card-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ===== CORRECTIONS MOBILES SIMPLIFIÉES ===== */

/* Navbar mobile ultra-optimisée - CORRIGÉE COMPLÈTEMENT */
@media (max-width: 991.98px) {
  /* Navbar container fixe */
  .navbar {
    min-height: 70px;
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  }
  
  .navbar .container {
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  
  /* Brand mobile optimisé avec taille fixe */
  .navbar-brand {
    font-size: 1.1rem !important;
    padding: 8px 12px !important;
    max-width: calc(100vw - 140px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
  }
  
  /* Zone des boutons (toggle + theme) */
  .navbar .d-flex {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  
  /* Toggle button CORRIGÉ avec visibilité forcée */
  .navbar-toggler {
    padding: 8px !important;
    border: 2px solid rgba(0, 123, 255, 0.3) !important;
    border-radius: 8px;
    min-width: 44px !important;
    min-height: 44px !important;
    background: rgba(0, 123, 255, 0.1) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1040;
    flex-shrink: 0;
    margin-left: auto;
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3) !important;
    outline: none !important;
    border-color: var(--primary) !important;
  }
  
  .navbar-toggler:active {
    transform: scale(0.95);
    background: rgba(0, 123, 255, 0.2) !important;
  }
  
  /* Icône du toggle CORRIGÉE */
  .navbar-toggler-icon {
    width: 24px !important;
    height: 18px !important;
    background-image: none !important;
    position: relative;
    display: block !important;
  }
  
  .navbar-toggler-icon,
  .navbar-toggler-icon::before,
  .navbar-toggler-icon::after {
    display: block !important;
    height: 3px;
    background-color: var(--primary) !important;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .navbar-toggler-icon::before,
  .navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    left: 0;
  }
  
  .navbar-toggler-icon::before {
    top: -7px;
  }
  
  .navbar-toggler-icon::after {
    top: 7px;
  }
  
  /* Animation du burger vers X */
  .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-color: transparent !important;
  }
  
  .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    top: 0;
    transform: rotate(45deg);
    background-color: var(--primary) !important;
  }
  
  .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    top: 0;
    transform: rotate(-45deg);
    background-color: var(--primary) !important;
  }
  
  /* Theme toggle mobile repositionné */
  #theme-toggle {
    width: 44px !important;
    height: 44px !important;
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
    flex-shrink: 0;
    border: 2px solid rgba(0, 123, 255, 0.3) !important;
    background: rgba(0, 123, 255, 0.1) !important;
  }
  
  #theme-toggle:active {
    transform: scale(0.9);
  }
  
  #theme-toggle:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3) !important;
  }
  
  /* Collapse menu CORRIGÉ */
  .navbar-collapse {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    max-height: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    z-index: 1030;
  }
  
  .navbar-collapse.show {
    max-height: 500px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
  
  .navbar-collapse.collapsing {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  
  /* Navigation mobile avec espacement optimal */
  .navbar-nav {
    padding: 1.5rem 0 1rem !important;
    width: 100% !important;
    margin: 0 !important;
  }
  
  .nav-item {
    margin: 0 !important;
    width: 100% !important;
  }
  
  .nav-link {
    padding: 16px 24px !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    color: var(--text-color) !important;
  }
  
  .nav-link::before,
  .nav-link::after {
    display: none !important;
  }
  
  .nav-link:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05)) !important;
    transform: translateX(8px) !important;
    color: var(--primary) !important;
    padding-left: 32px !important;
  }
  
  .nav-link:active {
    background: rgba(0, 123, 255, 0.1) !important;
    transform: scale(0.98) !important;
  }
  
  /* Animation en cascade pour les liens */
  .navbar-collapse.show .nav-link {
    animation: slideInUp 0.4s ease-out both;
  }
  
  .navbar-collapse.show .nav-item:nth-child(1) .nav-link { animation-delay: 0.1s; }
  .navbar-collapse.show .nav-item:nth-child(2) .nav-link { animation-delay: 0.15s; }
  .navbar-collapse.show .nav-item:nth-child(3) .nav-link { animation-delay: 0.2s; }
  .navbar-collapse.show .nav-item:nth-child(4) .nav-link { animation-delay: 0.25s; }
  .navbar-collapse.show .nav-item:nth-child(5) .nav-link { animation-delay: 0.3s; }
  .navbar-collapse.show .nav-item:nth-child(6) .nav-link { animation-delay: 0.35s; }
  .navbar-collapse.show .nav-item:nth-child(7) .nav-link { animation-delay: 0.4s; }
  .navbar-collapse.show .nav-item:nth-child(8) .nav-link { animation-delay: 0.45s; }
  
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Mode sombre pour navigation mobile */
@media (max-width: 991.98px) {
  body.dark-mode .navbar {
    background: rgba(20, 20, 20, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  body.dark-mode .navbar-collapse {
    background: rgba(20, 20, 20, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
  }
  
  body.dark-mode .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
  }
  
  body.dark-mode .navbar-toggler-icon,
  body.dark-mode .navbar-toggler-icon::before,
  body.dark-mode .navbar-toggler-icon::after {
    background-color: #ffffff !important;
  }
  
  body.dark-mode .nav-link {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    color: #eee !important;
  }
  
  body.dark-mode .nav-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)) !important;
    color: #ffffff !important;
  }
  
  body.dark-mode #theme-toggle {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
  }
}

/* Optimisations tactiles pour mobile */
@media (max-width: 991.98px) {
  /* Boutons avec zones tactiles agrandies */
  .btn, button, .filter-btn {
    min-height: 44px !important;
    padding: 12px 20px !important;
    font-size: 1rem !important;
    border-radius: 25px !important;
    touch-action: manipulation;
  }
  
  .btn:active, button:active, .filter-btn:active {
    transform: scale(0.96);
  }
  
  /* Formulaires mobiles améliorés */
  .form-control, .form-select {
    min-height: 44px !important;
    font-size: 16px !important; /* Évite le zoom sur iOS */
    border-radius: 12px !important;
  }
  
  /* Timeline mobile responsive */
  .timeline::after {
    left: 20px;
  }
  
  .timeline-item {
    width: calc(100% - 60px);
    margin-left: 60px;
    margin-bottom: 2rem;
  }
  
  .timeline-item.right {
    left: 0 !important;
  }
  
  .timeline-item::before {
    left: -35px !important;
    right: auto !important;
  }
  
  /* Projets mobile optimisés */
  .project-filters {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
  }
  
  .filter-btn {
    margin: 0.5rem 0.25rem;
    padding: 10px 16px;
    font-size: 0.95rem;
    white-space: nowrap;
  }
  
  .project-image {
    height: 180px;
  }
  
  .project-icon {
    font-size: 2.5rem;
  }
  
  /* Cards mobiles optimisées */
  .card, .skills-card, .project-card {
    margin-bottom: 1.5rem;
    border-radius: 15px;
  }
  
  /* Hero section mobile */
  .hero {
    padding: 140px 0 80px;
    min-height: calc(100vh - 70px);
  }
  
  .hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero p, .hero .typed-text {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-actions .btn {
    min-width: 200px;
    margin: 0.5rem;
    font-size: 1.1rem;
    padding: 14px 24px;
  }
  
  /* Sections avec espacement adapté */
  section {
    padding: 60px 0;
  }
  
  .section-heading {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  /* Stats mobiles */
  .stat-item {
    margin-bottom: 1.5rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
}

/* Très petits écrans (smartphones en portrait) */
@media (max-width: 576px) {
  .navbar {
    min-height: 60px !important;
    padding: 0.4rem 0 !important;
  }
  
  .navbar .container {
    padding: 0 0.75rem !important;
  }
  
  .navbar-brand {
    font-size: 1rem !important;
    padding: 6px 10px !important;
    max-width: calc(100vw - 120px) !important;
  }
  
  .navbar-toggler {
    min-width: 40px !important;
    min-height: 40px !important;
  }
  
  #theme-toggle {
    width: 40px !important;
    height: 40px !important;
  }
  
  /* Hero section très petits écrans */
  .hero {
    padding: 120px 0 60px;
    min-height: calc(100vh - 60px);
  }
  
  .hero h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }
  
  .hero p, .hero .typed-text {
    font-size: 1.2rem;
  }
  
  .hero-actions .btn {
    display: block;
    width: 90%;
    margin: 0.75rem auto;
    font-size: 1rem;
    padding: 12px 20px;
  }
  
  /* Sections avec espacement réduit */
  section {
    padding: 50px 0;
  }
  
  .section-heading {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
  
  /* Projets très petits écrans */
  .filter-btn {
    font-size: 0.9rem;
    padding: 8px 12px;
    margin: 0.25rem;
  }
  
  .project-tools .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    margin: 2px;
  }
  
  /* Formulaires très petits écrans */
  .form-control {
    font-size: 16px; /* Important pour éviter le zoom iOS */
    padding: 10px 14px;
  }
  
  /* Contact mobile */
  .contact-info-card,
  .contact-form-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
  }
}

/* Gestion de l'orientation portrait/paysage */
@media (max-width: 991.98px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 100px 0 50px;
  }
  
  .navbar {
    min-height: 60px;
    padding: 0.3rem 0;
  }
  
  .navbar-toggler,
  #theme-toggle {
    min-width: 40px !important;
    min-height: 40px !important;
  }
}

/* Back to top mobile simplifié */
@media (max-width: 991.98px) {
  #back-to-top {
    bottom: 20px;
    right: 15px;
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
    border-radius: 50%;
  }
  
  #back-to-top:active {
    transform: scale(0.9);
  }
}

/* Optimisations performance mobile */
@media (max-width: 991.98px) {
  /* Simplifier les gradients */
  .hero {
    background: linear-gradient(135deg, var(--primary), var(--info));
  }
  
  .hero::before {
    display: none; /* Désactiver l'animation de gradient pour économiser les ressources */
  }
  
  /* Simplifier les ombres */
  .card, .skills-card, .project-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  }
  
  .card:hover, .skills-card:hover, .project-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important;
  }
  
  /* CORRECTION : Éliminer les rectangles supplémentaires dans les cartes de projets */
  .project-card .card-img-top {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
  }
  
  .project-image {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
  }
  
  .project-image::before,
  .project-image::after {
    display: none !important;
  }
  
  /* Correction de la superposition des éléments dans les cartes */
  .project-overlay {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  /* Optimisation des badges dans les projets */
  .project-tools {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .project-tools .badge {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }
  
  /* Nettoyage des pseudo-éléments inutiles */
  .project-card::before,
  .project-card::after,
  .card::before,
  .card::after {
    display: none !important;
  }
  
  /* Optimisations des transitions mobile */
  * {
    transition-duration: 0.2s !important;
  }
  
  /* Réduction de l'impact des transforms */
  .project-card:hover {
    transform: translateY(-2px) !important;
  }
  
  .btn:hover {
    transform: none !important;
  }
  
  /* Désactiver les animations complexes sur mobile */
  .animate-bounce,
  .profile-img:hover,
  .skills-card:hover .skills-icon {
    animation: none;
    transform: none;
  }
  
  /* Amélioration de la lisibilité mobile */
  .project-card .card-title {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
  }
  
  .project-card .card-text {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
  }
  
  .project-features ul li {
    font-size: 0.9rem !important;
    padding: 0.25rem 0 !important;
  }
  
  /* Optimisation des espacements mobile */
  .card-body {
    padding: 1.25rem !important;
  }
  
  .card-footer {
    padding: 0.75rem 1.25rem !important;
  }
  
  /* Amélioration des filtres de projet mobile */
  .project-filters {
    margin-bottom: 1.5rem !important;
    padding: 0 0.5rem !important;
  }
  
  .filter-btn {
    font-size: 0.9rem !important;
    padding: 8px 14px !important;
    margin: 0.25rem !important;
    white-space: nowrap !important;
  }
  
  /* Optimisation des formulaires mobile */
  .form-floating > label {
    font-size: 0.9rem !important;
  }
  
  .form-control:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
  }
  
  /* Contact mobile optimisé */
  .contact-item {
    margin-bottom: 1.5rem !important;
  }
  
  .contact-icon {
    min-width: 50px !important;
    width: 50px !important;
    height: 50px !important;
  }
  
  /* Amélioration de la timeline mobile */
  .timeline-item {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .timeline-item h4 {
    font-size: 1rem !important;
  }
  
  .timeline-item h5 {
    font-size: 1.1rem !important;
  }
  
  /* Correction des logos d'entreprise */
  .company-logo {
    width: 60px !important;
    height: 60px !important;
    margin-bottom: 1rem !important;
  }
  
  .company-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
}

/* Mode sombre mobile corrigé */
@media (max-width: 991.98px) {
  body.dark-mode .navbar-collapse {
    background: rgba(20, 20, 20, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
  }
}

/* Corrections spécifiques pour Safari iOS */
@supports (-webkit-touch-callout: none) {
  .navbar {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  
  .navbar-collapse {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  
  /* Fix pour le viewport iOS */
  .hero {
    min-height: -webkit-fill-available;
  }
}

/* Optimisations pour Android */
@media (max-width: 991.98px) {
  .form-control:focus {
    transform: none; /* Évite les problèmes de clavier Android */
  }
  
  /* Améliorer les performances de scroll */
  .navbar,
  .navbar-collapse,
  .card {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
  }
}

/* ===== STYLES SPÉCIFIQUES POUR LES PAGES LÉGALES ===== */

/* Pages légales - Mode clair */
.legal-content {
  line-height: 1.8;
}

.legal-content h2 {
  color: var(--primary);
  border-bottom: 2px solid rgba(0, 123, 255, 0.2);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.legal-content h3 {
  color: var(--primary-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content ul {
  margin-bottom: 1.5rem;
}

.legal-content ul li {
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.legal-content a:hover {
  color: var(--primary-dark);
}

/* Pages légales - Mode sombre - RÈGLES RENFORCÉES */
body.dark-mode .legal-content {
  color: #e0e0e0 !important;
}

body.dark-mode .legal-content h1,
body.dark-mode .legal-content h2,
body.dark-mode .legal-content h3,
body.dark-mode .legal-content h4,
body.dark-mode .legal-content h5,
body.dark-mode .legal-content h6 {
  color: #fff !important;
}

body.dark-mode .section-heading {
  color: #fff !important;
}

body.dark-mode .legal-content h2 {
  color: var(--primary) !important;
  border-bottom-color: rgba(0, 123, 255, 0.3);
}

body.dark-mode .legal-content h3 {
  color: #ccc !important;
}

body.dark-mode .legal-content p {
  color: #e0e0e0 !important;
}

body.dark-mode .legal-content ul li {
  color: #e0e0e0 !important;
}

body.dark-mode .legal-content strong {
  color: #fff !important;
}

body.dark-mode .legal-content a {
  color: var(--primary) !important;
}

body.dark-mode .legal-content a:hover {
  color: #66b3ff !important;
}

/* Règles générales pour toutes les cartes en mode sombre */
body.dark-mode .card h1,
body.dark-mode .card h2,
body.dark-mode .card h3,
body.dark-mode .card h4,
body.dark-mode .card h5,
body.dark-mode .card h6 {
  color: #fff !important;
}

body.dark-mode .card p {
  color: #e0e0e0 !important;
}

body.dark-mode .card ul li {
  color: #e0e0e0 !important;
}

body.dark-mode .card strong {
  color: #fff !important;
}

/* Sections bg-light en mode sombre */
body.dark-mode .bg-light {
  background-color: #1a1a1a !important;
}

body.dark-mode section.bg-light {
  background-color: #1a1a1a !important;
}

/* Cartes des pages légales en mode sombre - SELECTORS PLUS SPECIFIQUES */
body.dark-mode .card {
  background-color: #2d2d2d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .card.border-0 {
  background-color: #2d2d2d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .card .card-body {
  background-color: #2d2d2d !important;
  color: #e0e0e0 !important;
}

body.dark-mode .card.border-0 .card-body {
  background-color: #2d2d2d !important;
  color: #e0e0e0 !important;
}

body.dark-mode .card-body.p-5 {
  background-color: #2d2d2d !important;
  color: #e0e0e0 !important;
}

/* Alertes en mode sombre */
body.dark-mode .alert-info {
  background-color: rgba(0, 123, 255, 0.1) !important;
  border-color: rgba(0, 123, 255, 0.3) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .alert-info i {
  color: var(--primary) !important;
}

/* Text-muted en mode sombre */
body.dark-mode .text-muted {
  color: #aaa !important;
}

body.dark-mode .text-muted small {
  color: #aaa !important;
}

/* Adaptation de la section Cookies en mode sombre */
body.dark-mode .legal-content .alert-warning {
  background-color: rgba(255, 193, 7, 0.1) !important;
  border-color: rgba(255, 193, 7, 0.3) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .legal-content .alert-light {
  background-color: rgba(248, 249, 250, 0.1) !important;
  border-color: rgba(248, 249, 250, 0.3) !important;
  color: #e0e0e0 !important;
}

body.dark-mode .legal-content .alert-light h6,
body.dark-mode .legal-content .alert-light p,
body.dark-mode .legal-content .alert-light li {
  color: #e0e0e0 !important;
}

/* Styles des tableaux dans la section Cookies en mode sombre */
body.dark-mode .legal-content .table {
  color: #e0e0e0 !important;
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .legal-content .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .legal-content .table-striped tbody tr:nth-of-type(even) {
  background-color: transparent !important;
}

body.dark-mode .legal-content .table th,
body.dark-mode .legal-content .table td {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before,
body.dark-mode .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
  background: linear-gradient(90deg, #ff6b6b, #ee5a52);
  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
}

body.dark-mode .nav-link {
  color: #eee !important;
}

body.dark-mode .nav-link:hover {
  color: var(--primary) !important;
}

body.dark-mode .navbar-brand {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .navbar-brand i {
  color: var(--primary);
}

body.dark-mode #theme-toggle {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode #theme-toggle i {
  color: var(--primary);
}

/* ===== OVERRIDE: NAVBAR MOBILE CUSTOM ===== */
@media (max-width: 991.98px) {
  /* Fond plus opaque */
  .navbar {
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }
  /* Bouton toggle redesign */
  .navbar-toggler {
    background: var(--primary) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
  }
  /* Barres du toggle en blanc simple */
  .navbar-toggler-icon,
  .navbar-toggler-icon::before,
  .navbar-toggler-icon::after {
    background-color: #ffffff !important;
  }
}

