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

/* 1. Un fond moins plat (Dégradé subtil) */
body { 
    background: linear-gradient(135deg, #f0f2f5 0%, #e2e8f0 100%); 
    color: #1e293b; 
    height: 100vh; 
    overflow: hidden; 
}

.app-container { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 280px; background-color: #ffffff; border-right: 1px solid #e2e8f0; padding: 2rem 1.5rem; display: flex; flex-direction: column; overflow-y: auto; z-index: 200; }
.profile-section { text-align: center; margin-bottom: 2rem; }
.avatar-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem auto; border: 3px solid #f1f5f9; display: block; }
.avatar-placeholder { width: 120px; height: 120px; border-radius: 50%; background-color: #3b82f6; color: white; font-size: 2.5rem; font-weight: bold; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem auto; }
.profile-section h1 { font-size: 1.2rem; font-weight: 700; color: #0f172a; }
.profile-section .title { color: #3b82f6; font-size: 0.95rem; font-weight: 600; margin-top: 0.2rem; }

.side-info-block { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #e2e8f0; }
.side-info-block:last-child { border-bottom: none; margin-bottom: 0; }
.side-info-block h4 { font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.side-info-block p { font-size: 0.85rem; color: #475569; margin-bottom: 0.3rem; line-height: 1.4; }

/* Dashboard Global */
.dashboard { 
    flex: 1; 
    overflow-y: auto; 
    scroll-behavior: smooth; 
    position: relative;
}

.dashboard-content {
    padding: 2rem;
}

.intro-card { background: white; border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-left: 4px solid #3b82f6; }
.intro-card h2 { font-size: 1.1rem; margin-bottom: 0.5rem; color: #0f172a; }
.intro-card p { 
    font-size: 0.95rem; 
    color: #475569; 
    line-height: 1.6; 
    text-align: justify; /* Justifie le texte proprement */
}
/* Apparition fluide des colonnes au chargement de la page */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.columns-container { display: flex; gap: 1.5rem; align-items: flex-start; }
.column { 
    flex: 1; 
    background: #e2e8f080; 
    border-radius: 12px; 
    padding: 1rem; 
    min-width: 280px;
    opacity: 0; 
    animation: fadeIn 0.6s ease forwards;
}

/* Décalage de l'animation pour un effet cascade */
.column:nth-child(1) { animation-delay: 0.1s; }
.column:nth-child(2) { animation-delay: 0.25s; }
.column:nth-child(3) { animation-delay: 0.4s; }

.column-title { font-size: 0.85rem; color: #64748b; margin-bottom: 1rem; letter-spacing: 0.05em; font-weight: 600; text-transform: uppercase; }

/* ============================================================ */
/* LE FIL CHRONOLOGIQUE (TIMELINE) - ALIGNEMENT & Z-INDEX       */
/* ============================================================ */

.timeline-wrapper {
    position: relative;
    padding-left: 50px; 
}

/* La ligne verticale grise */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 50px;
    left: 20px; 
    width: 2px;
    background-color: #cbd5e1;
    z-index: 0; 
}

/* Les cartes individuelles */
.card { 
    background: #ffffff; 
    border-radius: 8px; 
    padding: 1.25rem; 
    margin-bottom: 1.5rem; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    transition: all 0.2s ease; 
}

.timeline-card { 
    cursor: pointer; 
    border: 1px solid transparent; 
    position: relative;
    z-index: 10; 
}

/* Le point (nœud) fixé sur la ligne */
.timeline-card::after {
    content: '';
    position: absolute;
    top: 30px; 
    left: -30px; 
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    border: 2px solid #94a3b8; 
    border-radius: 50%;
    z-index: 11;
    transition: all 0.3s ease;
    transform: translateX(-50%); 
}

/* Point Bleu Lumineux pour les cartes "En cours" */
.timeline-card.is-active::after {
    border-color: #3b82f6;
    background-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Au survol de la carte, le point gonfle et devient bleu */
.timeline-card:hover::after {
    border-color: #3b82f6;
    background-color: #3b82f6;
    transform: translateX(-50%) scale(1.2); 
}

/* La bordure bleue qui apparaît à gauche de la carte au survol */
.timeline-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #3b82f6;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
    border-radius: 8px 0 0 8px;
    z-index: 12;
}

.timeline-card:hover { 
    border-color: #cbd5e1; 
    transform: translateY(-3px); 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); 
}

.timeline-card:hover::before {
    transform: scaleY(1);
}

.static-card { cursor: default; }
.card-header { margin-bottom: 0.5rem; }

/* Logos d'entreprises */
.card-logo {
    height: 60px;
    max-width: 140px;
    object-fit: contain;
    opacity: 0.95;
    margin-left: 15px; 
}

/* Statuts et Animation "Pulse" */
.status { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 12px; font-weight: 600; }
.status.active { background-color: #dbeafe; color: #1d4ed8; }
.status.done { background-color: #f1f5f9; color: #475569; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.status.active::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #2563eb;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

.card h4 { font-size: 1rem; color: #0f172a; margin-bottom: 0.25rem; }
.card .company { font-size: 0.85rem; color: #64748b; margin-bottom: 1rem; font-weight: 500; }
.skill-desc { font-size: 0.85rem; color: #475569; line-height: 1.5; }

.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tags span { background: #f1f5f9; color: #475569; font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.tags span.soft-tag { background: #fef3c7; color: #b45309; }

/* Modal */
#modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 1; transition: opacity 0.3s ease; }
#modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-content { background: white; width: 90%; max-width: 600px; border-radius: 12px; padding: 2.5rem; position: relative; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); transform: translateY(0); transition: transform 0.3s ease; }
#modal-overlay.hidden .modal-content { transform: translateY(20px); }
#close-modal { position: absolute; top: 1rem; right: 1.5rem; font-size: 1.5rem; background: none; border: none; color: #64748b; cursor: pointer; }
.modal-title { font-size: 1.5rem; color: #0f172a; margin-bottom: 0.5rem; }
.modal-subtitle { color: #3b82f6; font-weight: 600; margin-bottom: 1.5rem; }
.modal-text { color: #475569; line-height: 1.6; }
.modal-text ul { margin-left: 1.5rem; margin-top: 1rem; }
.modal-text li { margin-bottom: 0.5rem; }

/* Liens sociaux dans la barre latérale */
.social-links { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.social-links a { color: #3b82f6; text-decoration: none; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; transition: color 0.2s; }
.social-links a:hover { color: #1d4ed8; text-decoration: underline; }

/* ============================================================ */
/* STYLES DES LIENS ET BOUTON DE LA BARRE LATÉRALE              */
/* ============================================================ */

/* Style pour le lien de contact (LinkedIn) */
.contact-link {
    color: #475569;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: #0077b5; 
    text-decoration: underline;
}

/* Animation d'attraction pour le bouton CV au chargement */
@keyframes highlight-btn {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    30% { transform: scale(1.05); background-color: #3b82f6; color: white; border-color: #3b82f6; box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Bouton Télécharger le CV */
.download-btn {
    display: block;
    margin-top: auto;
    padding: 0.8rem 1rem;
    background-color: #f1f5f9;
    color: #0f172a;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    animation: highlight-btn 1.5s ease-in-out 1s 2;
}

.download-btn:hover {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

/* ============================================================ */
/* TOP HEADER (Navigation & Contexte - Fixe et Unifiée)         */
/* ============================================================ */

.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95); /* Blanc opaque pour détacher des cartes */
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); /* Ombre légère pour effet flottant */
    
    display: flex;
    flex-direction: row; /* Aligné sur une seule ligne sur PC */
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0; /* Empêche ces blocs de s'écraser */
}

/* Menu des chapitres (Masqué sur PC) */
.page-chapters {
    display: none; /* On cache le menu par défaut */
}

.page-chapters a {
    text-decoration: none;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    background: white;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.page-chapters a:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    background: #eff6ff;
}

/* Évite que le menu sticky ne recouvre les titres lors du clic sur l'ancre */
#about, #experiences, #formations, #skills {
    scroll-margin-top: 100px; /* Espace compensé sur PC */
}

/* Bouton pour plier la Sidebar */
.icon-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Animation de la Sidebar */
.sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

.sidebar .profile-section, 
.sidebar .side-info-block, 
.sidebar .download-btn {
    min-width: 232px; 
}

.sidebar.collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
}

/* ============================================================ */
/* BADGE DE STATUT EN DIRECT (Dynamique)                        */
/* ============================================================ */
.live-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* 1. Vert (Alternance) */
.status-green { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.status-green .live-dot { background-color: #22c55e; animation: pulse-green 2s infinite; }

/* 2. Bleu (À l'écoute) */
.status-blue { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.status-blue .live-dot { background-color: #3b82f6; animation: pulse-blue 2s infinite; }

/* 3. Orange (En formation) */
.status-orange { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.status-orange .live-dot { background-color: #f97316; animation: pulse-orange 2s infinite; }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

/* Switch de langue FR / EN */
.lang-switch {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
}
.lang-switch a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}
.lang-switch a.active {
    color: #0f172a;
    font-weight: bold;
}
.lang-switch a:hover {
    color: #3b82f6;
}
.lang-switch .separator {
    margin: 0 0.3rem;
    color: #cbd5e1;
}

/* Bouton Contact du Header */
.header-contact-btn {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.header-contact-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

/* ============================================================ */
/* BOUTON FLOTTANT RETOUR EN HAUT                               */
/* ============================================================ */

#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #0f172a;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

#back-to-top:hover {
    background-color: #3b82f6;
    transform: translateY(-3px);
}

#back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* ============================================================ */
/* RESPONSIVE DESIGN (Smartphones & Tablettes)                  */
/* ============================================================ */

@media screen and (max-width: 1024px) {
    body, .app-container {
        height: auto;
        overflow: visible;
        flex-direction: column;
    }

    .dashboard {
        height: auto;
        overflow: visible;
    }

    .dashboard-content {
        padding: 1.5rem 1rem;
    }

    /* La barre latérale passe en haut */
    .sidebar {
        width: 100% !important; 
        max-width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        padding: 2rem 1.5rem;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        white-space: normal;
    }
    
    .sidebar.collapsed { padding: 2rem 1.5rem; }
    .sidebar .profile-section { grid-column: 1 / -1; text-align: center; }
    .sidebar .avatar-img, .sidebar .avatar-placeholder { margin: 0 auto 1rem auto; }
    .sidebar .download-btn { grid-column: 1 / -1; margin-top: 1rem; }

    #toggle-sidebar { display: none; }

    /* Réorganisation du Header en mode empilé */
    .top-header {
        flex-direction: column; 
        gap: 1rem;
        padding: 1rem;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap; 
    }

    .page-chapters {
        display: flex; /* On réaffiche le menu pour les petits écrans */
        justify-content: center;
        gap: 0.6rem;
        flex-wrap: wrap;
        width: 100%;
    }

    /* Compense la hauteur supplémentaire du header sur mobile */
    #about, #experiences, #formations, #skills {
        scroll-margin-top: 220px; 
    }

    /* Les colonnes s'empilent */
    .columns-container {
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
    }
    
    .column { min-width: 100%; }

    /* Modale adaptée */
    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 1.5rem;
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* Ajustements ultimes pour les très petits écrans */
@media screen and (max-width: 480px) {
    .live-status {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem; 
    }
    .sidebar { grid-template-columns: 1fr; }
}