/* Réinitialisation de base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables pour palette de couleurs et typographie */
:root {
  --primary-color: #3a86ff;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --dark-color: #2f2f2f;
  --light-color: #f8f9fa;
  --gray-color: #6c757d;
  --success-color: #06d6a0;
  --header-color: #09092d;
  --header-color-variant: #6576a3;
  
  --gradient-header: linear-gradient(135deg, #4158D0, #C850C0, #FFCC70);
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --transition-speed: 0.3s;
  --border-radius: 8px;
}

/* Style général du corps */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
  overflow-x: hidden;
}

/* En-tête */
header {
  background: var(--gradient-header);
  background-size: 200% 200%;
  animation: gradientAnimation 15s ease infinite;
  color: white;
  padding: 5rem 1rem;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  perspective: 1000px;
}

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

/* Animations et éléments pour l'en-tête */
header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 10%, transparent 70%);
  transform: rotate(30deg);
  pointer-events: none;
  animation: shimmer 15s infinite linear;
  z-index: 1;
}

/* Vagues animées */
header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="white" fill-opacity="1" d="M0,96L40,112C80,128,160,160,240,160C320,160,400,128,480,117.3C560,107,640,117,720,144C800,171,880,213,960,218.7C1040,224,1120,192,1200,186.7C1280,181,1360,203,1400,213.3L1440,224L1440,320L1400,320C1360,320,1280,320,1200,320C1120,320,1040,320,960,320C880,320,800,320,720,320C640,320,560,320,480,320C400,320,320,320,240,320C160,320,80,320,40,320L0,320Z"></path></svg>');
  background-size: cover;
  background-repeat: no-repeat;
  filter: drop-shadow(0px -5px 5px rgba(0,0,0,0.1));
  z-index: 2;
}

/* Effet de superposition en dégradé */
header .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.2) 100%);
  z-index: 1;
}

/* Particules animées */
@keyframes float {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.8; }
  25% { transform: translateY(-15px) rotate(5deg) scale(0.9); opacity: 0.6; }
  50% { transform: translateY(-25px) rotate(10deg) scale(0.8); opacity: 0.4; }
  75% { transform: translateY(-15px) rotate(5deg) scale(0.9); opacity: 0.6; }
  100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.8; }
}

@keyframes shimmer {
  0% { transform: rotate(30deg) translateY(0) scale(1); opacity: 0.5; }
  50% { transform: rotate(25deg) translateY(-15px) scale(1.05); opacity: 0.7; }
  100% { transform: rotate(30deg) translateY(0) scale(1); opacity: 0.5; }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  display: block;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 1;
  backdrop-filter: blur(1px);
  filter: blur(1px);
}

.particle.star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.4);
  filter: blur(0);
}

/* Animation des éléments du header */
header h1 {
  position: relative;
  z-index: 2;
  font-size: 3.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInDown 1s both, pulse 5s infinite ease-in-out 1s;
  letter-spacing: 1px;
  transform: translateZ(50px);
}

header h1::after {
  content: '';
  position: absolute;
  background: white;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  bottom: -10px;
  animation: expandWidth 1.5s ease forwards;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

header p {
  position: relative;
  z-index: 2;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 300;
  margin-top: 1.2rem;
  animation: fadeInUp 1s 0.5s both;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translateZ(30px);
}

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

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

@keyframes expandWidth {
  from { width: 0; }
  to { width: 100px; }
}

/* Styles du contenu du header */
.header-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin: 0 auto;
}

/* Effet de frappe au clavier */
.typing-text {
  display: inline-block;
  white-space: nowrap;
  border-right: none;
  font-family: var(--font-main);
  background: linear-gradient(to right, var(--header-color), var(--header-color-variant));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 1.6em;
  background-color: white;
  margin-left: 3px;
  animation: blink 1s step-end infinite;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  vertical-align: middle;
  position: relative;
  top: -2px;
}

@keyframes blink {
  from, to { opacity: 1; box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); }
  50% { opacity: 0; box-shadow: none; }
}

