/* --- 1. CONFIGURATION DES COULEURS --- */
:root {
    /* MODE CLAIR */
    --bg-color: #cdcdcd;
    --text-color: #000000;
    --accent-color: #0000ff; /* Bleu */
    --card-bg: #e0e0e0;
    --border-color: #000000;
}

/* MODE SOMBRE */
body.dark-mode {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --accent-color: #00ff00; /* Vert */
    --card-bg: #1a1a1a;
    --border-color: #ffffff;
}

/* --- 2. GLOBAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Clash Display', sans-serif;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

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

/* --- 3. NAV --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: absolute; 
    top: 0;
    width: 100%;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-img {
    height: 90px;
    width: auto;
    border-radius: 8px;
    display: block;
    object-fit: contain;
    transition: height 0.3s ease;
}

.menu {
    display: flex;
    align-items: center;
    gap: 50px; 
    mix-blend-mode: difference;
    color: white; 
}

.theme-btn {
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--text-color); 
    color: var(--text-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #0000ff;
    border-radius: 50%;
    box-shadow: 0 0 10px #0000ff;
}
body.dark-mode .status-dot { 
    background-color: #00ff00; 
    box-shadow: 0 0 10px #00ff00;
}

.about-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--bg-color);
    transform: scale(1.05);
}

/* --- 4. HERO SECTION (HOME) --- */
.hero {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: 60px;
}

.hero-text { text-align: center; }

.hero-text h1 {
    font-size: 10vw;
    line-height: 0.85;
    text-transform: uppercase;
}

.hero-subtitle {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color);
}

.outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--text-color);
}

/* --- 5. MARQUEE --- */
.marquee-container {
    border-top: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    padding: 1rem 0;
    overflow: hidden;
    white-space: nowrap;
    background: var(--accent-color);
    color: var(--bg-color);
    transition: padding 0.3s ease;
}

.marquee-content {
    display: inline-block;
    font-size: 2rem;
    font-weight: 600;
    animation: scroll 20s linear infinite;
    transition: font-size 0.3s ease;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --- 6. PROJETS (GRID) --- */
.gallery { padding: 5rem 5%; }

.gallery-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.gallery-header-row h2 { font-size: 3rem; text-transform: uppercase; }

.filters { display: flex; gap: 15px; flex-wrap: wrap; }

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Clash Display', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    text-transform: uppercase;
    transition: 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    opacity: 1;
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.accent-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    margin-bottom: 4rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.project-card { cursor: pointer; width: 100%; }

.media-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: var(--card-bg);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.media-wrapper img, .media-wrapper video {
    width: 100%; height: 100%; object-fit: cover; z-index: 1; position: relative;
}

.project-card:hover .media-wrapper {
    transform: scale(0.98);
    border-color: var(--accent-color);
}

/* --- MINIATURES : Le bouton Play --- */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 2;
    color: white;
    border: 2px solid white; 
    background: transparent;
    mix-blend-mode: difference;
    transition: transform 0.3s ease;
}

.project-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.2);
}

.project-info h3 { font-size: 1.5rem; }
.project-info p { color: var(--accent-color); font-family: monospace; }

/* Placeholders Web */
.web-placeholder { background-color: var(--card-bg); border: 1px dashed var(--accent-color); }
.browser-mockup {
    width: 80%; height: 70%; background: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: 8px;
    display: flex; flex-direction: column; overflow: hidden;
}
.browser-header { height: 25px; background: var(--border-color); display: flex; align-items: center; padding-left: 10px; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-color); }
.browser-content { flex-grow: 1; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--accent-color); font-size: 0.8rem; }


/* ================================================================= */
/* --- 7. ABOUT PAGE (AJUSTEMENTS TAILLES) --- */
/* ================================================================= */

.about-section {
    padding: 6rem 5% 4rem; /* Réduit un peu le padding haut */
    min-height: 100vh;
}

.big-title {
    font-size: 4rem; /* Réduit de 5rem à 4rem */
    line-height: 0.9;
    margin-bottom: 3rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2rem;
}

.intro-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    margin-bottom: 6rem;
}

/* SECTION VOLLEY */
.volley-section {
    margin-top: 8rem; 
}

.volley-section h3 {
    font-size: 2rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.intro-text {
    flex: 1;
    font-size: 1.15rem; /* Réduit de 1.5rem à 1.15rem pour plus de finesse */
    line-height: 1.6;
}

.intro-text p {
    margin-bottom: 1.5rem;
}

.intro-image {
    flex: 1;
    max-width: 320px; /* Réduit de 400px à 320px pour que ce soit moins imposant */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.intro-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 0 transparent; 
    transition: all 0.3s ease;
}

.intro-image img:hover {
    box-shadow: 10px 10px 0px var(--accent-color);
    transform: translate(-5px, -5px);
}

.cv-button {
    margin-top: 10px;
    font-size: 1rem;
    padding: 12px 30px;
    background: var(--card-bg);
}

/* Grille des logiciels */
.software-section {
    margin-bottom: 6rem;
}

.software-section h3 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--text-color);
    margin-bottom: 2rem;
    display: inline-block;
    text-transform: uppercase;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.soft-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: 0.3s;
    text-align: center;
}

