/* =========================================
   1. VARIABLES & RESET
   ========================================= */
   :root {
    /* Palette Principale - Couleurs de feu et de terre */
    --primary: #f27121;         /* Orange Sunset (Chaud et dynamique) */
    --primary-hover: #e94057;   /* Vers un rouge corail au survol */
    
    /* Fonds - On remplace le noir pur par des tons chocolat/ardoise chaude */
    --dark-bg: #1a1614;         /* Fond café très sombre */
    --card-bg: #241f1c;         /* Gris chaud pour les cartes */
    
    /* Textes */
    --text-main: #fdf5f0;       /* Blanc crème (plus doux pour les yeux) */
    --text-muted: #bcaba0;      /* Beige grisé pour les infos secondaires */
    --text-dark: #2a2420;       
    
    /* Status - Adaptés au thème chaud */
    --status-completed: #4caf50; /* Vert feuille (naturel) */
    --status-ongoing: #ffb300;    /* Jaune ambre */

    /* Ombres et Effets */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 15px 40px rgba(242, 113, 33, 0.2); /* Lueur orange */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg); 
    color: var(--text-dark); 
    line-height: 1.7;
    overflow-x: hidden;
}

/* =========================================
   2. TYPOGRAPHY & CENTRAGE
   ========================================= */
h1, h2, h3 { text-align: center; }

.section-intro, 
.more-projects-info, 
.alternative-contact,
footer p {
    text-align: center;
    width: 100%;
    display: block;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--text-main); 
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--primary); 
    margin-bottom: 2.5rem; 
    font-size: 2.2rem; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h3 {
    color: var(--text-main); 
    font-size: 1.3rem; 
    font-weight: 500;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

a {
    color: var(--primary); 
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-hover); }

/* =========================================
   3. HEADER & NAV
   ========================================= */
header {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    display: flex; justify-content: center;
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 15px 30px; z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-right: auto; display: none; }
nav ul { list-style: none; display: flex; gap: 2.5rem; }
nav a { color: #ccc; font-weight: 500; font-size: 1rem; padding: 5px 0; position: relative; }
nav a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: 0; left: 0; background-color: var(--primary);
    transition: var(--transition);
}
nav a:hover::after, nav a.active::after { width: 100%; }
nav a:hover, nav a.active { color: var(--primary); }

.menu-toggle { display: none; flex-direction: column; cursor: pointer; }
.bar { height: 3px; width: 25px; background: var(--text-main); margin: 3px 0; transition: 0.3s; }

/* =========================================
   4. SECTIONS
   ========================================= */
section { width: 100%; padding: 100px 20px; position: relative; }

/* HOME */
section#home {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)), url('image/bg.jpg');
    background-size: cover; background-position: center; background-attachment: fixed;
}
.profile-pic {
    width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
    border: 4px solid var(--primary); 
    box-shadow: 0 0 30px rgba(219, 92, 92, 0.4);
    margin: 2rem 0; animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
#Who {
    padding: 12px 35px; background-color: var(--primary); color: #fff;
    font-weight: 600; border-radius: 50px; box-shadow: 0 5px 15px rgba(219, 92, 92, 0.4);
}
#Who:hover {
    background-color: var(--primary-hover); transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(219, 92, 92, 0.6);
}

/* ABOUT */
section#about { background-color: var(--dark-bg); }
.intro {
    background-color: var(--card-bg); padding: 50px; border-radius: 20px;
    box-shadow: var(--shadow-soft); max-width: 1000px; margin: 0 auto;
    text-align: left; border: 1px solid rgba(255,255,255,0.05);
}
.about-content { display: flex; flex-direction: column; gap: 40px; }
.about-text p strong { color: var(--text-main); }
.about-text p em { color: var(--primary); font-style: normal; }

/* Grille d'images "Clean" */
.static-gallery {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px; margin-top: 20px;
}
.static-gallery img {
    width: 100%; height: 160px; object-fit: cover;
    border-radius: 8px; 
    filter: grayscale(100%) brightness(0.8);
    transition: var(--transition);
    border: 1px solid transparent;
}
.static-gallery img:hover {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.03); border-color: var(--primary);
}

