/* =========================================
   VARIABLES & NOUVEAU THEME PREMIUM
========================================= */
:root {
    --bg-main: #121212;       /* Noir profond, style Graphite */
    --bg-alt: #1a1a1a;        /* Gris anthracite très foncé */
    --card-bg: #242424;       /* Gris légèrement plus clair pour les cartes */
    --text-main: #e5e5e5;     /* Blanc cassé, très doux pour les yeux */
    --text-muted: #a3a3a3;    /* Gris neutre pour le texte secondaire */
    --accent: #14b8a6;        /* Teal / Vert d'eau très élégant */
    --accent-hover: #0d9488;  /* Teal plus foncé au survol */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* =========================================
   TYPOGRAPHIE & STRUCTURE
========================================= */
h1, h2, h3 { color: var(--text-main); line-height: 1.2; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
.subtitle { color: var(--text-muted); margin-bottom: 2rem; }
.accent-text { color: var(--accent); font-weight: bold; font-size: 1.1rem; margin-bottom: 0.5rem; }

.section { padding: 5rem 5%; }
.section-container { max-width: 1200px; margin: 0 auto; }
.bg-alt { background-color: var(--bg-alt); }

/* =========================================
   NAVIGATION
========================================= */
.navbar {
    position: fixed; top: 0; width: 100%;
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-content {
    max-width: 1200px; margin: 0 auto; padding: 1.2rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
}

.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--accent); }

/* =========================================
   ACCUEIL (HERO) AVEC PHOTO RECADRÉE
========================================= */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 80px; }
.hero-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; gap: 4rem;
}

.hero-text { flex: 1; }
.hero h1 { font-size: 3.5rem; margin-bottom: 0.5rem; }
.hero h2 { font-size: 1.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 1.5rem; }
.bio { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 600px; }

.hero-image-container { flex: 1; display: flex; justify-content: center; }

/* FIX PHOTO ICI */
.profile-pic {
    width: 350px; height: 350px;
    object-fit: cover;
    object-position: top center; /* <--- C'est ça qui empêche de couper le haut de la tête */
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.15); /* Ombre ajustée à la nouvelle couleur */
}

.btn {
    display: inline-block; background-color: var(--accent); color: white;
    padding: 0.8rem 1.8rem; border-radius: 8px; font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}
.btn:hover { background-color: var(--accent-hover); transform: translateY(-2px); }

/* =========================================
   PARCOURS & COMPÉTENCES TRIÉES
========================================= */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }

/* Nouvel agencement des catégories de compétences */
.skill-category { margin-bottom: 2rem; }
.skill-category h3 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--text-main); font-weight: 600; }

.skills-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag {
    background-color: var(--card-bg); color: var(--text-main);
    padding: 0.4rem 0.9rem; border-radius: 6px; font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.2s;
}
.tag:hover { border-color: var(--accent); }

.mt-4 { margin-top: 3rem; }
.timeline-item {
    margin-bottom: 1.5rem; padding-left: 1.5rem;
    border-left: 2px solid var(--card-bg); /* Ligne grise discrète */
    position: relative;
}
.timeline-item::before {
    content: ''; position: absolute; left: -6px; top: 5px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}
.timeline-item .date { display: block; font-size: 0.85rem; color: var(--accent); font-weight: bold; margin-bottom: 0.2rem; }
.timeline-item h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.timeline-item p { color: var(--text-muted); font-size: 0.95rem; }

/* Style des "Flash Cards" / Badges */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.skill-pill {
    background-color: #3498db; /* Couleur vive pour se démarquer */
    color: white;
    padding: 4px 12px;
    border-radius: 50px; /* C'est ici qu'on crée la forme ovale */
    font-size: 0.75rem; /* Taille "petit" */
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    transition: transform 0.2s ease;
}

.skill-pill:hover {
    transform: scale(1.1); /* Petit effet de zoom au survol */
    background-color: #2980b9;
}

/* =========================================
   PROJETS (CARROUSEL HORIZONTAL STRICT)
========================================= */
.carousel {
    display: flex; gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-top: 1rem;    /* <-- LE FIX EST ICI : de l'espace pour l'animation */
    padding-bottom: 2rem; /* Espace en bas pour la barre de scroll */
}