.soft-item:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.soft-item i, .soft-item svg {
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    fill: currentColor; 
}

.soft-item span {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}


/* --- 8. FOOTER --- */
footer {
    padding: 4rem 5%;
    border-top: 1px solid var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 6rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-socials {
    display: flex;
    gap: 30px;
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-icon svg {
    width: 1.8rem;
    height: 1.8rem;
}

.footer-icon:hover {
    color: var(--accent-color);
    transform: translateY(-5px);
}

.footer-copy {
    font-size: 0.8rem;
    opacity: 0.6;
    font-family: monospace;
    margin-top: 10px;
}


/* --- 9. MODAL & SLIDER --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

/* Modal Container Standard */
.modal-container {
    position: relative;
    background: rgba(230, 230, 230, 0.7); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.dark-mode .modal-container {
    background: rgba(20, 20, 20, 0.7);
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white; 
    border-radius: 50%; 
    width: 40px;
    height: 40px;
    border: none;
    font-size: 1.5rem;
    color: black; 
    cursor: pointer;
    z-index: 2000; 
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.close-btn:hover { 
    transform: scale(1.1);
    background: var(--accent-color);
    color: white;
}

.modal-content { display: flex; height: 100%; width: 100%; }

.modal-media {
    flex: 2;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 30px; 
}

.slider-container { 
    width: 100%; 
    height: 100%; 
    position: relative; 
    overflow: hidden; 
    border-radius: 8px;
}

.slides-wrapper { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    transition: transform 0.5s ease-in-out; 
}

.slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img, .slide video { 
    max-width: 95%; 
    max-height: 95%; 
    object-fit: contain; 
    border-radius: 4px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
}

.nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1); color: white;
    border: none; width: 50px; height: 50px; font-size: 1.5rem;
    cursor: pointer; border-radius: 50%; backdrop-filter: blur(5px);
    transition: 0.3s; z-index: 5;
    display: none;
    align-items: center; justify-content: center;
}
.nav-btn:hover { background: var(--accent-color); }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* Infos Modale */
.modal-info {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    
    /* CORRECTION ICI : flex-start pour aligner le titre en haut */
    justify-content: flex-start; 
    
    background: transparent; 
    color: var(--text-color);
    overflow-y: auto;
    
    /* Scrollbar fine pour l'esthétique */
    scrollbar-width: thin; 
    scrollbar-color: var(--accent-color) transparent;
}

#modal-title { 
    font-size: clamp(1.5rem, 2vw, 2.5rem);
    line-height: 0.9; 
    margin-bottom: 2rem; 
    text-transform: uppercase; 
    color: var(--accent-color);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    padding-right: 50px; 
}

.modal-desc { 
    border-radius: 20px;
    padding: 20px;
    background: transparent;
    font-size: 1.1rem; 
    line-height: 1.6; 
    margin-bottom: 3rem; 
    color: var(--text-color);
}

.modal-tools h4 { font-size: 0.9rem; margin-bottom: 1rem; opacity: 0.5; letter-spacing: 2px; text-transform: uppercase; }
.tools-icons { display: flex; gap: 20px; font-size: 2.5rem; }


/* --- 10. REVIEWS (AVIS) --- */
.reviews-section { 
    margin-top: 6rem; 
    width: 100%; 
}

.reviews-section h3 { 
    font-size: 1.2rem; 
    text-transform: uppercase; 
    margin-bottom: 3rem; 
    border-bottom: 1px solid var(--text-color); 
    display: inline-block; 
}

.reviews-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 60px; 
    align-items: start; 
}

.review-card { 
    background-color: var(--card-bg); 
    border: 1px solid var(--border-color); 
    padding: 2.5rem; 
    border-radius: 8px; 
    transition: transform 0.3s ease, border-color 0.3s ease; 
}

.review-card:hover { 
    border-color: var(--accent-color); 
    transform: translateY(-5px); 
}

.review-header { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 1.5rem; 
}

.review-avatar { 
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    background: var(--text-color); 
    color: var(--bg-color); 
    overflow: hidden; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 1.2rem; 
    border: 2px solid var(--accent-color); 
    flex-shrink: 0; 
}

.review-avatar img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.review-author h4 { 
    font-size: 1.1rem; 
    margin-bottom: 2px; 
}

.review-author p { 
    font-size: 0.85rem; 
    font-family: monospace; 
    color: var(--accent-color); 
    opacity: 0.8; 
}

.review-content p { 
    font-size: 0.95rem; 
    line-height: 1.6; 
    font-style: italic; 
    opacity: 0.9; 
    display: -webkit-box; 
    -webkit-line-clamp: 4; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    transition: max-height 0.5s ease; 
}

.review-content.expanded p { 
    -webkit-line-clamp: unset; 
    overflow: visible; 
}

