/* --- Variables & Reset --- */
:root {
    --primary-color: #002366; /* Royal Blue / Navy */
    --accent-color: #4169e1; /* Royal Blue Lighter */
    --text-dark: #0a0a0a; /* Noir presque pur pour plus de contraste */
    --text-grey: #444; /* Gris plus foncé pour lisibilité */
    --bg-white: #ffffff; /* Blanc Pur */
    --bg-light: #f4f6f8; /* Gris teinté très léger pour le contraste */
    --shadow: 0 5px 15px rgba(0,0,0,0.08); /* Ombre légèrement plus marquée */
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Supprime le flash gris au toucher sur mobile */
}

html, body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden; /* CORRECTION DU SCROLL HORIZONTAL */
    width: 100%;
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Utility Classes --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: var(--primary-color);
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.highlight {
    color: var(--accent-color);
}

.mt-4 {
    margin-top: 2.5rem !important;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(65, 105, 225, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Navigation (Style Gélule Flottante) --- */
.navbar {
    position: fixed;
    top: 20px; 
    left: 50%;
    transform: translateX(-50%); 
    width: auto;
    max-width: 98%; 
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
    height: 70px;
    display: flex;
    align-items: center;
    border-radius: 50px; 
    padding: 5px 15px; 
    border: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0; 
}

.logo {
    font-size: 1.4rem; 
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 20px;
    white-space: nowrap; 
    display: flex;          
    align-items: baseline;
}

.logo span {
    font-size: 0;
    width: 8px;   
    height: 8px;  
    background-color: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
    margin-left: 2px;
    
    /* AJUSTEMENT MANUEL DE LA HAUTEUR DU POINT */
    position: relative;
    bottom: 7.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 5px; 
}

.nav-links li {
    margin-left: 0;
}

.nav-links a:not(.btn-nav) {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px; 
    border-radius: 30px;
    transition: var(--transition);
    color: var(--text-grey);
    white-space: nowrap;
}

.nav-links a:not(.btn-nav):hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-color);
}

.nav-links a:not(.btn-nav)::after {
    display: none;
}

.btn-nav {
    background-color: var(--accent-color) !important; 
    color: white !important;
    padding: 8px 20px !important; 
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(65, 105, 225, 0.3);
    white-space: nowrap;
}

.btn-nav:hover {
    transform: translateY(-2px);
    background-color: var(--primary-color) !important;
}

.lang-switch {
    margin-left: 10px;
    border: 1px solid #eee;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    gap: 12px; 
    
    white-space: nowrap; 
}

.lang-switch i, 
.lang-switch a, 
.lang-switch span {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
    display: inline-block;
    background: none !important; /* Sécurité pour le hover */
}

.lang-switch i {
    color: var(--primary-color);
    font-size: 1.1rem; 
}

.lang-switch a {
    color: var(--text-grey);
    transition: color 0.3s ease;
}

.lang-switch a:hover {
    color: var(--primary-color);
}

.lang-switch .active-lang {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: underline;
}

/* Hamburger Menu Style */
.burger {
    display: none;
    cursor: pointer;
    margin-left: 15px;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px; 
    background-color: var(--bg-white);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-text {
    flex: 1;
    padding-right: 50px;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--primary-color);
    min-height: 1.2em;
}

.subtitle {
    display: block;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.hero-text p {
    color: var(--text-grey);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* --- Profile Image Animation (Optimized) --- */
.image-wrapper {
    width: 400px;
    height: 400px;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 20px 20px 0px var(--accent-color);
    border: 3px solid #ffffff; /* Bordure blanche pour éviter le gris */
    background-color: #ffffff;
    transition: transform 0.3s ease;
    -webkit-backface-visibility: hidden; /* Fix mobile rendering issues */
    backface-visibility: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Légère correction pour que la photo ressorte mieux sur fond blanc */
    filter: contrast(1.05) brightness(0.98);
}

/* Animation activée uniquement sur les appareils avec souris */
@media (hover: hover) {
    .image-wrapper:hover {
        transform: translateY(-5px);
    }
    .image-wrapper:hover img {
        transform: scale(1.03);
    }
}

/* --- Typewriter Cursor --- */
.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent-color);
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: middle;
    height: 1em;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- About Section --- */
.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--text-grey);
}

