/* --- VARIABLES & RESET --- */
:root {
    --bg-dark: #10375d;
    --accent: #4ae4df;
    --white: #ffffff;
    --gray-bg: #f8fafc;
    --text-main: #0a2540;
    --text-light: #a0b3c6;
}

/* Scroll fluide */
html { scroll-behavior: smooth; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', sans-serif; background-color: var(--gray-bg); color: var(--text-main); overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- SIDEBAR --- */
.sidebar {
    width: 300px; height: 100vh;
    background: var(--bg-dark);
    position: fixed; top: 0; left: 0;
    color: var(--white); padding: 40px 30px;
    display: flex; flex-direction: column; justify-content: space-between;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    overflow-y: auto; 
}
.avatar-frame {
    width: 120px; height: 120px; margin: 0 auto 20px;
    border-radius: 50%; border: 3px solid var(--accent);
    overflow: hidden; padding: 3px;
}
.avatar-frame img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-top h1 { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 5px; }
.job-title { display: block; text-align: center; color: var(--accent); font-family: 'Fira Code', monospace; font-size: 0.9rem; }
.nav-links { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.nav-links a { font-size: 1.1rem; color: var(--text-light); font-weight: 500; }
.nav-links a:hover { color: var(--accent); padding-left: 10px; }
.infos-block p { margin-bottom: 12px; font-size: 0.95rem; color: #dceefb; display: flex; align-items: center; gap: 10px; word-break: break-all; }
.infos-block i { color: var(--accent); width: 20px; }

.btn-sidebar-cv {
    display: block; text-align: center; border: 1px solid var(--accent); color: var(--accent); padding: 10px; border-radius: 30px; font-weight: 700; font-size: 0.9rem; margin: 10px 0;
}
.btn-sidebar-cv:hover { background: var(--accent); color: var(--bg-dark); transform: translateY(-2px); }

.socials { display: flex; gap: 15px; justify-content: center; }
.socials a { width: 40px; height: 40px; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.socials a:hover { background: var(--accent); color: var(--bg-dark); }

/* --- BURGER BUTTON --- */
.burger-btn { 
    display: none; 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 2000; 
    background: var(--bg-dark); 
    color: var(--accent); 
    border: 2px solid var(--accent); 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    font-size: 1.5rem; 
    cursor: pointer; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    transition: 0.3s; 
}
.burger-btn:hover { background: var(--accent); color: var(--bg-dark); }

/* Suppression du fond noir (overlay) */
.mobile-overlay { 
    display: none !important; 
}

/* FIX POUR LE BUG DU MENU SUR DESKTOP */
@media (min-width: 901px) {
    .mobile-overlay { display: none !important; }
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: 300px;
    background-color: #f8fafc;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: #10375d;
}

/* ANIMATIONS SCROLL GÉNÉRIQUES */
.animate-scroll { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.animate-scroll.visible { opacity: 1; transform: translateY(0); }

/* AMÉLIORATION ANIMATION PROJETS */
.project-card.animate-scroll {
    opacity: 0;
    transform: scale(0.8) translateY(50px); 
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.project-card.animate-scroll.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* 1. HERO */
.hero-section { height: 100vh; display: flex; align-items: center; padding: 0 8%; position: relative; overflow: hidden; background: white; }
.hero-bg-shape { position: absolute; top: -20%; right: -10%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(74, 228, 223, 0.15) 0%, rgba(255,255,255,0) 70%); border-radius: 50%; z-index: 0; }
.hero-content { position: relative; z-index: 1; max-width: 900px; }
.giant-title { font-size: 5rem; line-height: 1.1; font-weight: 800; color: var(--bg-dark); margin-bottom: 25px; }
.text-gradient { background: linear-gradient(90deg, var(--bg-dark), #4ae4df); -webkit-background-clip: text; color: transparent; }
.hero-bio { font-size: 1.3rem; color: #555; max-width: 650px; margin-bottom: 40px; line-height: 1.6; }
.hero-actions { display: flex; gap: 20px; }
.btn-primary { background: var(--bg-dark); color: white; padding: 15px 35px; border-radius: 6px; font-weight: bold; border: 2px solid var(--bg-dark); cursor: pointer; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg-dark); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(74, 228, 223, 0.4); }
.btn-secondary { border: 2px solid var(--bg-dark); color: var(--bg-dark); padding: 15px 35px; border-radius: 6px; font-weight: bold; cursor: pointer; }
.btn-secondary:hover { background: var(--bg-dark); color: white; transform: translateY(-3px); }

/* 2. CHAT SECTION */
.interview-section { padding: 100px 8% 100px 8%; background: var(--gray-bg); }
.section-header { padding-left: 0; margin-bottom: 50px; }
.section-header h2 { font-size: 3rem; color: var(--bg-dark); margin-bottom: 10px; }
.section-header p { color: #666; font-size: 1.1rem; }
.chat-container { width: 100%; max-width: 100%; margin: 0; display: flex; flex-direction: column; gap: 40px; }
.message-row { display: flex; gap: 20px; align-items: flex-end; width: 100%; }
.row-me { justify-content: flex-end; } 
.row-bot { justify-content: flex-start; } 
.chat-avatar { width: 45px; height: 45px; background: var(--bg-dark); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-bubble { max-width: 70%; padding: 25px 30px; border-radius: 18px; font-size: 1.05rem; line-height: 1.6; position: relative; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.bubble-bot { background: white; color: var(--text-main); border-bottom-left-radius: 2px; }
.bubble-me { background: var(--bg-dark); color: white; border-bottom-right-radius: 2px; font-weight: 500; }
.bubble-timeline { background: var(--bg-dark); color: white; border-bottom-right-radius: 2px; width: 100%; text-align: left; }

.typing-text { min-height: 1.6em; }

.timeline-intro { margin-bottom: 20px; font-weight: 800; color: var(--accent); }
.timeline-box { position: relative; padding-left: 20px; border-left: 3px solid rgba(255,255,255,0.1); }
.tl-item { margin-bottom: 30px; position: relative; padding-left: 20px; }
.tl-item::before { content: ''; position: absolute; left: -28px; top: 5px; width: 14px; height: 14px; background: var(--bg-dark); border: 3px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,0.1); }
.tl-item:last-child { margin-bottom: 0; }
.tl-date { font-family: 'Fira Code'; font-size: 0.85rem; color: var(--accent); display: block; margin-bottom: 5px; }
.tl-content strong { display: block; color: white; font-size: 1.1rem; }
.tl-content small { color: var(--bg-dark); background: var(--accent); padding: 2px 6px; border-radius: 4px; font-weight: bold; text-transform: uppercase; font-size: 0.75rem; }
.tl-content p { font-size: 0.95rem; margin-top: 5px; color: #dceefb; }
.skills-grid { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.skill-tag { background: rgba(255,255,255,0.1); color: var(--accent); padding: 8px 15px; border-radius: 6px; font-size: 0.9rem; font-weight: bold; border: 1px solid rgba(255,255,255,0.1); }
.bubble-bot .skills-grid { justify-content: flex-start; }


/* 3. WORKS SECTION */
.works-section { padding: 100px 8%; background: white; }

.projects-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
}

.project-card { 
    cursor: pointer; 
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.project-card:hover { transform: translateY(-10px); }

.project-thumb { height: 240px; border-radius: 12px; overflow: hidden; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.hover-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(16, 55, 93, 0.9); display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.3s; }
.hover-overlay span { color: var(--accent); font-weight: bold; font-size: 1.2rem; border: 2px solid var(--accent); padding: 10px 20px; border-radius: 30px; }
.project-card:hover .project-thumb img { transform: scale(1.1); }
.project-card:hover .hover-overlay { opacity: 1; }
.project-info { padding-top: 20px; }
.project-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.project-header h3 { font-size: 1.4rem; color: var(--bg-dark); font-weight: 700; margin: 0; }
.project-type { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #999; font-weight: 700; background: #f0f0f0; padding: 4px 8px; border-radius: 4px; }
.project-tech { font-family: 'Fira Code'; font-size: 0.9rem; color: var(--accent); margin-top: 5px; }

/* 4. FOOTER */
.footer-contact { padding: 120px 10%; background: var(--bg-dark); color: white; text-align: center; }
.footer-content h2 { font-size: 3rem; margin-bottom: 20px; }
.footer-content p { font-size: 1.3rem; opacity: 0.9; margin-bottom: 40px; color: #dceefb; }
.big-btn { font-size: 1.2rem; background: var(--accent); color: var(--bg-dark); }

/* --- MODAL --- */
.modal-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 37, 64, 0.95); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.3s ease-out forwards; }
.modal-card { background: white; width: 900px; max-width: 90%; max-height: 90vh; border-radius: 15px; overflow: hidden; display: flex; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.5); opacity: 0; transform: scale(0.9) translateY(20px); animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.1s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--bg-dark); z-index: 10; transition: 0.3s; }
.close-btn:hover { color: var(--accent); transform: rotate(90deg); }

/* MODIF : Container avec scroll et centrage (Desktop) */
.modal-image {
    width: 50%;
    background: #000;
    overflow-y: auto; /* Scroll si plusieurs images */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0; 
}

/* Par défaut (Desktop) */
.modal-image img {
    width: 100%;
    height: auto; 
    object-fit: contain;
    margin-bottom: 20px;
    display: block;
}

/* CAS SPÉCIFIQUE (Desktop) : Image unique => Plein écran (Cover) */
.modal-image img:only-child {
    height: 100%;
    object-fit: cover;
    margin-bottom: 0;
}

.modal-details { width: 50%; padding: 40px; overflow-y: auto; }
.modal-cat { color: var(--accent); font-weight: bold; text-transform: uppercase; font-size: 0.8rem; }
.modal-details h2 { font-size: 2rem; color: var(--bg-dark); margin: 5px 0 20px; }
.modal-desc { line-height: 1.7; color: #555; margin-bottom: 30px; }
.modal-specs { display: flex; gap: 30px; margin-bottom: 30px; border-top: 1px solid #eee; padding-top: 20px; }
.spec-item { display: flex; flex-direction: column; }
.spec-item strong { font-size: 0.8rem; color: #888; text-transform: uppercase; }
.spec-item span { font-weight: bold; color: var(--bg-dark); }
.modal-buttons { display: flex; gap: 10px; }

/* -------------------------------------------
   NOUVEAU CODE : BOUTON CONTACT (Remplaçant le mode sombre)
------------------------------------------- */

/* Positionnement du bouton à droite sur Desktop */
.hero-section {
    justify-content: space-between;
}

.hero-extra {
    position: relative;
    z-index: 10;
    margin-left: 50px;
}

/* Style du bouton rond pour CONTACT */
.hero-contact-btn {
    background: transparent;
    border: 2px solid var(--bg-dark);
    color: var(--bg-dark);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.hero-contact-btn i { font-size: 1.8rem; }

.hero-contact-btn:hover {
    background: var(--bg-dark);
    color: var(--white);
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Responsive Mobile */
@media (max-width: 900px) {
    
    /* Suppression complète du bouton Contact sur mobile */
    .hero-extra { display: none; }

    /* Bouton visible, ABSOLU pour qu'il reste en haut de page sans suivre le scroll */
    .burger-btn { 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        position: absolute; /* ICI : le bouton ne suit plus */
        top: 20px;
        right: 20px;
    }

    /* Sidebar transformée en Off-Canvas menu avec scroll interne */
    .sidebar { 
        width: 280px; 
        height: 100vh; 
        position: fixed; 
        top: 0; 
        left: 0; 
        transform: translateX(-105%); /* MODIFICATION: -105% pour éviter la ligne fantôme */
        z-index: 1000;
        box-shadow: none; /* Suppression de l'ombre */
        overflow-y: auto; 
    }

    /* Classe active pour montrer la sidebar */
    .sidebar.mobile-open { transform: translateX(0); }

    .main-content { margin-left: 0; }
    .giant-title { font-size: 3rem; }
    
    .chat-container { width: 100%; }
    
    /* MODIF : Chat prend tout l'écran */
    .chat-bubble { max-width: 100%; width: 100%; }

    /* MODIFICATION HERO SECTION : Hauteur automatique pour tout voir */
    .hero-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 80px 20px;
    }

    .interview-section, .works-section { padding: 80px 20px; }
    .section-header { padding-left: 0; }
    .projects-grid { grid-template-columns: 1fr; }

    /* MODIFICATION MODALE MOBILE : Ajustement de la taille */
    .modal-card { 
        display: block; 
        overflow-y: auto; 
        width: 85% !important; /* Force une largeur moins importante */
        max-height: 75vh !important; /* Réduit la hauteur max pour laisser voir le fond */
    }

    .modal-image {
        width: 100%;
        height: auto;
        min-height: 0;
        background: transparent;
        overflow: visible;
        display: block; 
        padding: 0;
    }

    .modal-image img {
        width: 100%;
        height: auto;
        max-height: 250px;
        object-fit: contain;
        margin-bottom: 0;
        display: block;
        background: #f4f4f4;
    }
    
    .modal-image img:only-child {
        height: auto;
        max-height: 250px;
        object-fit: contain;
    }

    .modal-details {
        width: 100%;
        padding: 30px 20px;
        overflow: visible;
    }
}