/* SKILLS */
section#cv { background-color: var(--light-bg); }
section#cv h2 { color: var(--primary); } 
.cv-content-wrapper {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 40px;
    max-width: 1200px; margin: 0 auto;
}
.skills-block {
    background-color: var(--card-bg); padding: 40px; border-radius: 20px;
    box-shadow: var(--shadow-soft); flex: 1 1 350px; max-width: 550px; text-align: left;
}
.skills-title { color: var(--text-main); display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 30px; }
.skills-title i { color: var(--primary); }
.category-title {
    color: var(--text-muted); border-bottom: 1px solid #444; padding-bottom: 5px; margin-bottom: 15px;
    text-transform: uppercase; font-size: 0.9rem; font-weight: 600;
}
.skills-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 2rem; }
.skill-tag {
    background: rgba(0,0,0,0.3); color: #ddd; border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
    display: flex; align-items: center; gap: 8px; cursor: default; transition: var(--transition);
}
.skill-tag i { color: var(--primary); }
.skill-tag:hover { background: #333; border-color: var(--primary); transform: translateY(-3px); }

/* CV CARD */
.cv-card {
    background: linear-gradient(135deg, #2a2a2a, #1f1f1f); border-radius: 20px; padding: 35px;
    flex: 1 1 350px; max-width: 500px; box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column; justify-content: space-between; text-align: left;
}
.cv-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
.cv-icon-box {
    width: 60px; height: 60px; background: rgba(255,255,255,0.05); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--primary);
}
.cv-role { color: var(--primary); font-weight: 600; margin: 0; }
.cv-status { font-size: 0.85rem; color: #888; margin: 0; }
.cv-body p { color: #ccc; }
.download-btn-premium {
    display: flex; align-items: center; justify-content: space-between;
    background-color: var(--primary); color: #fff; padding: 16px 24px; border-radius: 12px;
    font-weight: 600; transition: var(--transition);
}
.download-btn-premium:hover {
    background-color: var(--primary-hover); transform: translateY(-2px); color: #fff;
    box-shadow: 0 8px 20px rgba(219, 92, 92, 0.4);
}

/* =========================================
   5. PROJECTS
   ========================================= */
section#projects { background-color: var(--dark-bg); }

.filter-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.filter-btn {
    padding: 8px 20px; background: transparent; border: 1px solid #555; color: #ccc;
    border-radius: 30px; cursor: pointer; transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.05);
}

.projects-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 30px;
    max-width: 1200px; margin: 0 auto;
}

.project-card {
    background-color: var(--card-bg); border-radius: 16px; overflow: hidden;
    box-shadow: var(--shadow-soft); flex: 1 1 320px; max-width: 380px;
    display: flex; flex-direction: column; transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.03);
}

/* HOVER DYNAMIQUE PROJETS */
.project-card:hover { transform: translateY(-10px); }
/* Défaut */
.project-card:hover { border-color: rgba(219, 92, 92, 0.3); box-shadow: 0 15px 40px rgba(219, 92, 92, 0.15); }
/* Completed */
.project-card.completed:hover {
    border-color: var(--status-completed);
    box-shadow: 0 15px 40px rgba(40, 167, 69, 0.15);
}
/* Ongoing */
.project-card.ongoing:hover {
    border-color: var(--status-ongoing);
    box-shadow: 0 15px 40px rgba(255, 193, 7, 0.15);
}

.project-card h3 {
    background: rgba(0,0,0,0.2); padding: 15px 20px; margin: 0;
    font-size: 1.1rem; text-align: left; color: var(--text-main);
}

.status-tag {
    display: inline-block; padding: 4px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; margin-left: 10px; text-transform: uppercase;
    vertical-align: middle;
}
.status-tag.completed { background-color: rgba(40, 167, 69, 0.15); color: #28a745; border: 1px solid rgba(40, 167, 69, 0.3); }
.status-tag.ongoing { background-color: rgba(255, 193, 7, 0.15); color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.3); }