.skills-tags {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* Tooltip Styles */
.skills-tags span {
    background-color: rgba(65, 105, 225, 0.1);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative; 
    cursor: help; 
    transition: var(--transition);
}

.skills-tags span:hover {
    background-color: var(--accent-color);
    color: white;
}

.skills-tags span::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%; 
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: normal; 
    width: max-content;
    max-width: 250px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
    text-align: center;
}

.skills-tags span::after {
    content: '';
    position: absolute;
    bottom: 115%; 
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 6px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.skills-tags span:hover::before,
.skills-tags span:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- Experience (Timeline Style) --- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* LIGNE VERTICALE (Derrière) */
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #ddd;
    top: 0;
    bottom: 0;
    left: 40px; /* Centré pour logo 80px (80/2) */
    z-index: 0; 
}

.timeline-item {
    display: flex;
    margin-bottom: 50px;
    position: relative;
    z-index: 1; /* Le bloc entier est au-dessus de la ligne */
}

/* LOGO CONTENEUR (Devant) */
.timeline-img {
    width: 80px; /* TAILLE PC */
    height: 80px;
    flex-shrink: 0;
    background: white; /* Fond blanc pour cacher la ligne derrière */
    z-index: 10; 
    position: relative;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 30px;
    animation: pulse-blue 2s infinite;
}

/* Animation Pulse */
@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(65, 105, 225, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(65, 105, 225, 0); }
    100% { box-shadow: 0 0 0 0 rgba(65, 105, 225, 0); }
}

#education .timeline {
    margin-top: 20px;
}

.timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Carte Contenu (Fond Blanc Pur) */
.timeline-content {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    flex: 1;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-content .company {
    display: block;
    font-weight: 600;
    color: var(--accent-color);
}

.timeline-content .date, .timeline-content .location {
    display: block;
    font-size: 0.85rem;
    color: #999;
}

.timeline-content .location {
    margin-bottom: 15px;
}

.timeline-content .description {
    margin-bottom: 10px;
    color: var(--text-dark);
}

.timeline-content ul {
    list-style: none;
    padding-left: 20px;
    color: var(--text-grey);
    margin-bottom: 15px;
}

.timeline-content ul li {
    margin-bottom: 5px;
    position: relative;
}

.timeline-content ul li::before {
    content: '➢';
    position: absolute;
    left: -20px;
    color: var(--accent-color);
    font-size: 0.8rem;
}

.skills-text {
    border-top: 1px solid #eee;
    padding-top: 10px;
    font-size: 0.85rem;
    color: #555;
}

.skills-text strong {
    color: var(--text-dark);
}

/* --- Education & Grid --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card-link {
    display: block;
    height: 100%;
}

/* Cartes d'éducation en BLANC PUR */
.card {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--accent-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-link:hover .card {
    transform: translateY(-10px);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.card-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 15px;
    border-radius: 8px;
}

.card-header h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.card-header .degree {
    font-size: 0.9rem;
    color: var(--text-grey);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body .date {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.card-body .small {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.edu-desc {
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-bottom: 15px;
    flex: 1;
}
.edu-desc p {
    margin-bottom: 8px;
}

/* --- Certifications Sub-sections --- */
.cert-category {
    margin-bottom: 50px;
}

.cert-category:last-child {
    margin-bottom: 0;
}

.cert-category h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.cert-category h3 i {
    color: var(--accent-color);
    background: rgba(65, 105, 225, 0.1);
    padding: 8px;
    border-radius: 8px;
    font-size: 1.1rem;
}

/* --- Certifications Grid --- */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Cartes de certif en BLANC PUR */
.cert-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
    position: relative;
}

.cert-item:hover {
    transform: translateY(-5px);
    background-color: #f0f4ff;
}

.cert-item h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-dark);
    padding-right: 20px;
}

.cert-item p {
    font-size: 0.85rem;
    color: #777;
}

.link-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--accent-color);
    font-size: 0.8rem;
    opacity: 0.5;
}

/* --- Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.project-link {
    display: block;
    height: 100%;
}

/* Cartes de projet en BLANC PUR */
.project-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-link:hover .project-card {
    transform: translateY(-10px);
}

