/* VARIABLES GLOBALES */
:root {
  /* NOUVELLE PALETTE DE COULEURS SOMBRES (plus foncée) */
  --bg-dark: #1A2333; /* Le nouveau fond (Gris-Bleu "Slate" plus foncé) */
  --bg-card: #2A3547; /* La couleur des cartes (plus claire que le fond, mais foncée) */
  --bg-header-footer: #0D131F; /* La couleur du header/footer (le plus foncé) */

  --text-light: #f0f0f0;
  --accent: #2e9afe;
  --font-title: 'Rajdhani', sans-serif;
  --font-text: 'Poppins', sans-serif;
}

/* RESET ET BASE */
body {
  background-color: var(--bg-dark); /* MODIFIÉ */
  color: var(--text-light);
  margin: 0;
  font-family: var(--font-text);
  scroll-behavior: smooth;
}

/* HEADER (Bandeau de navigation fixe) */
.main-header {
  /* MODIFIÉ : Basé sur --bg-header-footer (rgb(13, 19, 31)) */
  background-color: rgba(13, 19, 31, 0.95); 
  padding: 1rem 2rem;
  position: fixed; 
  width: 100%;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #333; /* Peut-être ajuster ce gris #333 aussi si besoin */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  box-sizing: border-box; 
}

.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-links a:hover {
  color: var(--accent);
}

/* HERO */
.hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  margin-top: 70px; 
}

.hero-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(50%);
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  /* MODIFIÉ : Gradient basé sur le nouveau fond (rgb(26, 35, 51)) */
  background: linear-gradient(to bottom, rgba(26, 35, 51, 0.2), rgba(26, 35, 51, 0.9)); 
  z-index: -1;
}

.hero-content h1 {
  font-family: var(--font-title);
  font-size: 4rem;
  margin-bottom: 0.5rem;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  font-size: 1.4rem;
  color: var(--accent);
  text-transform: uppercase;
}

/* SECTIONS GÉNÉRALES */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Décalage pour le header fixe sur les pages secondaires */
.section.projects-page,
.contact-section,
.about-page {
    padding-top: 100px; 
}

/* CENTRAGE DES TITRES H2 (TITRES DE SECTION) */
.section h2 {
  text-align: center;
  font-family: var(--font-title); 
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-light);
  border-bottom: 3px solid var(--accent);
  
  margin-left: auto;
  margin-right: auto;
  display: block; 
  width: fit-content; 
  padding-bottom: 5px;
}

/* SECTION PARCOURS IUT (about-gmp) */
.about-gmp {
    text-align: center;
    background-color: var(--bg-header-footer); /* MODIFIÉ */
    border-bottom: 1px solid #333;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: justify;
}

.about-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Boutons primaires (utilisés dans les appels à l'action) */
.btn-primary {
    background: var(--accent);
    color: var(--bg-dark); /* MODIFIÉ : Texte sur bouton bleu reste le fond le plus sombre */
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
    transition: background 0.3s ease, color 0.3s ease;
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
}

/* Groupe de boutons après le parcours */
.button-group {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Style secondaire (non utilisé pour le moment, mais gardé) */
.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* NOUVELLE SECTION VIDÉO CV (ACCUEIL) */
.video-home-section {
    padding: 3rem 2rem;
    text-align: center; 
    background-color: var(--bg-dark); 
    border-bottom: 1px solid #333;
}

.video-home-section .section-intro {
    font-size: 1.1rem;
    color: #bbb;
}

.video-embed.video-home {
    max-width: 900px;
}

/* COMPÉTENCES */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.skill-card {
  background: var(--bg-card); /* MODIFIÉ */
  border: 1px solid #445266; /* Bordure assortie */
  border-radius: 12px;
  padding: 1.5rem;
  width: 280px;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  box-sizing: border-box; 
}

.skill-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(46, 154, 254, 0.2);
}

.skill-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  color: var(--accent);
}

.skill-card h3 {
    color: var(--text-light);
    font-family: var(--font-text);
    font-size: 1.3rem;
    border-bottom: 1px solid #445266; 
    padding-bottom: 10px;
}

.skill-card ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.skill-card ul li {
    background: rgba(46, 154, 254, 0.1);
    color: var(--accent);
    padding: 3px 8px;
    margin-right: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}


