/* 
  Custom styles for Yassine Haba's Portfolio
  Created: 2025
*/

/* Variables globales pour les tailles d'écran */
:root {
  --max-content-width: 1600px;
  --header-width: 300px;
  --font-size-base: 1rem;
  --spacing-unit: 1rem;
}

/* Styles de base responsifs */
body {
  font-size: var(--font-size-base);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Container principal */
.container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
}

/* Header responsive */
#header {
  width: var(--header-width);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 9997;
  transition: all 0.5s;
  background: #040b14;
  padding: 20px;
}

/* Contenu principal */
#main {
  margin-left: var(--header-width);
  transition: all 0.5s;
}

/* Media Queries pour différents écrans */

/* Très grands écrans (4K, vidéoprojecteurs) */
@media (min-width: 2560px) {
  :root {
    --max-content-width: 2000px;
    --font-size-base: 1.2rem;
    --spacing-unit: 1.5rem;
  }
  
  .container {
    padding: 0 30px;
  }
  
  .section-title h2 {
    font-size: 2.5rem;
  }
  
  .portfolio-item {
    margin-bottom: 40px;
  }
}

/* Grands écrans (Full HD et plus) */
@media (min-width: 1920px) and (max-width: 2559px) {
  :root {
    --max-content-width: 1800px;
    --font-size-base: 1.1rem;
  }
}

/* Écrans moyens (Laptops) */
@media (min-width: 1366px) and (max-width: 1919px) {
  :root {
    --max-content-width: 1400px;
    --font-size-base: 1rem;
  }
}

/* Tablettes et petits écrans */
@media (max-width: 1199px) {
  :root {
    --header-width: 250px;
  }
  
  #header {
    width: var(--header-width);
  }
  
  #main {
    margin-left: var(--header-width);
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
}

/* Tablettes */
@media (max-width: 991px) {
  .container {
    padding: 0 20px;
  }
  
  .section-title h2 {
    font-size: 1.8rem;
  }
  
  .portfolio-item {
    margin-bottom: 30px;
  }
}

/* Mobiles */
@media (max-width: 768px) {
  :root {
    --header-width: 100%;
  }
  
  #header {
    position: fixed;
    height: auto;
    padding: 15px 10px;
    z-index: 9999;
  }
  
  #header .profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 50px;
  }
  
  #header .profile img {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin: 0;
    object-fit: cover;
    aspect-ratio: 1/1;
  }
  
  #header .profile h1 {
    font-size: 18px;
    margin: 0;
    text-align: left;
  }
  
  .mobile-nav-toggle {
    position: fixed;
    right: 15px;
    top: 15px;
    z-index: 9999;
    border: 0;
    background: none;
    font-size: 24px;
    transition: all 0.4s;
    outline: none;
    background-color: rgba(5, 99, 187, 0.9);
    color: #fff;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border-radius: 50px;
    cursor: pointer;
  }
  
  .mobile-nav-active {
    overflow: hidden;
  }
  
  .mobile-nav-active #header {
    height: 100vh;
    overflow-y: auto;
  }
  
  .theme-lang-buttons {
    position: absolute;
    top: 15px;
    right: 65px;
    margin: 0;
  }
  
  .btn-theme, .btn-lang {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  
  .btn-lang {
    width: auto;
    padding: 0 8px;
    font-size: 12px;
  }
  
  #main {
    margin-top: 70px !important;
    padding: 15px;
  }
}

/* Très petits mobiles */
@media (max-width: 480px) {
  :root {
    --font-size-base: 0.9rem;
    --spacing-unit: 0.8rem;
  }
  
  .container {
    padding: 0 10px;
  }
  
  .section-title h2 {
    font-size: 1.3rem;
  }
}

/* Optimisation pour le tactile */
@media (hover: none) {
  .portfolio-item:hover {
    transform: none;
  }
  
  .nav-menu a:hover {
    background: none;
  }
  
  .social-links a:hover {
    transform: none;
  }
}

