/* L'importation de la police a été déplacée dans le HTML (<link preconnect>) pour accélérer grandement le chargement */

:root {
    --bg-color: #0a0b10;
    --neon-blue: #00f3ff;
    --term-green: #00ff41;
    --text-color: #f0f0f5;
}

html {
    scroll-behavior: smooth; /* Active l'effet de glissement fluide */
}

/* Styles globaux */
body {
    font-family: 'Fira Code', monospace;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color); /* Couleur de secours */
    color: var(--text-color);
    line-height: 1.6;
    padding-left: 250px; /* Décale tout le contenu pour laisser la place au menu gauche */
}

/* Pseudo-élément pour un arrière-plan fixe fluide (corrige le bug d'affichage sur iOS/Safari/Mobiles) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: linear-gradient(rgba(10, 11, 16, 0.8), rgba(10, 11, 16, 0.8)), url('image/background.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -1;
    will-change: transform; /* Indique au navigateur d'optimiser l'affichage avec la carte graphique (GPU) */
}

/* En-tête et Navigation */
header {
    background-color: rgba(10, 11, 16, 0.7);
    /* Superposition d'un voile sombre sur l'image de la baie pour que le texte reste lisible */
    background-image: linear-gradient(rgba(10, 11, 16, 0.5), rgba(10, 11, 16, 0.5)), url('image/Baie.png');
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Indispensable pour la compatibilité Safari/iOS */
    border-right: 1px solid rgba(0, 243, 255, 0.2);
    padding: 2rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    box-sizing: border-box;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Aligne le contenu en haut pour éviter le chevauchement */
    overflow-y: auto; /* Permet de faire défiler le menu si l'écran est vraiment trop petit */
    scrollbar-width: none; /* Cache la barre de défilement sur Firefox */
}
header::-webkit-scrollbar {
    display: none; /* Cache la barre de défilement sur Chrome/Safari/Edge */
}

nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: center; /* Centre les liens verticalement */
    padding: 0; /* Retire l'espacement du bas pour un centrage parfait */
    text-align: center;
    gap: 1rem; /* Ajoute un espacement vertical entre les liens */
    flex-grow: 1; /* Permet à la nav de prendre l'espace restant et de centrer son contenu dedans */
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease;
    text-align: center;
    width: 100%; /* S'assure que le conteneur prend toute la largeur */
    padding-top: 2rem; /* Maintient l'espacement du haut */
    padding-bottom: 3rem; /* Crée un espace entre le logo et la navigation */
}

.logo-container:hover {
    /* transform: scale(1.05); Petit effet de zoom au survol */
    mix-blend-mode: screen;
}

.logo-img {
    height: 140px; /* Logo agrandi pour l'affichage en colonne */
    width: auto;
    mix-blend-mode: screen; /* Rend le fond noir/sombre de l'image transparent */
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-blue);
}

nav a {
    color: var(--term-green); /* Tu peux remplacer "var(--term-green)" par la couleur de ton choix, ex: #ff9900 */
    text-decoration: none;
    font-weight: 500;
    font-size: 1.3rem; /* Agrandit la taille de la police des liens */
    background-color: transparent; /* Fond totalement transparent au repos */
    background-size: cover;
    background-position: center;
    padding: 0.8rem 1.2rem; /* Donne un aspect "bouton" pour bien voir l'image de fond */
    border-radius: 8px; /* Bords légèrement arrondis */
    transition: all 0.3s ease;
}

nav a:hover {
    color: #ffffff; /* Texte en blanc brillant */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('image/href.png'); /* Image plus visible (voile très fin de 20%) */
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.4); /* Ombre lumineuse bleu néon discrète */
}

/* Sections */
section {
    padding: 4rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    scroll-margin-top: 0; /* Plus besoin de compenser le décalage vertical */
}

