/* Styles fusionnés de styles.css et mobile-menu.css */
/* Curseur personnalisé - désactivé pour améliorer les performances */
/* .custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.3s ease;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.custom-cursor.hover {
  transform: translate(-50%, -50%) scale(1.5);
  background-color: rgba(6, 182, 212, 0.1);
} */

/* Conteneur de particules */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Variables */
:root {
  --header-height: 4rem;
  --mobile-header-height: 3.5rem;
  --primary-color: #06b6d4;
  --bg-dark: #111827;
  --text-light: #f3f4f6;
}

/* Dark/Light theme variables */
:root[data-theme="light"] {
  --bg-primary: #ffffff;
  --text-primary: #1a1a1a;
  --bg-secondary: #f3f4f6;
  --text-secondary: #4b5563;
  --accent: #0891b2;
}

:root[data-theme="dark"] {
  --bg-primary: #111827;
  --text-primary: #f3f4f6;
  --bg-secondary: #1f2937;
  --text-secondary: #9ca3af;
  --accent: #06b6d4;
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #111827; /* Fond solide au lieu de transparent */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9000 !important; /* Valeur élevée pour s'assurer qu'elle est au-dessus des autres éléments */
}

/* Ensure dropdown menus appear above other elements */
.relative {
  position: relative;
  z-index: 1001;
}

/* Styles spécifiques pour le menu mobile */
@media (max-width: 768px) {
  #main-menu {
    background-color: #111827 !important;
  }
}

