/* RESET ET VARIABLES */
:root {
    --primary-color: #4ade80; /* Vert néon */
    --primary-strong: #22c55e; /* Vert profond */
    --accent-pink: #4ade80; /* réutilisé pour le vert néon de la timeline */
    --accent-pink-strong: #22c55e;
    --dark-bg: #050b12;       /* Fond principal sombre */
    --panel-bg: #0f172a;      /* Cartes / panneaux */
    --border-glow: rgba(74, 222, 128, 0.35);
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #e2e8f0;
    --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: radial-gradient(circle at 20% 20%, rgba(74, 222, 128, 0.08), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(34, 197, 94, 0.08), transparent 20%),
                #050b12;
}

/* UTILITAIRES */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.bg-dark {
    /* Make panels slightly transparent so the 3D background remains visible */
    background-color: rgba(15, 23, 42, 0.18);
    color: var(--text-light);
    border: 1px solid var(--border-glow);
    box-shadow: var(--card-shadow);
    border-radius: 12px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* HEADER [cite: 26] */
header {
    background: linear-gradient(90deg, rgba(16, 24, 40, 0.9), rgba(5, 11, 18, 0.9));
    color: #fff;
    padding: 1rem 0;
    position: sticky; /* Le menu reste en haut */
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-glow);
    backdrop-filter: blur(8px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

/* SECTIONS GÉNÉRALES */
section {
    padding: 3rem 0;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
}

/* ABOUT & PROFILE */
.profile-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    /* Keep the space background visible behind the cards */
    background: rgba(15, 23, 42, 0.18);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-glow);
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.photo-placeholder {
    width: 150px;
    height: 150px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 2rem;
}

/* COMPÉTENCES */
.skills-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.skill-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(5, 11, 18, 0.25));
    padding: 1.5rem;
    border-radius: 8px;
    flex: 1;
    min-width: 250px;
    border: 1px solid var(--border-glow);
    box-shadow: var(--card-shadow);
}

.skill-card ul {
    list-style-type: square;
    margin-left: 1.5rem;
}

/* PROJETS */
.projects-category {
    margin-bottom: 2.5rem;
}

.projects-category h3 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary-color);
}

.projects-category h3::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--primary-color);
    opacity: 0.25;
}

.projects-category h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.project-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.28), rgba(5, 11, 18, 0.25));
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-glow);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(74, 222, 128, 0.15);
}

.project-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(74, 222, 128, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-strong));
    color: #0a0f18;
    padding: 0.6rem 1.2rem;
    margin-top: 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-glow);
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.7);
}

.lang-toggle {
    margin-left: 1rem;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 999px;
    min-width: 48px;
}

/* SCOLARITE - TIMELINE VERTICALE */
.scolarite-section {
    position: relative;
    overflow: hidden;
}

.edu-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0 1rem;
}

.edu-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--accent-pink), var(--accent-pink-strong));
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.5);
}

.edu-item {
    position: relative;
    width: 50%;
    padding: 1.5rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.edu-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.edu-item.left {
    left: 0;
    text-align: right;
}

.edu-item.right {
    left: 50%;
}

.edu-item .edu-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-strong));
    color: #0a0f18;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

.badge-college {
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.45);
}

.badge-lycee {
    background: linear-gradient(135deg, #a3e635, #65a30d);
    box-shadow: 0 0 12px rgba(163, 230, 53, 0.45);
}

.badge-bachelor {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}

.edu-card {
    margin-top: 0.8rem;
    background: linear-gradient(145deg, rgba(25, 33, 52, 0.25), rgba(8, 13, 24, 0.22));
    border: 1px solid rgba(236, 72, 153, 0.35);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    position: relative;
}

.edu-card::before {
    content: "";
    position: absolute;
    top: 1.2rem;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-strong));
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.6);
}

.edu-item.left .edu-card::before {
    right: -7px;
}

.edu-item.right .edu-card::before {
    left: -7px;
}

.edu-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.1);
    color: var(--accent-pink);
    text-align: center;
    line-height: 32px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Share Tech Mono', monospace;
}

.edu-card h3 {
    margin: 0 0 0.3rem 0;
    color: var(--text-light);
}

.edu-school {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.edu-desc {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .edu-item {
        width: 100%;
        left: 0 !important;
        text-align: left;
        padding: 1.25rem 1rem 1.25rem 3.5rem;
    }

    .edu-timeline::before {
        left: 24px;
        transform: none;
    }

    .edu-item .edu-card::before {
        left: -7px;
        right: auto;
    }
}

/* EXPÉRIENCE PRO */
.experience-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.25), rgba(5, 11, 18, 0.22));
    border: 1px solid var(--border-glow);
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--text-light);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.experience-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.experience-card .date {
    color: var(--text-muted);
    font-weight: 600;
}