/* Ajustements pour les tableaux numériques */
@media (pointer: coarse) {
  .nav-menu a {
    padding: 15px;
    min-height: 50px;
  }
  
  .social-links a {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .btn {
    padding: 12px 24px;
    min-height: 50px;
  }
}

/* Optimisation des images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Grille responsive */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.col-lg-6, .col-md-6, .col-sm-12 {
  padding: 0 15px;
  width: 100%;
}

@media (min-width: 768px) {
  .col-sm-12 {
    width: 100%;
  }
}

@media (min-width: 992px) {
  .col-md-6 {
    width: 50%;
  }
}

@media (min-width: 1200px) {
  .col-lg-6 {
    width: 50%;
  }
}

/* Ajustements des animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Styles pour la grille de portfolio */
.portfolio-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.portfolio-item {
  width: calc(33.333% - 10px);
  position: relative;
  overflow: hidden;
  box-shadow: none;
  transition: transform 0.3s ease;
  border-radius: 0;
  flex-shrink: 0;
  margin-bottom: 15px;
}

.portfolio-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  border: none;
  margin: 0;
  padding: 0;
}

.portfolio-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border: none;
}

.portfolio-item:hover .portfolio-wrap img {
  transform: scale(1.15);
}

.portfolio-info {
  background-color: #fff;
  padding: 15px;
  border-radius: 0 0 15px 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
  transform: none;
}

.portfolio-info h4 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.portfolio-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 12px;
  margin-top: 3px;
  display: inline-block;
}

/* Styles pour la grille des actualités technologiques */
.actualites {
  padding: 30px 0;
  background-color: #f8f9fa;
}

.actualites-slider {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
}

.swiper-wrapper {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
}

.swiper-slide {
  width: calc(33.333% - 20px);
  flex: 0 0 auto;
}

.actualite-item {
  text-align: center;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
}
  
.actualite-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.actualite-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 20px;
  box-shadow: 0 0 0 5px rgba(5, 99, 187, 0.1);
  transition: all 0.3s ease;
}
  
.actualite-item:hover .actualite-img {
  box-shadow: 0 0 0 10px rgba(5, 99, 187, 0.2);
}

.actualite-item h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 10px 0;
  color: #0563bb;
}

.actualite-item h4 {
  font-size: 16px;
  color: #333;
  margin-bottom: 15px;
  font-weight: 600;
}

.actualite-item p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

