/* =========================================
   1. CONFIGURATION GLOBALE & VARIABLES
   ========================================= */
:root {
    --bg-dark: #05050a;
    --neon-cyan: #00f3ff;
    --neon-purple: #bc13fe;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   2. FOND ANIMÉ & HEADER
   ========================================= */
.background-container {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1; overflow: hidden; background: var(--bg-dark);
    transition: background 0.3s ease;
}
.gradient-sphere {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
    animation: float 10s infinite alternate ease-in-out;
}
.sphere-1 { width: 600px; height: 600px; background: var(--neon-cyan); top: -100px; left: -100px; }
.sphere-2 { width: 500px; height: 500px; background: var(--neon-purple); bottom: -100px; right: -100px; animation-delay: -5s; }
.noise-overlay {
    position: absolute; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg'); opacity: 0.05; pointer-events: none;
}
@keyframes float { to { transform: translate(50px, 30px) scale(1.1); } }

/* HEADER */
.header {
    position: fixed; width: 100%; top: 0; z-index: 1000;
    background: rgba(5, 5, 10, 0.7); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    transition: background 0.3s ease;
}
.nav-container {
    display: flex; justify-content: space-between; align-items: center;
    height: 80px; padding: 0 5%; max-width: 1400px; margin: 0 auto;
}
.logo { 
    font-family: var(--font-heading); font-size: 1.8rem; font-weight: 900;
    color: var(--neon-cyan); text-shadow: 0 0 15px rgba(0, 243, 255, 0.6); text-decoration: none;
}

/* MENU ORDI */
.nav-menu { flex-grow: 1; display: flex; justify-content: center; }
.nav-list { display: flex; gap: 1.5rem; list-style: none; align-items: center; }
.nav-link {
    position: relative; color: #e0e0e0; text-decoration: none;
    font-family: var(--font-body); font-weight: 600; font-size: 1.1rem;
    text-transform: uppercase; letter-spacing: 1px; transition: 0.3s ease; padding: 5px 0;
}
.nav-link:hover { color: white; text-shadow: 0 0 8px var(--neon-cyan); }
.nav-link::after {
    content: ''; position: absolute; width: 0%; height: 2px; bottom: 0; left: 0;
    background-color: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

.contact-btn {
    border: 1px solid var(--neon-purple); padding: 6px 18px; border-radius: 4px; color: var(--neon-purple);
}
.contact-btn:hover { background: var(--neon-purple); color: white; box-shadow: 0 0 15px rgba(188, 19, 254, 0.6); }

/* BOUTON LUNE/SOLEIL */
#theme-toggle {
    background: transparent; border: none; color: white; font-size: 1.2rem;
    cursor: pointer; margin-left: 20px; transition: color 0.3s;
}

/* HAMBURGER */
.hamburger {
    display: none; cursor: pointer; z-index: 2000; width: 30px; height: 30px; margin-left: 15px;
}
.bar {
    display: block; width: 25px; height: 3px; margin: 5px auto;
    background-color: white; border-radius: 3px; transition: all 0.3s ease-in-out;
}

/* =========================================
   3. SECTIONS & HERO
   ========================================= */
.section { padding: 5rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.section-title { 
    font-family: var(--font-heading); font-size: 2.5rem; text-align: center; margin-bottom: 3rem; 
    color: var(--text-main); text-shadow: 2px 2px 0px var(--neon-purple);
}

.hero-section {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding-top: 120px; padding-bottom: 50px; position: relative; z-index: 1;
}
.hero-content { display: flex; flex-direction: column; align-items: center; max-width: 900px; margin: 0 auto; }
.hero-content h1 {
    font-size: 3rem; font-family: var(--font-heading);
    background: linear-gradient(to right, #fff, var(--neon-cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem; text-transform: uppercase; line-height: 1.2;
}
.profile-wrapper { margin-bottom: 2rem; position: relative; z-index: 10; }
.profile-pic {
    width: 180px; height: 180px; object-fit: cover; object-position: 50% 35%; 
    transform: scale(1.25); border-radius: 50%; border: 3px solid var(--neon-purple);
    box-shadow: 0 0 30px rgba(188, 19, 254, 0.4); background-color: #1a1a2e; display: block;
}
.greeting { display: block; color: var(--neon-purple); font-weight: 700; margin-bottom: 15px; font-size: 1.4rem; letter-spacing: 2px; }
.hero-text { max-width: 700px; margin: 0 auto 2.5rem; color: var(--text-muted); font-size: 1.1rem; }

.cta-group { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; }
.btn {
    padding: 1rem 2rem; border: none; font-family: var(--font-heading); font-weight: 700;
    cursor: pointer; transition: all 0.3s ease; text-decoration: none;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}
.btn-filled { background: var(--neon-cyan); color: #000; box-shadow: 0 0 15px rgba(0, 243, 255, 0.4); }
.btn-filled:hover { transform: translateY(-3px); box-shadow: 0 0 30px rgba(0, 243, 255, 0.8); }
.btn-outline { background: transparent; color: var(--neon-cyan); box-shadow: inset 0 0 0 2px var(--neon-cyan); }
.btn-outline:hover { background: var(--neon-cyan); color: #000; box-shadow: 0 0 20px var(--neon-cyan); }

/* =========================================
   4. CARTES
   ========================================= */
.skills-grid, .projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.skill-card, .project-card, .education-card {
    background: var(--glass-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border);
    padding: 2rem; border-radius: 15px; transition: 0.4s ease; position: relative; overflow: hidden;
}
.skill-card:hover, .project-card:hover, .education-card:hover {
    transform: translateY(-5px); border-color: var(--neon-cyan); box-shadow: 0 10px 30px rgba(188, 19, 254, 0.2);
}
.skill-icon { font-size: 2.5rem; color: var(--neon-cyan); margin-bottom: 1rem; }
.tags span {
    background: rgba(0, 243, 255, 0.1); color: var(--neon-cyan); border: 1px solid var(--neon-cyan);
    padding: 4px 10px; border-radius: 5px; font-size: 0.8rem; display: inline-block; margin: 2px;
}
a.skill-card, a.education-card { text-decoration: none; color: inherit; display: block; cursor: pointer; }

/* STYLE FORMATION */
.education-card {
    display: flex; flex-direction: row; align-items: center; 
    gap: 3rem; max-width: 900px; margin: 0 auto; text-align: left;
}
.logo-wrapper { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.edu-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.edu-content h3 { color: var(--neon-cyan); font-size: 1.8rem; font-family: var(--font-heading); margin-bottom: 0.5rem; }
.diploma { color: white; font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.description { color: var(--text-muted); margin-bottom: 1rem; font-size: 1rem; }
.edu-date {
    display: inline-block; background: rgba(188, 19, 254, 0.1); color: var(--neon-purple);
    padding: 5px 15px; border-radius: 20px; font-weight: 600; font-size: 0.9rem; border: 1px solid var(--neon-purple);
}

/* =========================================
   5. CONTACT & FOOTER
   ========================================= */
#contact .container { display: flex; flex-direction: column; align-items: center; text-align: center; }
#contact p { margin-bottom: 3rem; font-size: 1.2rem; color: var(--text-muted); max-width: 600px; }
.contact-links { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; }

/* =========================================
   6. RESPONSIVE (MOBILE & TABLETTE)
   ========================================= */

/* --- A. TABLETTE & PETIT PC (max-width: 1024px) --- */
@media (max-width: 1024px) {
    /* 1. On affiche le bouton Hamburger */
    .hamburger { display: block; }
    
    /* 2. On configure le menu glissant */
    .nav-menu {
        position: fixed;
        right: -100%;           /* Caché à droite */
        top: 80px;              /* Sous le header */
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-dark); /* S'adapte au thème ! */
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 3rem;
        transition: 0.4s ease;
        border-top: 1px solid rgba(255,255,255,0.1);
        z-index: 998;
    }

    /* 3. Classe activée par JS pour montrer le menu */
    .nav-menu.active { right: 0; }
    
    .nav-list { flex-direction: column; gap: 2.5rem; }
    
    /* Bouton thème aligné à droite */
    #theme-toggle { margin-left: auto; margin-right: 1.5rem; }
}

/* --- B. VRAI MOBILE (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Empilement des cartes formation */
    .education-card {
        flex-direction: column; text-align: center; gap: 1.5rem; padding: 2rem 1.5rem;
    }
    .logo-wrapper { width: 120px; height: 120px; }
    .hero-content h1 { font-size: 2rem; }
    .cta-group { flex-direction: column; }
}

/* --- ANIMATION HAMBURGER --- */
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* =========================================
   7. MODE CLAIR (LIGHT MODE)
   ========================================= */
body.light-mode {
    --bg-dark: #f0f2f5; --text-main: #1a1a2e; --text-muted: #444455;
    --glass-bg: rgba(255, 255, 255, 0.6); --glass-border: rgba(0, 0, 0, 0.1);
    --neon-cyan: #007acc; --neon-purple: #800080;
}
body.light-mode, body.light-mode .background-container {
    background-color: var(--bg-dark) !important; background: var(--bg-dark) !important; color: var(--text-main) !important;
}
body.light-mode .header { background: rgba(255, 255, 255, 0.9); border-bottom: 1px solid #ddd; }
body.light-mode .nav-link { color: #333; } /* Lien foncé sur fond clair */
body.light-mode .nav-link:hover { color: var(--neon-cyan); }
body.light-mode #theme-toggle { color: #333; }
body.light-mode .bar { background-color: #333; } /* Hamburger noir en mode clair */
body.light-mode .gradient-sphere { opacity: 0.15; filter: blur(100px); }