:root {
    --primary-color: #00aaff;
    --secondary-color: #0a192f;
    --font-color: #ccd6f6;
    --bg-color: #0a192f;
    --heading-color: #e6f1ff;
    --nav-bg-color: rgba(10, 25, 47, 0.85);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --particle-color: #ffffff;
}

[data-theme="light"] {
    --primary-color: #007bff;
    --secondary-color: #ffffff;
    --font-color: #333742;
    --bg-color: #f0f2f5;
    --heading-color: #000;
    --nav-bg-color: rgba(255, 255, 255, 0.85);
    --shadow-color: rgba(100, 100, 100, 0.15);
    --particle-color: #333333;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--font-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--nav-bg-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

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

nav ul li a {
    color: var(--font-color);
    text-decoration: none;
    font-size: 1.2em;
    transition: color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--primary-color);
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Prend toute la hauteur de la vue */
    text-align: center;
}

.hero h1 {
    font-size: 4.5em;
    margin: 0;
    font-weight: 700;
}

.hero p {
    font-size: 1.8em;
    margin-top: 10px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 25px;
    transition: background-color 0.3s, transform 0.3s;
    font-weight: bold;
}

.btn:hover {
    background-color: #0088cc; /* Un peu plus foncé au survol */
    transform: translateY(-3px);
}

section {
    padding: 80px 40px;
    max-width: 1000px;
    margin: 0 auto;
    border-bottom: 1px solid var(--shadow-color);
}

section:last-of-type {
    border-bottom: none;
}

.container {
    width: 100%;
}

h2 {
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.8em;
    font-weight: 600;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-content img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    border: 3px solid var(--primary-color);
}

.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-item {
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.project-item img {
    width: 100%;
    display: block;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    margin-top: 0;
    color: var(--heading-color);
}

#contact form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#contact .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

#contact input, #contact textarea {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background-color: var(--secondary-color);
    color: var(--font-color);
    box-sizing: border-box; /* Important pour le padding */
}

.project-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 20;
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 40px;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    position: relative;
    animation: slide-down 0.5s ease-out;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--font-color);
    font-size: 2em;
    cursor: pointer;
}