/* PROJETS (Utilisés dans projets-universitaires.html et projets-professionnels.html) */
.projects-page .section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
    color: #bbb;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-card); /* MODIFIÉ */
  border: 1px solid #445266; /* MODIFIÉ */
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Changement de curseur pour indiquer qu'on peut cliquer */
.project-card[data-modal-target] {
    cursor: pointer;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: brightness(85%);
  transition: filter 0.3s ease;
}

.project-card:hover img {
    filter: brightness(100%);
}

.project-info {
  padding: 1rem;
}

.project-info h3 {
  margin-top: 0;
  font-family: var(--font-text);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* STYLE POUR LES TAGS DE COMPÉTENCE SUR LES CARTES */
.project-info .project-skills {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #445266; /* MODIFIÉ */
}

.skill-tag {
    display: inline-block;
    background: rgba(46, 154, 254, 0.1); 
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem; 
    font-weight: 500;
    margin-right: 5px;
    margin-bottom: 5px;
}


/* BADGES PROJET */
.project-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-size: 0.7rem;
  background: rgba(13, 19, 31, 0.85); /* MODIFIÉ */
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  font-weight: 500;
}

.project-badge.pro {
  border-color: #2e9afe;
  color: #2e9afe;
}

.project-badge.uni {
  border-color: #a86ff7; 
  color: #a86ff7;
}

/* À PROPOS (apropos.html) */
.about-page {
    text-align: center; 
}

.cv-video-container, .cv-download-section {
    margin-bottom: 4rem;
}

/* BLOC CONTENEUR VIDÉO */
.video-embed {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    border: 3px solid var(--accent);
    border-radius: 12px;
}