/* Responsive pour les actualités */
@media (max-width: 991px) {
  .actualites-slider {
    flex-wrap: wrap;
  }
  
  .swiper-slide {
    width: calc(50% - 15px);
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  .swiper-slide {
    width: 100%;
  }
}

/* Amélioration des sections */
.section-title h2 {
  position: relative;
  padding-bottom: 15px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  display: block;
  width: 50px;
  height: 3px;
  background: #0563bb;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

/* Animation du chargement plus fluide */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

[data-aos="fade-up"] {
  animation: fadeInUp 0.6s ease forwards;
}

/* Amélioration des barres de compétences */
.progress-bar {
  background-color: #0563bb;
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from { background-position: 1rem 0; }
  to { background-position: 0 0; }
}

/* Amélioration du bouton de retour en haut */
.back-to-top {
  background: #0563bb;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  transition: all 0.4s;
}

.back-to-top:hover {
  background: #0678e3;
  transform: scale(1.1);
}

/* Amélioration du formulaire de contact */
.php-email-form input,
.php-email-form textarea {
  border-radius: 5px;
  box-shadow: none;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 1px solid #ddd;
}

.php-email-form input:focus,
.php-email-form textarea:focus {
  border-color: #0563bb;
  box-shadow: 0 0 0 0.2rem rgba(5, 99, 187, 0.25);
}

.php-email-form button[type="submit"] {
  background: #0563bb;
  border: 0;
  padding: 10px 24px;
  color: #fff;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.php-email-form button[type="submit"]:hover {
  background: #0678e3;
  transform: translateY(-2px);
}

/* Améliorations pour les appareils mobiles */
@media (max-width: 768px) {
  .portfolio-info {
    margin-top: -40px;
    padding: 10px;
  }
  
  .portfolio-info h4 {
    font-size: 16px;
  }
  
  .portfolio-info p {
    font-size: 12px;
  }
}

/* Amélioration du curseur personnalisé pour mobile */
@media (max-width: 991px) {
  .custom-cursor, .custom-cursor-dot {
    display: none;
  }
  
  body {
    cursor: auto !important;
  }
  
  a:hover, button:hover {
    cursor: pointer !important;
  }
}

/* Styles pour les animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Animation décalée pour créer un effet cascade */
.portfolio-item:nth-child(2n) {
  transition-delay: 0.2s;
}

.portfolio-item:nth-child(3n) {
  transition-delay: 0.4s;
}

/* Animation des skills */
.progress {
  overflow: visible;
}

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

.progress .progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 8px;
  border-color: transparent transparent transparent #0563bb;
}

/* Améliorations de la section Contact */
.info {
  background: white;
  box-shadow: 0 0 24px rgba(5, 99, 187, 0.1);
  padding: 30px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.info:hover {
  box-shadow: 0 0 30px rgba(5, 99, 187, 0.2);
  transform: translateY(-5px);
}

.info .address, .info .email, .info .phone {
  margin-bottom: 20px;
}

.info i {
  font-size: 24px;
  color: #0563bb;
  float: left;
  width: 44px;
  height: 44px;
  background: #e7f3ff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.info h4 {
  padding: 0 0 0 60px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
}

.info p {
  padding: 0 0 0 60px;
  margin-bottom: 0;
  font-size: 14px;
  color: #555;
}

.info i:hover {
  background: #0563bb;
  color: white;
}

/* Animation des certifications */
.certification-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.certification-item.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Animation décalée pour créer un effet cascade */
.certification-item:nth-child(2n) {
  transition-delay: 0.05s;
}

.certification-item:nth-child(3n) {
  transition-delay: 0.1s;
}

/* Styles pour les favicons */
.portfolio-info img {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.portfolio-info img:hover {
  transform: scale(1.2);
}

/* Suppression des liens de zoom et plus */
.portfolio-links {
  display: none;
}

/* Ajustement du profil */
.profile {
  margin-top: 20px;
  text-align: center;
}

.profile img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 8px solid #2c2f3f;
  margin: 0 auto;
  display: block;
  transition: all 0.3s ease;
  object-fit: cover;
  aspect-ratio: 1/1;
}

.profile img:hover {
  transform: scale(1.05);
  border-color: #0563bb;
}

.profile h1 {
  font-size: 24px;
  margin: 15px 0 0 0;
  color: #fff;
}

.profile .social-links {
  margin-top: 15px;
}

.profile .social-links a {
  font-size: 18px;
  display: inline-block;
  background: #212431;
  color: #fff;
  line-height: 1;
  padding: 8px 0;
  margin-right: 4px;
  border-radius: 50%;
  text-align: center;
  width: 36px;
  height: 36px;
  transition: 0.3s;
}

.profile .social-links a:hover {
  background: #0563bb;
  color: #fff;
}

/* Ajustement des icônes de navigation */
.nav-menu a {
  padding: 8px 10px; /* Restauré le padding */
  font-size: 14px; /* Restauré la taille de la police */
}

.nav-menu i {
  font-size: 16px; /* Restauré la taille des icônes */
  margin-right: 8px; /* Restauré la marge */
}

/* Ajustement du contenu principal */
#main {
  margin-left: 300px; /* Restauré à 300px */
}

/* Ajustement pour les écrans mobiles */
@media (max-width: 1199px) {
  #header {
    width: 300px;
  }
  #main {
    margin-left: 0; /* Assure que le contenu prend toute la largeur quand le menu est replié */
  }
}