.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 4px; }
.carousel::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.flash-card {
    flex: 0 0 320px;
    height: 380px;
    background-color: var(--card-bg);
    border-radius: 12px;
    scroll-snap-align: start;
    display: flex; flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.flash-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-image {
    height: 160px;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 0 0;
}

/* Style par défaut de l'icône Bootstrap (Gris Argenté) */
.card-image i {
    font-size: 3.5rem; /* Taille de l'icône */
    color: #a3a3a3;    /* Couleur grise/argentée */
    transition: color 0.3s ease, transform 0.3s ease; /* Animation fluide */
}

/* Effet au survol de la CARTE : l'icône devient BLANCHE et grossit légèrement */
.flash-card:hover .card-image i {
    color: #ffffff;        /* Devient blanc pur */
    transform: scale(1.1); /* Petit effet de zoom sur l'icône */
}

.card-content { padding: 1.5rem; flex: 1; }
.card-content h3 { margin-bottom: 0.8rem; font-size: 1.3rem; }
.card-content p { color: var(--text-muted); font-size: 0.95rem; }

footer {
    width: 100%;
    background-color: rgba(18, 18, 18, 0.85); /* Optionnel : fond léger */
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 40px;
}

.footer-container {
    display: flex;
    justify-content: space-between; /* C'est la clé pour l'espacement G/M/D */
    align-items: center;
    max-width: 1200px; /* Aligné sur la largeur de ton contenu */
    margin: 0 auto;
    padding: 0 20px;
    font-size: 0.9rem;
    color: #555;
}

/* Style des liens dans le footer */
.footer-container a {
    color: #a3a3a3;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-container a:hover {
    opacity: 0.7;
}

/* --- RESPONSIVE : Pour les tablettes et mobiles --- */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column; /* On empile les éléments verticalement */
        gap: 15px; /* Espace entre les lignes sur mobile */
        text-align: center;
    }
    
    .footer-mail, .footer-copyright, .footer-phone {
        width: 100%;
    }
}

/* =========================================
   MODALES (POPUPS PROJETS)
========================================= */
.project-modal {
    margin: auto; /* Centre la modale parfaitement */
    background-color: var(--bg-alt);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Le fond flouté derrière la modale */
.project-modal::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px); /* Flou esthétique */
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-content h3 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0;
}

.modal-content p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Bouton de fermeture "X" */
.close-modal {
    position: absolute;
    top: -15px;
    right: -10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-main); /* Devient blanc au survol */
}

/* Empêcher la page de scroller quand la modale est ouverte */
body:has(dialog[open]) {
    overflow: hidden;
}

/* Container des icônes */
.social-icons {
    display: flex;
    gap: 20px;
    margin-bottom: 30px; /* Espace avant le bouton */
    margin-top: 10px;
}

/* Style de base des liens */
.social-link {
    color: #555; /* Couleur grise par défaut */
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
}

/* Taille du SVG à l'intérieur */
.social-link svg {
    width: 100%;
    height: 100%;
}

/* --- EFFETS AU SURVOL --- */
.social-link.linkedin:hover {
    color: #0077b5;
    transform: translateY(-3px);
}

.social-link.instagram:hover {
    color: #e4405f;
    transform: translateY(-3px);
}

.social-link.x-twitter:hover {
    color: #000000;
    transform: translateY(-3px);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .social-icons {
        justify-content: center; /* Centre les icônes sur mobile */
    }
}

/* =========================================
   SECTION CERTIFICATIONS (GRANDE IMAGE, PAS DE CROP)
========================================= */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes sur PC */
    gap: 2rem;
    margin-top: 3rem;
}

.cert-card {
    background-color: var(--bg-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    /* overflow: hidden;  <-- On peut commenter ou retirer cette ligne */
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Pour que les cartes aient la même hauteur */
}

.cert-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

/* Nouveau style pour le conteneur d'image (Grand Rectangle de containment) */
.cert-image {
    width: 100%;
    height: 200px; /* Hauteur fixe pour l'harmonie de la grille */
    display: flex;
    align-items: center; /* Centre verticalement s'il y a de l'espace */
    justify-content: center; /* Centre horizontalement s'il y a de l'espace */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0,0,0,0.1); /* Légère ombre de fond pour le cadre */
    overflow: hidden; /* Nécessaire pour l'effet de zoom interne */
}

.cert-image img {
    max-width: 100%;
    max-height: 100%;
    /* FIX ICI : object-fit: contain; pour ne RIEN COUPER */
    object-fit: contain; 
    /* object-position: top center;  <-- Optionnel : Aligne en haut s'il y a de l'espace */
    transition: transform 0.3s ease;
}

/* Effet de zoom sur l'IMAGE quand on survol la CARTE */
.cert-card:hover .cert-image img {
    transform: scale(1.05); /* Zoom très léger */
}

/* Ajustement des infos sous l'image */
.cert-info {
    padding: 1.5rem;
    flex-grow: 1; /* Pousse le texte vers le bas si besoin */
}

.cert-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.cert-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* RESPONSIVE CERTIFICATIONS */
@media (max-width: 900px) {
    .certifications-grid {
        grid-template-columns: 1fr; /* 1 seule colonne sur mobile */
    }
    .cert-image {
        height: 250px; /* Un peu plus haut sur mobile */
    }
}