/* BLOC VIDÉO MP4 LOCALE (REMPLACE IFRAME) */
.video-embed video { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

.cv-download-section p {
    margin-top: 1rem;
    color: #bbb;
}

/* CONTACT (contact.html) */
.contact-section {
  text-align: center;
  padding-bottom: 5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form-container, .contact-links-container {
    background: var(--bg-card); /* MODIFIÉ */
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #445266; /* MODIFIÉ */
    text-align: left; 
}

.contact-links-container {
    display: flex; 
    flex-direction: column;
    align-items: flex-start;
}

.contact-form-container h3, .contact-links-container h3 {
    font-family: var(--font-text);
    color: var(--accent);
    margin-top: 0;
    font-size: 1.3rem;
    border-bottom: 1px solid #445266; /* MODIFIÉ */
    padding-bottom: 10px;
    margin-bottom: 1.5rem;
}

.simple-form input, .simple-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background: var(--bg-dark); /* MODIFIÉ */
    border: 1px solid #445266; /* MODIFIÉ */
    border-radius: 6px;
    color: var(--text-light);
    font-family: var(--font-text);
    box-sizing: border-box;
}

.simple-form textarea {
    resize: vertical;
}

/* Bouton Outline (utilisé pour Email) */
.btn-outline {
  border: 1px solid var(--accent);
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%; 
  box-sizing: border-box;
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* Bouton LinkedIn */
.btn-linkedin {
    background: #0077B5; 
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; 
    box-sizing: border-box;
    transition: opacity 0.3s;
}

.btn-linkedin svg {
    margin-right: 10px;
}

.btn-linkedin:hover {
    opacity: 0.9;
}

/* Liens verticaux pour Contact (ESPACEMENT CORRIGÉ) */
.vertical-links {
    display: flex; 
    flex-direction: column;
    gap: 2rem; 
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid #333;
  font-size: 0.8rem;
  opacity: 0.6;
  background-color: var(--bg-header-footer); /* MODIFIÉ */
}

.footer-link {
    color: var(--text-light);
    opacity: 0.6;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ======================================================= */
/* STYLES POUR LES TOOLTIPS (INFOBULLES)                   */
/* ======================================================= */
.tooltip {
    position: relative; 
    cursor: help; 
    
    background-color: rgba(46, 154, 254, 0.1);
    color: var(--accent);
    padding: 2px 6px; 
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.tooltip:hover {
    background-color: rgba(46, 154, 254, 0.2);
}

/* La boîte de l'infobulle */
.tooltip::after {
    content: attr(data-tooltip); 
    position: absolute;
    top: 150%; 
    left: 50%;
    transform: translateX(-50%);
    
    background-color: #333; /* Infobulle peut rester un gris neutre */
    color: var(--text-light);
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-text);
    font-weight: 400; 
    line-height: 1.5;
    width: 300px; 
    text-align: left; 
    text-transform: none; 
    letter-spacing: normal; 
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

/* La petite flèche au-dessus */
.tooltip::before {
    content: '';
    position: absolute;
    top: 100%; 
    left: 50%;
    transform: translateX(-50%);
    
    border-width: 8px;
    border-style: solid;
    border-color: #333 transparent transparent transparent; /* Flèche peut rester un gris neutre */
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 11; 
}

/* Affichage au survol */
.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}


/* ======================================================= */
/* RESPONSIVITÉ POUR MOBILE                                */
/* ======================================================= */
@media (max-width: 768px) {
    .main-header {
        padding: 1rem 1rem;
    }
    
    .nav-links {
        gap: 0.5rem; 
        font-size: 0.9rem;
        flex-wrap: wrap; 
        justify-content: center; 
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .section {
        padding: 3rem 1rem; 
    }
    .section h2 {
        font-size: 2rem;
    }
    .skills-grid {
        gap: 1rem;
    }
    .skill-card {
        width: 100%; 
    }
    .projects-grid {
        grid-template-columns: 1fr; 
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    /* Cache les infobulles sur mobile (inutiles/gênantes) */
    .tooltip::after, .tooltip::before {
        display: none;
    }
}


/* ======================================================= */
/* MODALES (POPUPS)                                        */
/* ======================================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    
    opacity: 0;
    visibility: hidden; 
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card); /* MODIFIÉ */
    border: 1px solid #445266; /* MODIFIÉ */
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 900px; 
    max-height: 80vh; 
    overflow-y: auto; 
    position: relative;
    z-index: 2002;
    color: var(--text-light);
    
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2001;
    cursor: pointer;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    z-index: 2003;
    transition: color 0.3s ease;
}

.modal-close-btn:hover {
    color: var(--accent);
}

/* Style pour le contenu à l'intérieur de la modale */
.modal-content h2 {
    font-family: var(--font-title);
    color: var(--accent);
    margin-top: 0;
}

.modal-content h3 {
    font-family: var(--font-text);
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid #445266; /* MODIFIÉ */
    padding-bottom: 5px;
}

.modal-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    object-fit: cover;
}

/* LISTE STANDARD (SANS ENGRENAGES) */
.modal-list {
    list-style: disc; 
    padding-left: 2rem; 
    margin-top: 1rem;
    margin-bottom: 1.5rem; 
}

.modal-list li {
    margin-bottom: 0.5rem; 
    line-height: 1.6;
}

.modal-list ul {
    list-style: circle; 
    margin-top: 0.5rem;
}


/* IMAGES PETITES */
.modal-img-small {
    width: 60%; 
    height: auto;
    border-radius: 8px;
    margin: 1rem auto; 
    display: block; 
    object-fit: contain;
    border: 1px solid #445266; /* MODIFIÉ */
}

/* CONTENEUR FLEXBOX POUR IMAGES CÔTE À CÔTÉ (CORRIGÉ) */
.image-container-inline {
    display: flex;
    justify-content: center; 
    gap: 2%; 
    margin-top: 1rem;
    flex-wrap: wrap; 
}

/* IMAGES CÔTE À CÔTÉ (CORRIGÉ) */
.modal-img-inline {
    width: 49%; 
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #445266; /* MODIFIÉ */
    box-sizing: border-box; 
}

/* NOUVEAU STYLE POUR LE PDF INTÉGRÉ */
.pdf-embed {
    border: 1px solid #445266; /* MODIFIÉ */
    border-radius: 8px;
    width: 100%;
    height: 500px; 
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

/* Améliore le curseur sur les images cliquables dans les modales */
.modal-content a .modal-img-small {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.modal-content a .modal-img-small:hover {
  opacity: 0.8;
}

/* ======================================================= */
/* ANIMATION AU DÉFILEMENT (SCROLL)                       */
/* ======================================================= */

/* Cache les éléments par défaut */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Style de l'élément quand il devient visible */
.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ======================================================= */
/* NAVIGATION ACTIVE                                       */
/* ======================================================= */

/* Cible le bon lien en fonction de l'ID du body */
#page-accueil .nav-links a[href="index.html"],
#page-projets-uni .nav-links a[href="projets-universitaires.html"],
#page-projets-pro .nav-links a[href="projets-professionnels.html"],
#page-apropos .nav-links a[href="apropos.html"],
#page-contact .nav-links a[href="contact.html"] {
    
    /* On applique le style "actif" */
    color: var(--accent);
    font-weight: 600;
    text-shadow: 0 0 5px rgba(46, 154, 254, 0.5);
}