h2 {
    color: var(--neon-blue);
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

h2::before {
    content: "> ";
    color: var(--term-green);
}

/* Blague cachée (Easter egg Ctrl+A) */
.hidden-joke {
    color: transparent;
    margin: -1.5rem 0 1.5rem 0; /* Compense la marge du titre pour ne pas créer un vide suspect */
    font-size: 0.9rem;
    cursor: default; /* Masque le curseur de texte pour ne pas éveiller les soupçons au passage de la souris */
    user-select: text;
}

.hidden-joke a {
    color: transparent;
    text-decoration: none;
    cursor: default;
}

/* Révélation au moment de la sélection (Ctrl+A) */
.hidden-joke::selection, .hidden-joke *::selection {
    background-color: var(--neon-blue);
    color: var(--bg-color); /* Le texte prendra la couleur foncée du fond pour être lisible sur le surlignage bleu */
}

/* Compétences (Badges) */
.badge-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--term-green);
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: rgba(0, 243, 255, 0.05);
}

.bg-sys { border: 1px solid var(--neon-blue); color: var(--neon-blue); }
.bg-res { border: 1px solid var(--term-green); color: var(--term-green); }
.bg-sec { border: 1px solid #ff4444; color: #ff4444; }
.bg-soft { border: 1px solid #b388ff; color: #b388ff; }
.bg-office { border: 1px solid #d35400; color: #d35400; }

/* Parcours & Timeline */
.parcours-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Légèrement réduit pour plus de flexibilité */
    gap: 2rem;
}

.parcours-column h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.timeline-item {
    border-left: 2px solid var(--neon-blue);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--bg-color);
    border: 2px solid var(--term-green);
    border-radius: 50%;
    left: -8px;
    top: 0;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--term-green);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.timeline-content h4 {
    margin: 0 0 0.2rem 0;
    color: var(--neon-blue);
}

.timeline-content h5 {
    margin: 0 0 0.5rem 0;
    font-weight: 400;
    color: #aaaaaa;
    font-style: italic;
}

.timeline-content ul {
    margin: 0;
    padding-left: 1.2rem;
}

.timeline-content p {
    margin: 0;
}

/* Projets (Cartes) */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Permet de centrer automatiquement les cartes isolées sur la dernière ligne */
    gap: 1.5rem;
}

.card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Pour Safari */
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 1 1 280px; /* Force les cartes à avoir une base identique */
    max-width: 100%;
}

/* Uniformisation : 2 colonnes max sur tablettes */
@media (min-width: 650px) {
    .projects-grid > .card {
        max-width: calc(50% - 0.75rem);
    }
}

/* Uniformisation : 3 colonnes max sur PC pour centrer proprement la dernière ligne */
@media (min-width: 1000px) {
    .projects-grid > .card {
        max-width: calc(33.333% - 1rem);
    }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    border-color: var(--neon-blue);
}

.card h3 {
    margin-top: 0;
    color: var(--neon-blue);
}

.card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

/* Tableaux (ex: Synthèse adressage ITWay) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

/* Permet un défilement horizontal sur mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table tbody tr {
    transition: background-color 0.3s ease;
}

table tbody tr:hover {
    background-color: rgba(0, 243, 255, 0.08); /* Effet néon subtil au survol */
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

th {
    color: var(--term-green);
    background-color: rgba(10, 11, 16, 0.6);
    font-weight: bold;
    border-bottom: 2px solid var(--term-green);
}

/* Force l'alignement des boutons à droite dans les tableaux de la section projets */
#projets details table th:last-child,
#projets details table td:last-child {
    text-align: right;
}

/* Boutons de téléchargement pour les tableaux */
.btn-download {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: rgba(0, 243, 255, 0.05);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background-color: var(--neon-blue);
    color: var(--bg-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

/* Pied de page */
footer {
    background-color: rgba(10, 11, 16, 0.9);
    border-top: 1px solid rgba(0, 243, 255, 0.2);
    color: var(--text-color);
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

footer a {
    color: var(--neon-blue);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

footer a:hover {
    color: var(--term-green);
    text-shadow: 0 0 8px var(--term-green);
}

/* --- Sélecteur de Thème --- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem; /* Espace le sélecteur des liens de navigation */
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2c3e50;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--neon-blue);
}

.slider:before {
    position: absolute;
    content: "🌙";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-color);
    transition: .4s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--neon-blue);
}

input:checked + .slider {
    background-color: #ccc;
    border-color: #888;
}

input:checked + .slider:before {
    transform: translateX(26px);
    content: "☀️";
    background-color: #f0f0f5;
    color: #ff8c00;
}