.experience-skills {
    margin-top: 1rem;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.experience-skills li {
    margin-bottom: 0.4rem;
}

/* CONTACT */
.contact-info {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input, 
.contact-form textarea {
    padding: 0.8rem;
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.25);
    color: var(--text-light);
}

.contact-cta {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.cta-card {
    width: 100%;
    max-width: 720px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.25), rgba(5, 11, 18, 0.22));
    border: 1px solid var(--border-glow);
    box-shadow: var(--card-shadow);
    border-radius: 14px;
    padding: 1.5rem;
}

.cta-header h3 {
    margin: 0 0 0.3rem 0;
    color: var(--text-light);
}

.cta-header p {
    margin: 0 0 1rem 0;
    color: var(--text-muted);
}

.cta-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.08);
    color: var(--text-light);
    border: 1px solid var(--border-glow);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.45);
    background: rgba(74, 222, 128, 0.14);
}

.cta-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.4));
}

/* FOOTER */
footer {
    text-align: center;
    padding: 1.5rem;
    background: #0b1220;
    color: #7dd3fc;
    border-top: 1px solid var(--border-glow);
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.modal.visible { display: block; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 11, 18, 0.75);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 980px;
    margin: 5vh auto;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(5, 11, 18, 0.95));
    border: 1px solid var(--border-glow);
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
    border-radius: 14px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border-glow);
}

.modal-header h3 { color: var(--text-light); margin: 0; }

.modal-actions { display: flex; gap: 0.5rem; }
.modal-fullscreen {
    background: rgba(74, 222, 128, 0.12);
    color: var(--text-light);
    border: 1px solid var(--border-glow);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

.modal-close {
    background: rgba(74, 222, 128, 0.12);
    color: var(--text-light);
    border: 1px solid var(--border-glow);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-body { padding: 1rem; }

.embed-wrapper iframe { border-radius: 10px; }
.embed-wrapper object { border-radius: 10px; }

.pdf-actions { margin-top: 0.8rem; display: flex; justify-content: flex-end; }

/* Fullscreen modal state */
.modal-content.fullscreen {
    max-width: 98vw;
    margin: 2vh auto;
}

.modal-content.fullscreen .modal-header { display: none; }
.modal-content.fullscreen .pdf-embed { height: 90vh; }
.modal-content.fullscreen .pdf-actions { display: none; }

.modal-fs-controls {
    display: none;
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    gap: 0.5rem;
}

.modal-content.fullscreen .modal-fs-controls { display: flex; }
.modal-exit-fullscreen {
    background: rgba(74, 222, 128, 0.18);
    color: var(--text-light);
    border: 1px solid var(--border-glow);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

.loader {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
}

.loader.hidden { display: none; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(74, 222, 128, 0.25);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .modal-content { margin: 3vh 1rem; }
    .embed-wrapper iframe { height: 320px; }
    .embed-wrapper object { height: 320px; }
}

/* --- RESPONSIVE DESIGN (OBLIGATOIRE [cite: 21]) --- */
/* C'est ici que la magie opère pour les mobiles */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        padding-top: 1rem;
    }

    nav ul li {
        margin: 10px 0;
    }

    .profile-card {
        flex-direction: column;
        text-align: center;
    }

    /* Évite le scroll horizontal involontaire [cite: 64] */
    .container {
        padding: 1rem; 
        width: 100%;
    }
}

/* --- Spline 3D keyboard overlay --- */
#spline-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: auto;
    touch-action: pan-y;
}

/* --- Background Particles (port of 3d-portfolio Particles.tsx) --- */
#particles-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Keep your content above the 3D canvas */
section, footer {
    position: relative;
    z-index: 2;
}

/* 3D hero main section */
.hero-3d {
    min-height: 100vh;
    padding-top: 4rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* avoid blocking mouse interactions with the Spline canvas */
    pointer-events: none;
}

.hero-3d-overlay {
    pointer-events: none;
    text-align: center;
    margin-top: 3rem;
    position: relative;
    z-index: 20;
}

.hero-3d-title {
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 800;
    color: var(--text-light);
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.25);
}

.hero-3d-sub {
    margin-top: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Spline debug overlay */
#spline-status {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2500;
    padding: 10px 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    color: #e2e8f0;
    background: rgba(5, 11, 18, 0.7);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 10px;
    pointer-events: none;
    max-width: 320px;
}

/* --- "Category" UI for active 3D section --- */
.section-3d-category {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    margin: 0.2rem 0 1.4rem 0;
    position: relative;
    z-index: 20;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.08);
    color: var(--text-light);
    opacity: 0.45;
    transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.section-3d-category-title {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.section-3d-category-sub {
    color: var(--text-muted);
    font-weight: 600;
}

.is-3d-active.bg-dark {
    /* Increase visibility when the 3D keyboard targets the section */
    /* More transparent so the 3D keyboard is perceived as part of the section */
    background-color: rgba(15, 23, 42, 0.35);
    border-color: rgba(74, 222, 128, 0.65);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 28px rgba(74, 222, 128, 0.18);
}

.is-3d-active .section-3d-category {
    opacity: 1;
    background: rgba(74, 222, 128, 0.16);
    border-color: rgba(74, 222, 128, 0.7);
}