/* Navigation */
nav {
  background-color: var(--dark-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav ul {
  display: flex;
  justify-content: center;
  list-style-type: none;
  padding: 0;
}

nav ul li {
  position: relative;
}

nav ul li a {
  display: inline-block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

nav ul li::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: all var(--transition-speed) ease;
  transform: translateX(-50%);
}

nav ul li:hover::after {
  width: 80%;
}

nav ul li:hover a {
  color: var(--accent-color);
}

/* Styles pour les pages actives et scrolled navbar */
nav.scrolled {
  background-color: rgba(26, 26, 46, 0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 5px 10px;
  transition: all 0.3s ease;
}

nav ul li.active::after {
  width: 80%;
}

nav ul li.active a {
  color: var(--accent-color);
}

/* Contenu principal */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.main-content {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-speed);
}

/* Titres */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  color: var(--dark-color);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--accent-color);
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

/* Paragraphes */
p {
  margin-bottom: 1.5rem;
}

/* Liens */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--secondary-color);
}

/* Pied de page */
footer {
  background-color: #2d2d2d;
  color: var(--light-color);
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 3rem;
}

footer p {
  color: var(--dark-color);
  opacity: 0.8;
  margin-bottom: 0;
}

/* Styles pour la visualisation des compétences */
.skill-card {
  background-color: var(--light-color);
  padding: 1.2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.skill-bar {
  height: 6px;
  background-color: #e0e0e0;
  margin-top: 1rem;
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.lang-circle {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 10px auto;
}

.lang-circle-inner {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: white;
  border-radius: 8px;
  margin-right: 10px;
}

.experience-timeline {
  position: relative;
  padding-left: 30px;
  margin-left: 20px;
  border-left: 2px solid var(--primary-color);
}

.timeline-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  border-radius: 50%;
  left: -41px;
  top: 0;
}


/* Media queries pour le responsive */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  nav ul li {
    width: 100%;
    text-align: center;
  }
  
  nav ul li a {
    padding: 0.75rem 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
}

/* Animations et effets */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.main-content {
  animation: fadeIn 0.5s ease-in-out;
}

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

.section {
  animation: slideInUp 0.5s ease-out forwards;
}

/* Style pour les sections de contenu */
.section {
  margin-bottom: 3rem;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-speed);
}

.section:hover {
  transform: translateY(-5px);
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 6px rgba(58, 134, 255, 0.2);
}

.btn:hover {
  background-color: var(--secondary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 8px rgba(131, 56, 236, 0.3);
}

/* Style des formulaires */
input, textarea {
  transition: border-color var(--transition-speed);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.2);
}

/* Mode sombre */
.dark-theme {
  --light-color: #1a1a2e;
  --dark-color: #f8f9fa;
  --gray-color: #e0e0e0;
  background-color: #121212;
}

.dark-theme .main-content {
  background-color: #252525;
}

.dark-theme .section,
.dark-theme [style*="background-color: var(--light-color)"] {
  background-color: #2d2d2d !important;
  color: var(--dark-color);
}

.dark-theme p {
  color: #e0e0e0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* ===== PROJECTS SECTION STYLES ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: start;
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all var(--transition-speed) ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-header);
  transform: scaleX(0);
  transition: transform var(--transition-speed) ease;
  transform-origin: left;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.project-card-header {
  background: var(--gradient-header);
  background-size: 200% 200%;
  animation: gradientAnimation 15s ease infinite;
  color: white;
  padding: 1.5rem;
  text-align: center;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-card-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.project-card:hover .project-card-header::after {
  opacity: 1;
}

.project-card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  z-index: 1;
  position: relative;
}

.project-card-content {
  padding: 1.5rem;
}

.project-card-content h4 {
  color: var(--dark-color);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.project-card-content p {
  color: var(--gray-color);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.project-card-content p:last-of-type {
  margin-bottom: 1.25rem;
}

.project-card-content strong {
  color: var(--dark-color);
  font-weight: 600;
}

.project-card-content .btn {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-block;
  transition: all var(--transition-speed) ease;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-card-content .btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 134, 255, 0.3);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem;
}

span.tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Dark theme support for project cards */
.dark-theme .project-card {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dark-theme .project-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.dark-theme .project-card-content h4 {
  color: #e0e0e0;
}

.dark-theme .project-card-content p {
  color: #b0b0b0;
}

.dark-theme .project-card-content strong {
  color: #e0e0e0;
}

/* Responsive design for project cards */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
  }
  
  .project-card-header {
    padding: 1.25rem;
    min-height: 100px;
  }
  
  .project-card-header h3 {
    font-size: 1.1rem;
  }
  
  .project-card-content {
    padding: 1.25rem;
  }
  
  .project-card-content .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    padding: 0 0.5rem;
    gap: 1rem;
  }
  
  .project-card-content {
    padding: 1rem;
  }
}