/* --- Thème Clair --- */
body.light-mode {
    --bg-color: #f4f4f9;
    --neon-blue: #0056b3;
    --term-green: #218838;
    --text-color: #212529;
    background-color: var(--bg-color);
}
body.light-mode::before {
    background-image: linear-gradient(rgba(244, 244, 249, 0.85), rgba(244, 244, 249, 0.85)), url('image/backgroundclair.png');
}
body.light-mode header { border-right-color: #dee2e6; }
body.light-mode nav a { color: #00ff41; } /* Maintient la couleur vive des liens du menu */
body.light-mode h2 { border-bottom-color: rgba(0, 86, 179, 0.3); }
body.light-mode .hidden-joke::selection, body.light-mode .hidden-joke *::selection { background-color: var(--neon-blue); color: var(--bg-color); }
body.light-mode .badge { background-color: rgba(0, 86, 179, 0.05); }
body.light-mode .bg-sec { border-color: #c82333; color: #c82333; }
body.light-mode .bg-soft { border-color: #5a6268; color: #5a6268; }
body.light-mode .bg-office { border-color: #e07e2a; color: #e07e2a; }
body.light-mode .timeline-item::before { background-color: var(--bg-color); }
body.light-mode .timeline-content h5 { color: #6c757d; }
body.light-mode .card { background: #ffffff; backdrop-filter: none; border-color: #dee2e6; }
body.light-mode .card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0, 86, 179, 0.15); border-color: var(--neon-blue); }
body.light-mode table { background: #ffffff; border-color: #dee2e6; }
body.light-mode table tbody tr:hover { background-color: rgba(0, 86, 179, 0.05); }
body.light-mode th { background-color: #e9ecef; border-bottom-color: var(--term-green); }
body.light-mode .btn-download { background-color: transparent; }
body.light-mode .btn-download:hover { color: #fff; background-color: var(--neon-blue); box-shadow: 0 0 10px rgba(0, 86, 179, 0.4); }
body.light-mode footer { background-color: #e9ecef; border-top-color: #dee2e6; }
body.light-mode footer a:hover { text-shadow: none; }
body.light-mode details.custom-dropdown summary h3 { border-bottom-color: rgba(0, 86, 179, 0.3); }
body.light-mode #veille-list a { color: var(--neon-blue) !important; }
body.light-mode .card .feature-list .icon-blue { color: var(--neon-blue); }
body.light-mode .card .feature-list .icon-green { color: var(--term-green); }
body.light-mode .cv-header h3 { color: var(--term-green); }

/* --- Utility & Component Classes (pour remplacer les styles en ligne) --- */
.text-center {
    text-align: center;
}
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }
.mt-4 { margin-top: 3rem; }

/* En-tête de la section CV */
.cv-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.cv-header h3 {
    color: var(--term-green);
    margin: 0;
    font-size: 1.2rem;
}

/* Titres secondaires dans les sections */
.section-subtitle {
    color: var(--term-green);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

/* Améliorations pour les cartes de projet */
.card .card-header {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
}
.card .card-subtitle {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 500;
}
.card .badge-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    margin: 0;
}
.card .feature-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
.card .feature-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
}
.card .feature-list i {
    width: 25px;
    flex-shrink: 0;
    margin-top: 0.1em; /* Ajustement pour l'alignement vertical */
}
.card .feature-list .icon-blue { color: var(--neon-blue); }
.card .feature-list .icon-green { color: var(--term-green); }

.card .map-container {
    margin-top: 1.5rem;
    text-align: center;
}
.card .map-container img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

/* Styles pour la table de veille technologique */
.veille-link { color: var(--neon-blue); text-decoration: none; transition: color 0.3s ease; }
.veille-link:hover { color: var(--term-green); text-decoration: underline; }

/* --- Cartes pour Veille Technologique --- */
.veille-card {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.veille-card:hover {
    color: var(--text-color);
}
.veille-card .card-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 1rem;
    gap: 0;
}
.veille-card .card-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.veille-source { font-weight: bold; color: var(--neon-blue); font-size: 0.95rem; }
.veille-date { font-size: 0.85rem; color: var(--term-green); }
.veille-card h4 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--text-color);
    flex-grow: 1;
}

/* --- Pages de Documentation (Nouvelles pages HTML) --- */
body.doc-page { padding-left: 0; padding-top: 2rem; } /* Pas de menu latéral sur ces pages */
.doc-container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 4rem 1.5rem; }
.btn-back { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; padding: 0.6rem 1.2rem; background-color: rgba(0, 243, 255, 0.05); color: var(--neon-blue); border: 1px solid var(--neon-blue); border-radius: 6px; text-decoration: none; font-weight: 500; transition: all 0.3s ease; }
.btn-back:hover { background-color: var(--neon-blue); color: var(--bg-color); box-shadow: 0 0 15px rgba(0, 243, 255, 0.4); }
.doc-header { text-align: center; margin-bottom: 3rem; }
.doc-header h1 { color: var(--neon-blue); font-size: 2.2rem; margin-bottom: 0.5rem; text-shadow: 0 0 10px rgba(0, 243, 255, 0.2); }
.doc-header .env-badge { display: inline-block; padding: 0.4rem 1rem; border-radius: 50px; background: rgba(0, 255, 65, 0.1); color: var(--term-green); border: 1px solid var(--term-green); font-size: 0.9rem; margin-bottom: 1.5rem; }
.doc-intro { font-size: 1.1rem; line-height: 1.7; padding: 1.5rem; background: rgba(255, 255, 255, 0.02); border-left: 4px solid var(--neon-blue); border-radius: 0 8px 8px 0; margin-bottom: 3rem; text-align: left; }
.doc-step { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(0, 243, 255, 0.15); border-radius: 8px; padding: 2rem; margin-bottom: 2rem; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.doc-step:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 243, 255, 0.1); }
.doc-step h3 { margin-top: 0; color: var(--term-green); border-bottom: 1px dashed rgba(0, 255, 65, 0.3); padding-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.doc-step h3 .step-num { background: var(--term-green); color: var(--bg-color); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1rem; font-weight: bold; }
.img-placeholder { margin: 1.5rem 0; padding: 2rem; background: rgba(0, 243, 255, 0.03); border: 1px dashed var(--neon-blue); border-radius: 8px; text-align: center; color: var(--neon-blue); font-style: italic; }
.doc-img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid rgba(0, 243, 255, 0.2); margin: 1.5rem auto; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; cursor: pointer; }
.doc-img:hover { transform: scale(1.05); box-shadow: 0 8px 25px rgba(0, 243, 255, 0.5); border-color: var(--neon-blue); z-index: 10; position: relative; }
.doc-summary { margin-top: 3rem; padding: 2rem; background: linear-gradient(135deg, rgba(0, 243, 255, 0.05) 0%, rgba(0, 0, 0, 0) 100%); border-radius: 8px; border: 1px solid var(--neon-blue); }
.doc-summary h3 { color: var(--neon-blue); margin-top: 0; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.meta-item { display: flex; flex-direction: column; gap: 0.3rem; }
.meta-label { font-size: 0.85rem; color: #aaaaaa; text-transform: uppercase; letter-spacing: 1px; }
.meta-value { font-weight: bold; color: var(--text-color); }
body.light-mode.doc-page { background-color: var(--bg-color); }
body.light-mode .doc-intro { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
body.light-mode .doc-step { background: #fff; border-color: #dee2e6; }
body.light-mode .img-placeholder { background: rgba(0, 86, 179, 0.05); border-color: var(--neon-blue); color: var(--neon-blue); }
body.light-mode .doc-img { border-color: #dee2e6; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
body.light-mode .doc-img:hover { box-shadow: 0 8px 25px rgba(0, 86, 179, 0.25); border-color: var(--neon-blue); }
body.light-mode .doc-summary { background: #fff; border-color: #dee2e6; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
body.light-mode .meta-value { color: #212529; }

/* --- Modal pour Images en Plein Écran --- */
.image-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); align-items: center; justify-content: center; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.image-modal.show { display: flex; }
.modal-content { max-width: 90%; max-height: 90vh; border-radius: 8px; box-shadow: 0 0 25px rgba(0, 243, 255, 0.5); animation: zoomIn 0.3s ease; }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close-modal { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.close-modal:hover, .close-modal:focus { color: var(--neon-blue); text-decoration: none; }

/* --- Adaptation pour les écrans de faible hauteur (ex: Laptops 15 pouces) --- */
@media (max-height: 800px) and (min-width: 901px) {
    header {
        padding: 1rem;
    }
    .logo-container {
        padding-top: 0.5rem;
        padding-bottom: 1.5rem;
    }
    .logo-img {
        height: 100px; /* Réduit la taille du logo pour libérer de l'espace */
    }
    nav {
        gap: 0.5rem; /* Rapproche les liens */
    }
    nav a {
        font-size: 1.1rem; /* Réduit légèrement la taille du texte */
        padding: 0.5rem 1rem;
    }
    .theme-switch-wrapper {
        margin-top: 1rem;
    }
}

/* --- Adaptation pour Tablettes et Mobiles --- */
@media (max-width: 900px) {
    body {
        padding-left: 0; /* Annule la marge sur les petits écrans */
    }
    header {
        position: relative; /* Le menu redevient un bloc en haut de page */
        width: 100%;
        height: auto;
        flex-direction: column;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(0, 243, 255, 0.2);
        gap: 1rem;
        justify-content: center;
    }
    .theme-switch-wrapper {
        margin-top: 0;
    }
    nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem; /* Restaure un espacement standard sur mobile */
        padding-bottom: 0; /* Retire l'espacement du bas devenu inutile en haut de page */
    }
    nav a {
        font-size: 1.1rem; /* Ajuste la taille des liens */
        padding: 0.6rem 1rem;
    }
    .logo-container {
        flex-direction: column;
        position: static; /* Réintègre le logo dans le flux normal sur mobile */
        width: auto;
    }
    .logo-img {
        height: 70px;
    }
    body.light-mode header {
        border-bottom-color: #dee2e6;
    }
    section {
        padding: 3rem 1.5rem; /* Réduit un peu les marges intérieures */
    }
}

/* --- Adaptation pour Mobiles (Smartphones) --- */
@media (max-width: 600px) {
    section {
        padding: 2rem 1rem; /* Marges réduites au minimum pour optimiser l'espace */
    }
    nav a {
        font-size: 0.95rem; /* Taille de texte plus petite pour éviter les retours à la ligne */
        padding: 0.5rem 0.8rem;
    }
    .parcours-container {
        grid-template-columns: 1fr; /* Garde la grille uniquement pour le parcours */
    }
    .projects-grid > .card {
        flex-basis: 100%; /* Force les cartes de projet à s'empiler sur mobile */
        max-width: 100%;
    }
    h2 {
        font-size: 1.3rem; /* Réduit la taille des titres */
    }
    .logo-img {
        height: 60px;
    }
    .badge {
        font-size: 0.8rem; /* Badges légèrement plus petits */
        padding: 0.4rem 0.8rem;
    }
    footer p:last-child {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    footer a {
        margin: 0; /* Annule les marges horizontales sur mobile pour un meilleur centrage */
    }
}

/* --- Adaptation pour Grands Écrans --- */
@media (min-width: 1400px) {
    section {
        max-width: 1200px; /* Utilise plus de largeur sur les grands écrans */
    }
    .projects-grid > .card {
        flex-basis: 350px; /* Cartes légèrement plus larges pour remplir l'espace des grands écrans */
    }
}

/* --- Menu déroulant (Détails / Summary) --- */
details.custom-dropdown summary {
    list-style: none; /* Cache la flèche par défaut sur les navigateurs modernes */
    outline: none;
}

details.custom-dropdown summary::-webkit-details-marker {
    display: none; /* Cache la flèche spécifique à Safari/Chrome */
}

details.custom-dropdown summary .toggle-icon {
    transition: transform 0.3s ease; /* Animation fluide de rotation */
    margin-right: 0.3rem;
}

details.custom-dropdown[open] summary .toggle-icon {
    transform: rotate(180deg); /* Tourne la flèche vers le haut quand c'est ouvert */
}

details.custom-dropdown > summary > h3 {
    margin-top: 3rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    padding-bottom: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
}