.read-more-btn { 
    background: none; 
    border: none; 
    color: var(--text-color); 
    font-weight: 700; 
    cursor: pointer; 
    margin-top: 15px; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    padding: 0; 
}

.read-more-btn:hover { 
    color: var(--accent-color); 
    text-decoration: underline; 
}


/* ================================================================= */
/* RESPONSIVE MOBILE & TABLETTE (Nouvelle limite 1100px)             */
/* ================================================================= */

@media (max-width: 1100px) {
    
    /* 1. NAVBAR et LOGO */
    .navbar { 
        align-items: center; 
        padding: 1rem 5%;    
    }
    .logo-img { height: 40px; width: auto; } 
    .menu { flex-direction: column; gap: 10px; align-items: flex-end; }
    
    /* 2. HERO et MARQUEE */
    .marquee-container { padding: 0.5rem 0; }
    .marquee-content { font-size: 1rem; animation-duration: 15s; }
    .hero-text h1 { font-size: 15vw; }
    .hero-subtitle { font-size: 1rem; }
    
    /* 3. GRILLE PROJETS */
    .grid-container { grid-template-columns: 1fr; gap: 30px; }
    .gallery { padding: 3rem 5%; }
    .gallery-header-row h2 { font-size: 2rem; }
    
    /* --- 4. OPTIMISATION "ABOUT ME" (Who Am I) --- */
    .about-section { padding-top: 6rem; }
    
    .big-title { 
        font-size: 2.5rem; 
        text-align: center;
        margin-bottom: 2rem;
    }

    .intro-flex {
        flex-direction: column-reverse; 
        gap: 20px;
        align-items: center;
        margin-bottom: 4rem;
    }

    /* AJOUT SPÉCIFIQUE VOLLEY MOBILE */
    .volley-section {
        margin-top: 4rem;
        flex-direction: column; 
    }

    .intro-image {
        width: 100%;
        max-width: 200px; /* Image réduite */
        height: auto;
        flex: none;
    }

    .intro-text {
        font-size: 1rem;
        line-height: 1.5;
        text-align: center;
    }

    /* --- 5. OPTIMISATION LOGICIELS & RÉSEAUX (Style Compact 5 colonnes) --- */
    .software-section h3 { 
        font-size: 1.2rem; 
        margin-bottom: 1.5rem; 
        text-align: center; 
    }
    
    .software-grid {
        grid-template-columns: repeat(5, 1fr); /* 5 colonnes */
        gap: 8px; 
        justify-content: center;
    }

    .soft-item {
        padding: 0; 
        gap: 0;
        aspect-ratio: 1 / 1; /* Boutons carrés */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .soft-item i, .soft-item svg {
        font-size: 1.8rem; /* Icônes adaptées */
        width: 1.8rem;
        height: 1.8rem;
        margin: 0;
    }

    /* ON CACHE LE TEXTE SUR MOBILE */
    .soft-item span {
        display: none; 
    }

    /* --- 6. OPTIMISATION MODALE (MOBILE & TABLETTE) --- */
    .modal-container {
        height: 90vh; 
        width: 95%;
        overflow: hidden; 
    }

    .modal-content { 
        flex-direction: column; 
        overflow-y: scroll;
        height: 100%;
    }
    
    .modal-media { 
        flex: none; 
        width: 100%;
        height: auto;
        background: transparent; /* PLUS DE FOND NOIR */
        /* MODIF : ESPACE DE 15PX SUR MOBILE */
        padding: 15px; 
    }
    
    /* On restaure les images en grand pour le mobile MAIS DANS LE CADRE */
    .slide img, .slide video {
        max-width: 100%; /* Prend toute la place dans la zone paddée */
        max-height: 50vh; 
        /* On remet les bords arrondis et l'ombre comme sur le web */
        border-radius: 4px; 
        box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    }

    /* Fix pour le 3D sur mobile */
    .slide model-viewer {
        width: 100%;
        height: 50vh !important; /* Hauteur forcée sinon c'est invisible */
        border-radius: 4px;
        background: radial-gradient(circle, #7272723f 0%, #000000 100%); /* Fond nécessaire pour voir le modèle */
    }
    
    .modal-info { 
        flex: none; 
        padding: 1.5rem; 
        height: auto;
    }

    #modal-title { 
        font-size: 1.8rem; 
        line-height: 1.1;
        margin-bottom: 1rem;
        padding-right: 0; /* Pas besoin de padding droit en colonne */
    }
    
    .modal-desc {
        font-size: 0.9rem;
        padding: 15px;
    }

    .nav-btn { width: 35px; height: 35px; font-size: 1rem; }
    .close-btn { top: 10px; right: 10px; width: 35px; height: 35px; background: rgba(255,255,255,0.8); }

    /* --- 7. AVIS (Reviews) --- */
    .review-card { padding: 1.5rem; }
}

/* Style du lien dans la modale */
.project-link {
    display: inline-block;
    margin-top: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    padding: 10px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.project-link:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}