@media (max-width: 768px) {
  /* Laisse le comportement mobile d'origine du template (menu latéral replié) */
  #header {
    width: 300px; /* largeur du menu latéral */
    height: 100vh;
  }
  #main {
    margin-left: 0;
  }
}

/* Styles pour la grille de compétences */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  padding: 20px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
}

.skill-item:hover {
  transform: scale(1.1);
}

.skill-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: grayscale(0%);
  transition: all 0.3s ease;
}

.skill-item:hover img {
  filter: grayscale(0%);
}

.skill-item span {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Responsive pour la grille de compétences */
@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
  }

  .skill-item img {
    width: 60px;
    height: 60px;
  }

  .skill-item span {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
  }

  .skill-item img {
    width: 50px;
    height: 50px;
  }
}

/*--------------------------------------------------------------
# Portfolio / Projets
--------------------------------------------------------------*/
.portfolio {
  padding: 60px 0;
  background-color: #f8f9fa;
}

.portfolio .section-title h2 {
  font-size: 32px;
  font-weight: 700;
  color: #3a0063;
  position: relative;
  margin-bottom: 30px;
}

.portfolio .section-title h2::after {
  content: "";
  position: absolute;
  display: block;
  width: 50px;
  height: 3px;
  background: #00bcd4;
  bottom: -10px;
  left: 0;
}

.portfolio .section-title p {
  margin: 15px 0 0 0;
  color: #555;
  font-size: 16px;
}

.portfolio #portfolio-flters {
  padding: 0;
  margin: 0 auto 35px auto;
  list-style: none;
  text-align: center;
  background: #fff;
  border-radius: 50px;
  padding: 5px 20px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.portfolio #portfolio-flters li {
  cursor: pointer;
  display: inline-block;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  color: #272829;
  margin: 5px 5px;
  transition: all 0.3s ease-in-out;
  border-radius: 50px;
}

.portfolio #portfolio-flters li:hover,
.portfolio #portfolio-flters li.filter-active {
  color: #fff;
  background: #00bcd4;
}

.portfolio-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-radius: 0;
}

.portfolio-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.portfolio-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.portfolio-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-wrap img {
  transform: scale(1.15);
}

.portfolio-info {
  position: absolute;
  bottom: -100%;
  left: 0;
  right: 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.75);
  transition: all 0.3s ease;
  text-align: center;
}

.portfolio-item:hover .portfolio-info {
  bottom: 0;
}

.portfolio-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.portfolio-info p {
  font-size: 14px;
  color: #ddd;
  margin-bottom: 10px;
}

.portfolio-info .d-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.portfolio-info img {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  border-radius: 4px;
  background-color: #007bff;
}

.badge.bg-primary {
  background-color: #007bff;
}

.badge.bg-success {
  background-color: #28a745;
}

.badge.bg-warning {
  background-color: #ffc107;
  color: #212529;
}

.me-2 {
  margin-right: 0.5rem;
}

/* Responsive portfolio */
@media (max-width: 991px) {
  .portfolio-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .portfolio-container {
    grid-template-columns: 1fr;
  }
  
  .portfolio #portfolio-flters li {
    padding: 8px 14px;
    margin: 3px;
  }
}

/*--------------------------------------------------------------
# Portfolio Details
--------------------------------------------------------------*/
.portfolio-details {
  padding: 40px 0;
}

.portfolio-details-slider {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.portfolio-details-slider img {
  width: 100%;
  height: auto;
}

.portfolio-details .portfolio-info {
  padding: 30px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  background-color: #fff;
  border-radius: 10px;
}

.portfolio-details .portfolio-info h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
  color: #3a0063;
}

.portfolio-details .portfolio-info ul {
  list-style: none;
  padding: 0;
  font-size: 15px;
  color: #555;
}

.portfolio-details .portfolio-info ul li {
  padding: 10px 0;
  display: flex;
  align-items: center;
}

.portfolio-details .portfolio-info ul li i {
  color: #00bcd4;
  font-size: 16px;
  margin-right: 10px;
}

