/* ===== GLOBAL RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

/* ===== COLOR VARIABLES ===== */
:root {
  --accent: #5AC8FA;         /* Bleu clair */
  --accent-hover: #4A90E2;   /* Bleu hover */
  --background: #1A1A1A;     /* Fond sombre général */
  --dark-bg: #121212;        /* Fond légèrement plus clair pour sections */
  --light-bg: #FFFFFF;       /* Texte clair pour sections */
  --text: #FFFFFF;           /* Texte principal */
}

/* ===== BODY ===== */
body {
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  position: relative;
  /* padding-left: 2.5rem; */ /* Retiré pour alignement mobile */
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--accent-hover);
}

/* --- NEW MOBILE NAVBAR STYLES --- */

/* 1. Style the toggle button */
.nav-toggle {
    display: none; /* Hidden by default, shown in media query */
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001; /* Above other nav elements */
}

.nav-links.active {
    /* When 'active' class is applied, the menu is visible */
    transform: translateX(0) !important; /* Ajouté !important pour assurer l'écrasement sur mobile */
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 12% 5%;
  background: radial-gradient(circle at 75% 30%, var(--accent) 0%, transparent 30%);
}

.hero-content {
  flex: 1;
  padding-right: 5rem;
}

.hero-image {
  flex: 1;
  text-align: center;
}

.profile-img {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 50px var(--accent);
  animation: float 3s ease-in-out infinite;
  filter: grayscale(0.1) contrast(1.1);
}

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

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(45deg, var(--accent) 30%, var(--light-bg) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(45deg, var(--accent), var(--accent-hover));
  color: var(--text);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent);
}

/* ===== SKILLS SECTION ===== */
.skills {
  padding: 5rem 5%;
  background: var(--dark-bg);
  text-align: center;
}

.skills h2 {
  font-size: 2.5rem;
  color: var(--accent);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.skill-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 15px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--accent);
}

.skill-card i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ===== PROJECTS SECTION ===== */
.projects {
  padding: 5rem 5%;
  background: var(--background);
  text-align: center;
}

.projects h2 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 3rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--accent);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-card h3 {
  font-size: 1.4rem;
  color: var(--accent);
  margin: 15px 0 10px;
}

.project-card p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 20px;
  line-height: 1.6;
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 123, 255, 0.2);
}

.see-more {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.see-more:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===== PROJECT BUTTONS ===== */
.btn {
  display: block;
  margin: 20px auto 10px auto;
  width: 160px;
  text-align: center;
  padding: 10px 0;
  background: linear-gradient(135deg, #007BFF, #00C6FF);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.btn:hover {
  background: linear-gradient(135deg, #0056b3, #0096c7);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
  transform: scale(1.05);
}

/* ===== CERTIFICATES SECTION ===== */
.certificates {
  padding: 5rem 5%;
  background: var(--background);
  text-align: center;
}

.certificates h2 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 3rem;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem; 
  justify-items: center;
}

.certificate-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 350px;
}

.certificate-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--accent);
}

.certificate-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.certificate-card h3 {
  color: var(--accent);
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.certificate-card p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: 15px;
}

/* ===== CONTACT SECTION MODERN (Corrigé le nom de la section) ===== */
.contact {
  padding: 5rem 5%;
  background: var(--background);
  text-align: center;
}

.contact h2 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 2rem;
}

.contact-container {
  display: flex;
  gap: 4rem;
  flex-wrap: wrap;
  justify-content: center; /* Centré pour une meilleure apparence */
  align-items: flex-start;
  padding: 50px 0;
  background: linear-gradient(135deg, #1a1a1a, #111);
  border-radius: 25px;
}

.contact-info {
  flex: 1;
  min-width: 280px;
  text-align: left;
}

.contact-info h2 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.contact-info p {
  margin-bottom: 2rem;
  color: #ccc;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 1rem;
}

.info-item i {
  color: var(--accent);
  font-size: 1.5rem;
}

.contact-form {
  flex: 1;
  min-width: 280px;
}

.contact-form form {
  display: flex;
  flex-direction: column;
}

.contact-form label {
  font-weight: 700;
  margin-bottom: 15px;
 
 
}

.contact-form input,
.contact-form textarea {
  background: #000;
  color: #fff;
  border: 1px solid #333;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 10px;
  font-size: 1rem;
  resize: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #888;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
}

.btn-send {
  padding: 12px;
  background: var(--accent); /* Utilisé la couleur principale */
  color: var(--dark-bg);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-send:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}


/* ===== FOOTER ===== */
footer {
  background: var(--background);
  padding: 3rem 5%;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.social-links a {
  color: var(--text);
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* ===== RESPONSIVE MEDIA QUERIES (MOBILE FIRST) ===== */

@media (max-width: 768px) {
    /* 1. Mobile Navbar */
    .nav-toggle {
        display: block; /* Show the toggle button */
    }

    .navbar {
        flex-direction: row; /* Keep logo and button on same line */
        justify-content: space-between; /* Space between logo and button */
        padding: 1rem 5%; /* Smaller padding for mobile */
    }

    .nav-links {
        /* Position the menu off-screen to the right initially */
        position: absolute;
        top: 100%; /* Below the navbar */
        left: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        background: var(--dark-bg); /* Match section background */
        padding: 2rem 5%;
        gap: 1.5rem;
        text-align: center;
        transform: translateX(100%); /* Hides the menu off-screen */
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }
    
    .nav-links li {
        width: 100%;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a {
        display: block;
        font-size: 1.3rem;
    }
    
    .nav-links a::after {
        content: none; /* Remove hover line on mobile */
    }

    /* 2. Hero Section */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 20%; /* Plus de padding pour éviter la navbar */
    }

    .hero-content {
        padding-right: 0;
    }

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

    .profile-img {
        width: 280px;
        height: 280px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    /* 3. General Sections */
    .skills,
    .projects,
    .certificates,
    .contact {
        padding: 4rem 8%;
    }
    
    .certificates-grid {
      grid-template-columns: 1fr; /* Une colonne sur très petit écran */
    }
    
    /* 4. Contact Section */
    .contact-container {
        flex-direction: column;
        align-items: center;
    }

    .contact-info, .contact-form {
        width: 100%;
        text-align: center;
    }

    .info-item {
        justify-content: center;
    }
}
@media (min-width: 769px) and (max-width: 992px) {
    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== SCROLL ANIMATION ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}