.project-image {
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-link:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-info h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.project-info .role {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.project-association {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.assoc-logo-small {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    object-fit: contain;
}

.project-desc {
    color: var(--text-grey);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
}

.project-desc p {
    margin-bottom: 10px;
}

.project-info .tags {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-info .tags span {
    font-size: 0.8rem;
    background: #eee;
    padding: 5px 10px;
    border-radius: 5px;
    color: #555;
}

/* --- Recommendations --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

/* Cartes de recommandation en BLANC PUR */
.testimonial-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
}

.quote-icon {
    font-size: 2rem;
    color: rgba(65, 105, 225, 0.2);
    margin-bottom: 20px;
}

.testimonial-card p {
    font-style: italic;
    color: #555;
    margin-bottom: 30px;
    flex: 1;
}

.author-block {
    display: flex;
    align-items: center;
}

.author-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--accent-color);
}

.author-info h4 {
    color: var(--primary-color);
    margin-bottom: 2px;
    font-size: 1.1rem;
}

.author-info span {
    font-size: 0.85rem;
    color: var(--text-grey);
    display: block;
}

/* --- Contact --- */
.contact-wrapper {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
    background: var(--primary-color);
    color: white;
    padding: 40px;
    border-radius: 20px;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-link {
    display: block;
    color: white;
    margin-bottom: 15px;
    font-size: 1.1rem;
    transition: var(--transition);
    word-break: break-all; 
}

.contact-link:hover {
    opacity: 0.8;
    transform: translateX(5px);
}

.calendar-container {
    flex: 2;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: white;
    min-height: 600px; 
}

/* --- FOOTER --- */
footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h2 {
    font-size: 2rem;
    font-weight: 700;
}

.footer-logo span {
    color: var(--accent-color);
}

.footer-logo p {
    opacity: 0.8;
    margin-top: 10px;
}

.footer-links h3, .footer-socials h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    opacity: 0.7;
    font-size: 0.85rem;
}

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal {
    transform: translateY(50px);
    opacity: 0;
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- MEDIA QUERIES (MOBILE) --- */
@media (max-width: 768px) {
    /* Navigation */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        height: 80px;
        padding: 0;
        border: none;
        background: rgba(255, 255, 255, 0.98);
    }

    .nav-container {
        padding: 0 20px;
    }

    .logo {
        margin-right: 0;
        font-size: 1.2rem;
    }

    .burger {
        display: block;
    }
    
    /* Tiroir du menu mobile */
    .nav-links {
        position: absolute;
        right: 0px;
        height: 92vh;
        top: 80px;
        background-color: var(--bg-white); /* Assure le fond blanc du menu */
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 70%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 5px 10px rgba(0,0,0,0.1);
        padding-top: 50px;
        gap: 20px;
    }
    
    .nav-links li {
        opacity: 0;
        margin: 15px 0;
    }

    .nav-active {
        transform: translateX(0%);
    }
    
    .btn-nav {
        margin-top: 20px;
        display: inline-block;
    }

    .nav-links a:not(.btn-nav) {
        padding: 0;
        border-radius: 0;
    }
    
    .nav-links a:not(.btn-nav):hover {
        background-color: transparent;
    }

    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }

    @keyframes navLinkFade {
        from { opacity: 0; transform: translateX(50px); }
        to { opacity: 1; transform: translateX(0px); }
    }

    .lang-switch {
        margin: 20px 0;
        border-color: #eee;
    }

    .section { padding: 50px 0; }
    .section-title { font-size: 2rem; margin-bottom: 40px; }

    .hero { padding-top: 80px; }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text { padding-right: 0; }
    .hero-text h1 { font-size: 2.5rem; }
    
    .hero-image.reveal {
        opacity: 1;
        transform: translateY(0);
        transition: none;
    }

    .hero-image { margin-bottom: 30px; }
    .image-wrapper { width: 280px; height: 280px; }

    .grid-3, .grid-2, .projects-grid, .cert-grid {
        grid-template-columns: 1fr;
    }

    .timeline::after { left: 30px; } 
    
    .timeline-img {
        width: 60px; 
        height: 60px;
        margin-right: 20px;
    }
    
    .timeline-content { padding: 15px; }

    .contact-wrapper { flex-direction: column; }
    .contact-info { width: 100%; }
    .calendar-container { width: 100%; min-height: 500px; }

    .skills-tags span::before {
        width: 200px;
        white-space: normal;
        bottom: 135%;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    
    .social-icons { justify-content: center; }
}