@keyframes slide-down {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

footer {
    text-align: center;
    padding: 40px 20px;
}

.social-links a {
    color: var(--font-color);
    margin: 0 15px;
    font-size: 1.8em;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

footer p {
    margin-top: 20px;
    font-size: 0.9em;
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin: 0 10px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.icon-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4c566a;
    transition: .4s;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
}

.icon-slider svg {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.icon-slider .sun {
    fill: #f1c40f;
    opacity: 0;
    transform: translateX(-20px);
}

.icon-slider .moon {
    fill: #f3f3f3;
    transform: translateX(0);
}

input:checked + .icon-slider {
    background-color: var(--primary-color);
}

input:checked + .icon-slider .sun {
    opacity: 1;
    transform: translateX(0);
}

input:checked + .icon-slider .moon {
    opacity: 0;
    transform: translateX(20px);
}

/*
 * =========================================
 *  1. AMÉLIORATIONS GÉNÉRALES ET NOUVEAUX ÉLÉMENTS
 * =========================================
 */

/* Style pour le logo "FC" dans la barre de navigation */
nav .logo a {
    color: var(--heading-color);
    font-size: 1.8em;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}
nav .logo a:hover {
    color: var(--primary-color);
}

/* Style pour le sous-titre de la section Hero et des projets */
.subtitle, .section-subtitle {
    font-size: 1.2em;
    color: var(--font-color);
    max-width: 600px; /* Limite la largeur pour une meilleure lisibilité */
    margin: 15px auto 30px auto;
    opacity: 0.9;
}
.section-subtitle {
    text-align: center;
}

/* Organisation des boutons dans la section Hero */
.hero-buttons {
    display: flex;
    gap: 15px; /* Espace entre les boutons */
    margin-top: 20px;
}

/* Variante "secondaire" pour les boutons (style "outline") */
.btn.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}


/*
 * =========================================
 *  2. NOUVELLE SECTION "COMPÉTENCES"
 * =========================================
 */

#skills .skills-grid {
    display: grid;
    /* Crée 3 colonnes sur grand écran, et s'adapte automatiquement sur les plus petits */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.skill-card {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

/* Icônes de compétence */
.skill-card i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.skill-card h3 {
    color: var(--heading-color);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.skill-card span {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    opacity: 0.8;
}

/*
 * =========================================
 *  NOUVELLE SECTION "CERTIFICATIONS"
 * =========================================
 */

#certifications .certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.certification-card {
    background-color: var(--secondary-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.certification-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

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

.certification-header i {
    font-size: 2em;
    color: var(--primary-color);
}

.certification-header h3 {
    color: var(--heading-color);
    font-size: 1.3em;
    margin: 0;
}

.certification-card p {
    flex-grow: 1;
    margin-bottom: 20px;
}

.certification-issuer {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 20px;
}

.btn-certification {
    align-self: flex-start;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    transition: color 0.3s;
}

.btn-certification:hover {
    color: #fff;
    text-decoration: underline;
}


/*
 * =========================================
 *  3. AJUSTEMENTS DES SECTIONS EXISTANTES
 * =========================================
 */

/* Ajustement de la section Hero pour un impact maximal */
.hero {
    min-height: 100vh; /* Utilise min-height pour plus de flexibilité */
    padding: 20px;
}

.hero .subtitle {
    font-weight: 300; /* Police plus légère pour contraster avec le titre */
}


/* Raffinements pour les cartes de projet */
.project-item {
    display: flex;
    flex-direction: column; /* Assure que le contenu s'empile verticalement */
}

.project-info {
    flex-grow: 1; /* Permet au contenu de remplir l'espace disponible */
    display: flex;
    flex-direction: column;
}

.project-info .btn {
    margin-top: auto; /* Pousse le bouton en bas de la carte */
    align-self: flex-start; /* Aligne le bouton à gauche */
}


/* Amélioration du formulaire de contact (état :focus) */
#contact input:focus, 
#contact textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Pour le formulaire sans labels visibles */
#contact .form-group {
    position: relative;
}

#contact input, #contact textarea {
    font-size: 1rem;
}


/*
 * =========================================
 *  4. AMÉLIORATIONS DES MODALES
 * =========================================
 */

.modal-content img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}
.project-links {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/*
 * =========================================
 *  5. ANIMATIONS AU DÉFILEMENT (SCROLL REVEAL)
 * =========================================
 */

/* État initial : les éléments sont cachés */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* État final : les éléments deviennent visibles */
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/*
 * =========================================
 *  6. ALBUM / GALERIE PHOTO
 * =========================================
 */

.album .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 0;
}

.album .gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
    background: var(--secondary-color);
}

.album .gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 170, 255, 0.3);
}

.album .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.album .gallery-item:hover img {
    transform: scale(1.08);
}

.album .gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 170, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album .gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.album .gallery-overlay i {
    color: #fff;
    font-size: 2em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 85%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 170, 255, 0.4);
    animation: lightbox-zoom 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5em;
    cursor: pointer;
    transition: transform 0.3s;
    z-index: 101;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    color: var(--primary-color);
}

@keyframes lightbox-zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/*
 * =========================================
 *  7. RESPONSIVE DESIGN - AJUSTEMENTS MOBILES
 * =========================================
 */

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    nav {
        flex-direction: column;
        padding: 15px;
    }

    nav ul {
        margin-top: 15px;
    }

    nav ul li {
        margin: 0 10px;
    }

    .hero h1 {
        font-size: 2.8em;
    }

    .hero p {
        font-size: 1.2em;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .btn {
        width: 80%;
        text-align: center;
    }
    
    h2 {
        font-size: 2.2em;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .album .gallery {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 0;
    }
}