.project-card img { width: 100%; height: 210px; object-fit: cover; border-bottom: 1px solid rgba(255,255,255,0.05); }

.project-details { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; text-align: left; }

.project-details h4 {
    font-size: 1.1rem; margin-bottom: 1rem; color: var(--text-main);
    display: flex; align-items: center; gap: 10px;
}
.project-details h4 i { color: var(--primary); font-size: 1.3rem; }

.project-tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; margin-bottom: 20px; }
.tech-tag { font-size: 0.75rem; background: rgba(255,255,255,0.08); padding: 4px 10px; border-radius: 6px; color: #ccc; }

.project-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.project-button {
    flex: 1; text-align: center; background: transparent; border: 1px solid var(--primary);
    color: var(--primary); padding: 10px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500; transition: var(--transition);
}
/* Logique couleur bouton */
.project-card.completed .project-button { border-color: var(--status-completed); color: var(--status-completed); }
.project-card.ongoing .project-button { border-color: var(--status-ongoing); color: var(--status-ongoing); }

/* Hover boutons */
.project-button:hover { color: #fff !important; transform: translateY(-2px); }
.project-card .project-button:hover { background: var(--primary); box-shadow: 0 5px 15px rgba(219, 92, 92, 0.4); }
.project-card.completed .project-button:hover { background: var(--status-completed); box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4); }
.project-card.ongoing .project-button:hover { background: var(--status-ongoing); box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4); }