.portfolio-details .portfolio-description {
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}

.portfolio-details .portfolio-description h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #3a0063;
}

.portfolio-details .portfolio-description p {
  padding: 0;
  line-height: 1.7;
  color: #555;
  margin-bottom: 15px;
}

/* Styles pour les boutons de thème et de langue */
.theme-lang-buttons {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 10px;
}

.btn-theme, .btn-lang {
  background: #212431;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-lang {
  border-radius: 18px;
  width: auto;
  padding: 0 10px;
  font-size: 14px;
}

.btn-theme:hover, .btn-lang:hover {
  background: #0563bb;
  transform: translateY(-2px);
}

.btn-theme i, .btn-lang i {
  line-height: 0;
}

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

body.dark-mode #main {
  background-color: #1e1e1e;
}

body.dark-mode .section-bg {
  background-color: #262626;
}

body.dark-mode .section-title h2 {
  color: #e0e0e0;
}

body.dark-mode .portfolio, 
body.dark-mode .actualites {
  background-color: #1e1e1e;
}

body.dark-mode .portfolio-item,
body.dark-mode .actualite-item {
  background-color: #2a2a2a;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

body.dark-mode .portfolio-info,
body.dark-mode .actualite-info {
  background-color: #2a2a2a;
}

body.dark-mode .portfolio-info h4,
body.dark-mode .portfolio-info p,
body.dark-mode .actualite-item h3,
body.dark-mode .actualite-item h4,
body.dark-mode .actualite-item p {
  color: #e0e0e0;
}

/* Pour les sections "Contact" et autres contenus avec fond blanc */
body.dark-mode .info,
body.dark-mode .php-email-form {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

body.dark-mode .info h4,
body.dark-mode .info p,
body.dark-mode .php-email-form label {
  color: #e0e0e0;
}

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

body.dark-mode .form-control:focus {
  border-color: #0563bb;
  background-color: #3a3a3a;
}

/* Adaptations pour le footer en mode sombre */
body.dark-mode #footer {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Mode sombre amélioré */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode #header {
  background: #1a1a1a;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

body.dark-mode .nav-menu a {
  color: #d4d4d4;
}

body.dark-mode .nav-menu a:hover, 
body.dark-mode .nav-menu .active > a, 
body.dark-mode .nav-menu li:hover > a {
  color: #fff;
  background: rgba(5, 99, 187, 0.8);
}

body.dark-mode .mobile-nav-toggle {
  background-color: rgba(5, 99, 187, 0.8);
  color: #fff;
}

body.dark-mode .section-title h2::after {
  background: #0563bb;
}

body.dark-mode .actualite-item {
  background-color: #2a2a2a;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .actualite-item h3 {
  color: #0678e3;
}

body.dark-mode .actualite-source {
  background: #1a3a59;
  color: #85c1ff;
}

body.dark-mode .skill-item span {
  color: #d4d4d4;
}

body.dark-mode #portfolio-flters {
  background: #2a2a2a;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode #portfolio-flters li {
  color: #d4d4d4;
}

body.dark-mode #portfolio-flters li:hover,
body.dark-mode #portfolio-flters li.filter-active {
  background: #0563bb;
}

body.dark-mode .back-to-top {
  background: #0563bb;
}

body.dark-mode .back-to-top:hover {
  background: #0678e3;
}

/* Améliorations responsive et mode sombre pour les actualités */
@media (max-width: 576px) {
  .actualites-slider {
    flex-direction: column;
    gap: 15px;
  }
  
  .swiper-slide {
    width: 100%;
  }
  
  .actualite-item {
    padding: 15px;
  }
  
  .actualite-img {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
  }
  
  .actualite-item h3 {
    font-size: 18px;
  }
  
  .actualite-item h4 {
    font-size: 14px;
  }
  
  .actualite-item p {
    font-size: 13px;
  }
}