/* Responsive navigation adjustments */
@media (max-width: 768px) {
  /* Adjust navigation bar height and width on smaller screens */
  nav {
    height: var(--mobile-header-height);
    width: 100vw;
    padding: 0;
    background-color: #111827; /* Fond solide pour la barre de navigation */
  }

  /* Ensure container fits properly on mobile */
  nav .container {
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Mobile menu container */
  #mobile-menu {
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    width: 100vw;
    background: #111827; /* Fond solide pour le menu mobile */
    padding: 1rem;
    z-index: 999;
    transition: transform 0.3s ease-in-out;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateY(-100%); /* Initially hidden */
  }

  /* Mobile menu links */
  #mobile-menu a {
    display: block;
    width: 100%;
    padding: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: left;
    /* Add space between menu items for better tap usability */
    margin: 0.5rem 0;
  }

  /* Adjust padding and font size for skill cards on smaller screens */
  .skill-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
  }

  .skill-card i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
  }
  .skill-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }

  /* Adjust CTA button styles for smaller screens */
  .cta-button {
    width: 100%;
    padding: 1rem;
    margin: 0.5rem 0 !important;
    font-size: 1.1rem;
    min-width: auto;
  }
  section {
    padding: 2rem 1rem;
  }

  /* Adjust container padding and margin on smaller screens */
  .container {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    margin: 0;
    overflow-x: hidden;
  }

  /* Timeline adjustments for smaller screens */
  .timeline-container {
    width: 100%;
    padding: 0;
    margin-top: 1rem;
  }

  .timeline-item {
    width: 100%;
    padding-left: 60px;
    padding-right: 15px;
    margin: 1.5rem 0;
    position: relative;
  }

  /* Adjust spacing for buttons on smaller screens */
  .space-x-6 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin: 0;
    align-items: stretch; /* Make items take full width */
  }

  /* Skills grid adjustments for smaller screens */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    width: 100%;
  }

  /* Footer styles for mobile */
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    text-align: center;
  }

  footer .md\:text-left,
  footer .md\:text-right {
    text-align: center;
  }

  /* Ensure social media icons are properly centered and spaced */
  footer .flex.justify-center {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  /* Ensure all footer content is centered with proper spacing */
  footer > div > div {
    text-align: center;
    margin-bottom: 1.5rem;
  }

  /* Consistent spacing for footer sections */
  footer h3 {
    margin-bottom: 1rem;
  }

  /* Improve footer layout for services pages */
  footer .flex.flex-col.md\:flex-row {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  footer .flex.space-x-6 {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
  }
}

/* Typographie responsive */
h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

p {
  font-size: clamp(1rem, 4vw, 1.25rem);
  line-height: 1.6;
  color: rgba(243, 244, 246, 0.9);
  margin-bottom: 1rem;
}

/* Sections */
section {
  padding: 4rem 1.5rem;
  scroll-margin-top: var(--header-height);
}

/* Adjust section padding on medium-sized screens */
@media (min-width: 769px) and (max-width: 1024px) {
  section {
    padding: 2rem 1rem;
  }
}

/* Hero section */
#hero {
  min-height: calc(100vh - var(--mobile-header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Adjust padding top to accommodate mobile header height */
  padding-top: var(--mobile-header-height);
}

/* Adjust hero content width and padding */

.hero-content {
  width: 100%;
  max-width: 90%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Skill Cards 3D Effect */
.skill-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 1rem;
  transition: all 0.3s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: pointer;
}

.skill-card:hover {
  transform: translateY(-5px) rotateX(10deg) rotateY(10deg);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 30px rgba(6, 182, 212, 0.15);
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(6, 182, 212, 0.1),
    transparent
  );
  transition: all 0.3s ease;
  opacity: 0;
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card i {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.skill-card:hover i {
  transform: translateZ(20px);
  color: var(--primary-color);
}

.skill-card h3 {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.skill-card:hover h3 {
  transform: translateZ(15px);
}

/* Skill Bar Styles */
.skill-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
  position: relative;
  transform-style: preserve-3d;
}

/* Progress Bar Animation Enhancement */
.skill-progress {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    #0891b2,
    var(--primary-color)
  );
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), #0891b2);
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Timeline Styles */
.timeline-container {
  position: relative;
  padding: 2rem 0;
}

.timeline-container::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 100%;
  background: var(--primary-color);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin: 2rem 0;
  width: 50%;
  padding: 0 2rem;
  opacity: 1;
  transform: none;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(0);
  opacity: 1;
}

/* Mobile Timeline Styles */
@media (max-width: 768px) {
  .timeline-container::before {
    left: 30px; /* Move the timeline line to the left */
  }

  .timeline-item {
    width: 100%; /* Full width for all items */
    left: 0 !important; /* Override the left positioning */
    text-align: left !important; /* All text aligned left */
    padding-left: 60px; /* Space for the timeline line */
    padding-right: 15px; /* Reduced right padding */
    margin: 1.5rem 0; /* Reduced vertical margin */
  }

  .timeline-item::before {
    content: attr(data-year); /* Show the year */
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transform: translateY(-50%);
    white-space: nowrap;
  }

  .timeline-content {
    padding: 1.25rem; /* Slightly reduced padding */
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader {
  width: 50px;
  height: 50px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* CTA Buttons */
.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  /* Set minimum width for CTA buttons */
  min-width: 200px;
  backdrop-filter: blur(8px);
}

.space-x-6 {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

/* Additional Small Screen Adjustments */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  section {
    padding: 2rem 0.75rem;
  }

  nav .container {
    padding: 0 0.5rem;
  }

  .rounded-image {
    width: 120px;
    height: 120px;
  }

  /* Extra small screen timeline adjustments */
  .timeline-container::before {
    left: 20px; /* Move timeline line even more to the left */
  }

  .timeline-item {
    padding-left: 45px; /* Reduce left padding */
    padding-right: 10px; /* Reduce right padding */
  }

  .timeline-item::before {
    font-size: 0.7rem; /* Smaller font for year */
    padding: 0.2rem 0.4rem; /* Smaller padding */
  }

  .timeline-content {
    padding: 1rem; /* Further reduce padding */
  }

  .timeline-content h3 {
    font-size: 1.1rem; /* Smaller heading */
    margin-bottom: 0.5rem; /* Less margin */
  }

  .timeline-content p {
    font-size: 0.9rem; /* Smaller text */
    line-height: 1.4; /* Tighter line height */
  }
}

/* Styles pour le menu mobile */
@media (max-width: 768px) {
  #main-menu {
    position: fixed;
    top: var(--mobile-header-height);
    left: 0;
    right: 0;
    background-color: #111827 !important; /* Couleur solide au lieu de transparente */
    padding: 1.5rem 1rem; /* Padding horizontal et vertical */
    flex-direction: column;
    align-items: center; /* Centrer les éléments */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999 !important; /* Valeur plus élevée pour s'assurer qu'il est au-dessus des autres éléments */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4); /* Ombre plus prononcée */
    width: 100%;
    display: none; /* Caché par défaut, sera affiché via JavaScript */
    max-height: 80vh; /* Hauteur maximale pour éviter qu'il ne prenne tout l'écran */
    overflow-y: auto; /* Permettre le défilement si le menu est trop grand */
  }

  #main-menu a {
    width: calc(100% - 1rem); /* Largeur réduite pour ajouter des marges */
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
    margin: 0.5rem auto; /* Marge verticale et centrage horizontal */
    display: block;
    background-color: #1f2937; /* Fond solide pour les liens */
    transition: all 0.3s ease; /* Transition fluide */
    border: 1px solid transparent; /* Bordure transparente par défaut */
  }

  #main-menu a:hover {
    background-color: #111827;
    border-color: rgba(6, 182, 212, 0.5); /* Bordure cyan en survol */
    color: #06b6d4; /* Texte cyan en survol */
    transform: translateY(-2px); /* Léger effet de flottement */
  }

  /* Style pour le menu déroulant des langues en mobile */
  #main-menu .relative {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  #main-menu #lang-dropdown-btn {
    width: 100%;
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1f2937; /* Fond solide */
    margin: 0 auto;
  }

  #main-menu #lang-dropdown-menu {
    position: relative;
    width: 100%;
    margin: 0.5rem auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    background-color: #1f2937; /* Fond solide pour le menu déroulant */
    overflow: hidden; /* Pour que les coins arrondis s'appliquent aux enfants */
  }

  #main-menu #lang-dropdown-menu a {
    margin: 0; /* Supprimer les marges pour les liens du menu déroulant */
    width: 100%; /* Largeur complète */
    border-radius: 0; /* Pas de coins arrondis pour les liens du menu déroulant */
  }

  #mobile-menu-button {
    display: block !important;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    background-color: transparent;
  }

  #mobile-menu-button:hover {
    background-color: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
  }

  #mobile-menu-button i {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
  }

  #mobile-menu-button:hover i {
    transform: scale(1.1);
  }
}

/* Cache le bouton du menu sur desktop */
#mobile-menu-button {
  display: none;
}

/* Assurez-vous que le contenu principal est au-dessus des particules */
main,
header,
nav,
section,
footer {
  position: relative;
  z-index: 1;
}

/* Styles du menu mobile (fusionnés depuis mobile-menu.css) */
@media (max-width: 768px) {
  #main-menu {
    position: fixed;
    top: 3.5rem;
    left: 0;
    right: 0;
    background-color: #111827;
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }

  #main-menu a {
    width: calc(100% - 1rem);
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
    margin: 0.5rem auto;
    display: block;
    background-color: #1f2937;
    transition: all 0.3s ease;
    border: 1px solid transparent;
  }

  #main-menu a:hover {
    background-color: #111827;
    border-color: rgba(6, 182, 212, 0.5);
    color: #06b6d4;
    transform: translateY(-2px);
  }

  #main-menu .relative {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  #main-menu #lang-dropdown-btn {
    width: 100%;
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1f2937;
    margin: 0 auto;
  }

  #main-menu #lang-dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    background-color: #1f2937;
    overflow: hidden;
  }

  #main-menu #lang-dropdown-menu a {
    margin: 0;
    width: 100%;
    border-radius: 0;
  }
}