.project-button.disabled { border-color: #555 !important; color: #555 !important; pointer-events: none; }

/* =========================================
   6. CONTACT FORM & SOCIAL
   ========================================= */
section#contact { background-color: var(--card-bg); display: flex; flex-direction: column; align-items: center; }

.contact-form {
    width: 100%; max-width: 600px; margin: 0 auto; 
    display: flex; flex-direction: column; gap: 20px;
}
.form-group label { color: #ccc; margin-bottom: 8px; display: block; }
.form-group input, .form-group textarea {
    width: 100%; padding: 15px; background: #333; border: 1px solid #444;
    color: #fff; border-radius: 10px; font-family: inherit; transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); background: #383838;
}
.contact-button {
    padding: 16px; background: var(--primary); border: none; color: #fff;
    font-size: 1.1rem; font-weight: 600; border-radius: 10px; cursor: pointer;
    transition: var(--transition); width: 100%;
}
.contact-button:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* SOCIAL MEDIA */
footer { background: #111; padding: 50px 20px; text-align: center; color: #666; }

.social-media {
    background: transparent; padding: 0; 
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 30px;
}
.social-media h2 { margin-bottom: 1.5rem; color: #fff; }

.social-icons {
    display: flex; gap: 20px; justify-content: center;
}
.social-icons a {
    width: 60px; height: 60px;
    background: #333; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.social-icons a:hover {
    background: var(--primary); transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(219, 92, 92, 0.5);
}

/* =========================================
   7. LIGHTBOX (Version Pro & Moderne)
   ========================================= */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Fond noir profond transparent + Flou */
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    justify-content: center; align-items: center;
    z-index: 3000;
    opacity: 0; transition: opacity 0.4s ease;
}

.lightbox.active { display: flex; opacity: 1; }

.lightbox-overlay {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: -1;
}

.lightbox-content {
    position: relative;
    max-width: 85vw; max-height: 80vh;
    display: flex; flex-direction: column; align-items: center;
    transform: scale(0.95); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox.active .lightbox-content { transform: scale(1); }

.lightbox-content img, 
.lightbox-content video {
    max-width: 100%; max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: contain;
}

/* Boutons Lightbox */
.close-btn, .nav-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 3001;
}

.close-btn {
    top: 30px; right: 30px;
    width: 50px; height: 50px;
    font-size: 1.2rem;
}
.close-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.nav-btn {
    top: 50%; transform: translateY(-50%);
    width: 60px; height: 60px;
    font-size: 1.2rem;
}
.prev-btn { left: 40px; }
.next-btn { right: 40px; }

.nav-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.hidden { display: none; visibility: hidden; }

#caption {
    margin-top: 20px;
    color: #eee;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0; animation: fadeIn 0.5s ease 0.3s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

/* Utils */
#backToTop {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: var(--primary); color: #fff; border-radius: 50%;
    display: none; align-items: center; justify-content: center; z-index: 999;
    box-shadow: 0 5px 15px rgba(219, 92, 92, 0.4);
    transition: var(--transition);
}
#backToTop:hover { transform: translateY(-5px); background: var(--primary-hover); }
/* =========================================
   8. RESPONSIVE MOBILE (VERSION FINALE)
   ========================================= */
   @media screen and (max-width: 900px) {
    
    /* 1. Structure Globale */
    html, body {
        width: 100%;
        overflow-x: hidden;
        font-size: 16px;
    }

    section {
        padding: 40px 15px !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        align-items: center;
    }

    /* 2. Header & Burger */
    header {
        justify-content: space-between;
        padding: 15px 20px;
        height: 70px;
        background: #1a1a1a; 
    }

    .logo, .menu-toggle {
        display: flex;
        z-index: 1002;
    }

    nav ul {
        position: fixed; top: 0; left: 0;
        width: 100vw; height: 0;
        background-color: var(--dark-bg);
        flex-direction: column; align-items: center; justify-content: center;
        overflow: hidden; transition: height 0.4s ease-in-out;
        z-index: 1001; gap: 30px; margin: 0; padding: 0;
    }

    nav ul.mobile-visible { height: 100vh; }
    nav a { font-size: 1.5rem; padding: 10px; display: block; }

    /* 3. Contenu Adapté */
    h1 { font-size: 2rem; margin-top: 1rem; }
    h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
    
    .intro, .skills-block, .cv-card, .project-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 30px 0;
        padding: 20px;
        height: auto !important;
    }

    /* 4. PROJETS : FIX DESCRIPTION & BOUTONS */
    .projects-grid {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .project-card {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 30px;
        display: flex;
        flex-direction: column;
        overflow: visible !important;
    }

    .project-card img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        flex-shrink: 0;
    }

    .project-details {
        width: 100% !important;
        padding: 20px 15px !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* --- LE TEXTE (Blanc & Lisible) --- */
    .project-details p {
        font-size: 1rem !important;
        color: #ffffff !important;
        line-height: 1.5 !important;
        opacity: 1 !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }

    .project-details h4 {
        color: var(--primary);
        margin-bottom: 10px;
        font-size: 1.1rem;
    }

    /* --- BOUTONS (Style PC : Transparent + Bordure) --- */
    .project-buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 15px;
        margin-top: 15px;
    }

    .project-button {
        width: 100%;
        box-sizing: border-box;
        padding: 15px;
        text-align: center;
        background-color: transparent; /* Transparent comme sur PC */
        border: 1px solid var(--primary);
        color: var(--primary);
        font-weight: 600;
    }

    /* Couleurs selon statut (sans fond bizarre) */
    .project-card.completed .project-button { 
        border-color: var(--status-completed); 
        color: var(--status-completed); 
        background-color: transparent;
    }
    .project-card.ongoing .project-button { 
        border-color: var(--status-ongoing); 
        color: var(--status-ongoing); 
        background-color: transparent;
    }

    /* 5. Social Media */
    .social-icons { flex-wrap: wrap; gap: 15px; }
    .social-icons a { width: 50px; height: 50px; font-size: 1.5rem; }

    /* 6. Lightbox Mobile */
    .lightbox-content { width: 100vw; transform: none; }
    .lightbox-content img { max-width: 95%; max-height: 50vh; }
    .nav-btn { display: none !important; } 
    .close-btn { top: 15px; right: 15px; background: rgba(0,0,0,0.5); }
    #caption { font-size: 0.9rem; padding: 10px; width: 90%; margin-bottom: 80px; }
}