/* Adaptation du formulaire de contact pour mobile */
@media (max-width: 576px) {
  .php-email-form {
    padding: 15px;
  }
  
  .info {
    padding: 15px;
  }
  
  .info .address, .info .email, .info .phone {
    margin-bottom: 15px;
  }
  
  .info i {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .info h4 {
    padding: 0 0 0 50px;
    font-size: 16px;
  }
  
  .info p {
    padding: 0 0 0 50px;
    font-size: 13px;
  }
}

.profile-image {
  width: 120px !important;
  height: 120px !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  aspect-ratio: 1/1 !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  border: 6px solid #2c2f3f !important;
  overflow: hidden;
}

@media (max-width: 768px) {
  .profile-image {
    width: 60px !important;
    height: 60px !important;
    border-width: 3px !important;
  }
} 

/* Correctifs responsives supplémentaires pour mobile/tablette */
@media (max-width: 1199px) {
  /* Cache le menu latéral hors écran tant que non ouvert */
  #header { left: -300px; }
  /* Quand le menu mobile est actif, on l'affiche (géré aussi par le CSS du template) */
  .mobile-nav-active #header { left: 0; }
}

@media (max-width: 768px) {
  /* Supprime le décalage vertical forcé pour éviter un gros espace en haut */
  #main { margin-top: 0 !important; }
}

/* =====================
   Optimisations Mobile
   ===================== */
@media (max-width: 768px) {
  html { font-size: 15px; }
  body { line-height: 1.6; }

  .section-title { padding-bottom: 20px; }
  .section-title h2 { font-size: clamp(1.25rem, 4vw, 1.5rem); margin-bottom: 10px; padding-bottom: 10px; }
  .section-title p { font-size: 0.95rem; }

  section { padding: 40px 0; }
  .container { padding: 0 12px; }

  /* Héros */
  #hero h1 { font-size: clamp(1.6rem, 7vw, 2rem); line-height: 1.2; }
  #hero p { font-size: clamp(1rem, 4.5vw, 1.2rem); margin-bottom: 24px; }

  /* À propos */
  .about .content h3 { font-size: 1.1rem; }
  .about .content ul li { margin-bottom: 12px; }

  /* Compétences */
  .skills .progress { height: 48px; }
  .skills .progress .skill { font-size: 0.9rem; }

  /* Portfolio */
  .portfolio .section-title p { font-size: 0.95rem; }
  .portfolio #portfolio-flters { padding: 5px 10px; }
  .portfolio #portfolio-flters li { padding: 8px 10px; font-size: 0.85rem; }
  .portfolio .portfolio-info { padding: 10px; }
  .portfolio .portfolio-info h4 { font-size: 0.95rem; }
  .portfolio .portfolio-info p { font-size: 0.8rem; }

  /* Veille / cartes */
  .actualite-item { padding: 16px; }
  .actualite-item h3 { font-size: 1rem; }
  .actualite-item h4 { font-size: 0.95rem; }
  .actualite-item p { font-size: 0.9rem; }

  /* Formulaire contact */
  .php-email-form { padding: 16px; }
}

/* Empêcher tout débordement horizontal et gérer les mots longs */
html, body { overflow-x: hidden; }
* { min-width: 0; }
:where(p, h1, h2, h3, h4, h5, h6, li, a, span, div) { word-break: break-word; overflow-wrap: anywhere; }

/* Carrousel Certifications responsive */
#certification .carousel .carousel-item img {
  width: 100% !important;
  max-width: 520px;
  height: auto;
}
@media (max-width: 768px) {
  #certification .carousel .carousel-item img {
    max-width: 90%;
  }
}

/* Amélioration de la grille Portfolio pour petits écrans (renforcer spacing) */
@media (max-width: 768px) {
  .portfolio-container { gap: 16px; padding: 0 10px; }
  .portfolio-wrap { height: 200px; }
}

/* Footer: éviter qu'il prenne l'écran et toujours bien s'empiler */
@media (max-width: 1199px) {
  #footer { position: static; width: 100%; }
}