/* ============================================================
   VARIABLES & THEME (Gengar / Y2K / Cyber-retro)
   ============================================================ */
:root {
    --gengar-dark: #2d1a47;
    --gengar-purple: #512888;
    --gengar-neon: #a048ff;
    --gengar-eye: #ff3e3e; /* Rouge vif utilisé pour les liens */
    --text-color: #e0d0ff;
    --window-bg: rgba(45, 26, 71, 0.9);
}

/* ============================================================
   BASE & BACKGROUND
   ============================================================ */
body {
    background-color: #0d0118;
    /* Grille rétro Y2K animée */
    background-image: 
        linear-gradient(rgba(160, 72, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160, 72, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    overflow-x: hidden;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    from { background-position: 0 0; }
    to { background-position: 0 1000px; }
}

/* Effet d'aura mouvante */
.ghost-blur {
    position: fixed;
    width: 40vw;
    height: 40vw;
    background: var(--gengar-purple);
    filter: blur(150px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
    animation: float 15s infinite alternate;
}

@keyframes float {
    0% { transform: translate(-10%, -10%); }
    100% { transform: translate(80vw, 80vh); }
}

/* Lignes CRT / Scanlines */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
header {
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 2px solid var(--gengar-purple);
}

.nav-system {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 10px 20px;
    background: rgba(45, 26, 71, 0.5);
    border-bottom: 1px solid var(--gengar-neon);
    backdrop-filter: blur(5px);
}

.nav-system > div {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Liens du menu principaux */
nav a, .btn-back {
    color: var(--gengar-eye);
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

nav a:hover, .btn-back:hover {
    color: var(--text-color);
    text-shadow: 0 0 8px var(--gengar-neon);
    background: rgba(160, 72, 255, 0.1);
}

.nav-status {
    font-size: 0.8rem;
    color: var(--gengar-eye);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================================
   TYPOGRAPHIE & EFFETS GLITCH
   ============================================================ */
.glitch {
    font-size: clamp(1.2rem, 5vw, 3rem);
    font-weight: bold;
    color: var(--gengar-neon);
    position: relative;
    text-shadow: 2px 2px var(--gengar-eye);
    text-transform: uppercase;
}

.level-up {
    color: var(--gengar-eye);
    text-transform: uppercase;
    border-bottom: 1px solid var(--gengar-eye);
    display: inline-block;
    margin-bottom: 15px;
}

.typing-effect {
    overflow: hidden;
    border-right: .15em solid var(--gengar-eye);
    white-space: nowrap;
    margin: 0;
    letter-spacing: .15em;
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--gengar-eye); } }

/* ============================================================
   FENÊTRES (WINDOWS VINTAGE)
   ============================================================ */
.window {
    border: 2px solid var(--gengar-purple);
    background: var(--window-bg);
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: 8px 8px 0px var(--gengar-neon);
}

.window-header {
    background: var(--gengar-purple);
    padding: 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 35px;
}

.window-header .glitch {
    font-size: 1rem;
    text-shadow: 1px 1px var(--gengar-eye);
}

.window-controls {
    font-family: monospace;
    letter-spacing: 5px;
    color: var(--text-color);
    cursor: default;
}

.window-body { padding: 25px; line-height: 1.6; }

/* ============================================================
   GRILLE DE PROJETS (CARDS)
   ============================================================ */
.section-title {
    text-align: center;
    color: var(--gengar-eye);
    margin-top: 4rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: rgba(26, 10, 46, 0.8);
    border: 1px solid var(--gengar-neon);
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--gengar-eye);
    box-shadow: 0 0 20px rgba(160, 72, 255, 0.3);
}

.card-tag {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--gengar-eye);
    color: white;
    font-size: 0.6rem;
    padding: 3px 7px;
    z-index: 2;
}

.card-img {
    height: 180px;
    width: 100%;
    overflow: hidden;
    background: #11051a;
    border-bottom: 1px solid var(--gengar-purple);
}

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

.card-content { padding: 15px; }
.card-content h3 { margin: 0; color: var(--gengar-neon); }

.card-tech {
    margin-top: 10px;
    font-size: 0.7rem;
    color: var(--gengar-neon);
    opacity: 0.8;
}

/* ============================================================
   CONTACT & BOUTONS SYSTÈME (HARMONISÉS)
   ============================================================ */
.contact-list { display: flex; flex-direction: column; gap: 15px; }

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 10px 15px;
    border-bottom: 1px dashed var(--gengar-purple);
}

.contact-label { font-size: 0.8rem; color: var(--gengar-neon); font-weight: bold; }

/* Règle globale pour tous les boutons .contact-link (alignés et dimensionnés selon contenu) */
.contact-link {
    display: inline-flex;    /* Aligne le texte et le logo sur une seule ligne */
    align-items: center;     /* Centre verticalement */
    justify-content: center; /* Centre horizontalement */
    color: var(--gengar-eye);
    text-decoration: none;
    padding: 5px 15px;
    border: 1px solid var(--gengar-eye);
    background: rgba(255, 62, 62, 0.1);
    transition: all 0.2s ease;
    text-align: center;
    width: auto;             /* Empêche le bouton de s'étirer sur toute la largeur */
    box-sizing: border-box;
}

.contact-link:hover {
    background: var(--gengar-neon);
    color: var(--gengar-dark);
    border-color: var(--gengar-neon);
    box-shadow: 0 0 15px var(--gengar-neon);
    transform: skewX(-10deg);
}

.system-message {
    background: #000;
    padding: 10px;
    border-left: 3px solid var(--gengar-eye);
    margin-top: 15px;
    font-size: 0.8rem;
}

/* Conteneur pour le bas de la zone projet */
.project-footer {
    margin-top: 30px; 
}

/* Espacement ciblé du bouton dans les articles pour éviter le chevauchement */
.project-footer .contact-link {
    margin-top: 20px;      
}

/* Icônes dans les boutons de contact */
.contact-link .icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 8px;
}

/* ============================================================
   STYLISATION DES LIENS DE TÉLÉCHARGEMENT DIRECTS
   ============================================================ */
.download-link {
    color: var(--gengar-eye) !important; 
    text-decoration: underline;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 5px;
}

.download-link:hover {
    color: var(--text-color) !important;
    text-shadow: 0 0 8px var(--gengar-neon);
}

.file-desc {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    display: inline-block;
    margin-bottom: 2px;
}

.file-item-spacing {
    margin-top: 25px;
}

/* ============================================================
   CONTENU ARTICLES / WRITE-UPS
   ============================================================ */
.article-content h3 {
    color: var(--gengar-neon);
    font-size: 1.1rem;
    margin-top: 25px;
    border-left: 3px solid var(--gengar-eye);
    padding-left: 10px;
}

.terminal-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border: 1px solid var(--gengar-purple);
    font-size: 0.85rem;
    margin-bottom: 20px;
    color: #a048ff; 
}

.github-integration {
    margin-top: 30px;
    padding: 20px;
    border: 2px dashed var(--gengar-neon);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.custom-list { list-style: none; padding-left: 10px; }
.custom-list li::before { content: "> "; color: var(--gengar-eye); }

/* Gestion générale des images seules dans les articles */
.article-content img {
    max-width: 100%; 
    height: auto;    
    display: block;
    margin: 20px auto; 
    border: 1px solid var(--gengar-purple);
    box-shadow: 4px 4px 0px var(--gengar-neon); 
}

/* Comparateur d'images (côte à côte) */
.image-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.image-comparison img {
    flex: 1 1 calc(50% - 15px); 
    max-width: 100%;            
    min-width: 250px;           
    height: auto;               
    object-fit: contain;
    border: 1px solid var(--gengar-purple);
    box-shadow: 4px 4px 0px var(--gengar-neon); 
}

/* ============================================================
   STYLISATION DES TABLEAUX & BLOCS DE LISTE (GNS3 & PROXMOX)
   ============================================================ */
.table-container {
    width: 100%;
    overflow-x: auto; 
    margin: 25px 0;
    border: 1px solid var(--gengar-purple);
    box-shadow: 4px 4px 0px var(--gengar-neon);
}

.cyber-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    background: rgba(26, 10, 46, 0.6);
}

.cyber-table th {
    background: var(--gengar-purple);
    color: var(--text-color);
    padding: 12px;
    font-weight: bold;
    border-bottom: 2px solid var(--gengar-neon);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cyber-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(160, 72, 255, 0.2);
    color: var(--text-color);
    line-height: 1.4;
}

.cyber-table tbody tr:hover {
    background: rgba(160, 72, 255, 0.1);
}

.custom-list-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-left: 3px solid var(--gengar-neon);
    margin-top: 20px;
}

/* Classes utilitaires de stylisation de texte */
.highlight-neon { color: var(--gengar-neon); }
.alert-neon { color: var(--gengar-neon); font-size: 0.85rem; }
.alert-eye { color: var(--gengar-eye); font-size: 0.85rem; }

/* ============================================================
   AMÉLIORATION VISUELLE DE LA TIMELINE (PARCOURS)
   ============================================================ */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 30px; 
    padding: 10px 0;
}

.timeline-item {
    background: rgba(26, 10, 46, 0.4); 
    border: 1px solid rgba(160, 72, 255, 0.2); 
    border-left: 4px solid var(--gengar-purple); 
    padding: 20px;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    background: rgba(45, 26, 71, 0.4);
    border-color: rgba(160, 72, 255, 0.5);
    border-left-color: var(--gengar-eye); 
    box-shadow: 0 0 15px rgba(160, 72, 255, 0.1);
    transform: translateX(5px); 
}

.timeline-date {
    font-family: monospace;
    font-weight: bold;
    color: var(--gengar-neon);
    font-size: 0.9rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(160, 72, 255, 0.5);
}

.timeline-content h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.timeline-content h4.level-up {
    color: var(--gengar-eye);
    border-bottom: 1px dashed var(--gengar-eye);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 4rem;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* ============================================================
   STYLISATION DE LA PAGE CERTIFICATIONS
   ============================================================ */
.cert-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.cert-card {
    display: flex;
    align-items: center;
    background: rgba(26, 10, 46, 0.4);
    border: 1px solid rgba(160, 72, 255, 0.2);
    padding: 20px;
    gap: 20px;
    transition: all 0.3s ease;
}

.cert-card:hover {
    border-color: var(--gengar-eye);
    background: rgba(45, 26, 71, 0.4);
    box-shadow: 0 0 15px rgba(160, 72, 255, 0.1);
}

/* Alignement et taille fixe des badges de certification */
.cert-badge img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--gengar-purple);
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
}

.cert-info h4 {
    margin: 0 0 5px 0;
    color: var(--gengar-neon);
    font-size: 1.1rem;
}

.cert-issuer {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: bold;
}

.cert-date {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--gengar-eye);
    font-family: monospace;
}

/* Optimisation mobile : empiler le badge et le texte sur petit écran */
@media (max-width: 600px) {
    .cert-card {
        flex-direction: column;
        text-align: center;
    }
    .cert-badge img {
        width: 100px;
        height: 100px;
    }
}
/* ============================================================
   CONTACT — LIENS GROUPÉS & STATUT
   ============================================================ */
.contact-links-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contact-tag {
    color: var(--gengar-neon);
    font-size: 0.75rem;
    margin-right: 0.4rem;
    opacity: 0.7;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gengar-neon);
    box-shadow: 0 0 6px var(--gengar-neon);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.status-text {
    color: var(--gengar-neon);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.status-detail {
    font-size: 0.8rem;
    opacity: 0.6;
    margin: 0;
    padding-left: 1.1rem;
}

/* ============================================================
   FORMULAIRE DE CONTACT
   ============================================================ */
#contact-form {
    margin-top: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid rgba(160, 72, 255, 0.3);
    padding-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-label {
    font-size: 0.8rem;
    color: var(--gengar-neon);
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.form-input {
    background: rgba(160, 72, 255, 0.05);
    border: 1px solid rgba(160, 72, 255, 0.35);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--gengar-neon);
    box-shadow: 0 0 8px rgba(160, 72, 255, 0.3);
}

.form-input::placeholder {
    opacity: 0.35;
    color: var(--text-color);
}

.form-textarea {
    resize: vertical;
    min-height: 110px;
}

.btn-submit {
    align-self: flex-start;
    background: transparent;
    border: 1px solid var(--gengar-eye);
    color: var(--gengar-eye);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    background: var(--gengar-eye);
    color: var(--gengar-dark);
    box-shadow: 0 0 12px var(--gengar-eye);
}

.form-feedback {
    font-size: 0.82rem;
    margin: 0;
}

.form-feedback.success { color: var(--gengar-neon); }
.form-feedback.error   { color: var(--gengar-eye); }

/* ============================================================
   SECTION COMPÉTENCES
   ============================================================ */

/* Grille principale des catégories */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 1.5rem 0;
}

/* Bloc catégorie */
.skill-category {
    background: rgba(26, 10, 46, 0.5);
    border: 1px solid rgba(160, 72, 255, 0.2);
    border-left: 4px solid var(--gengar-purple);
    padding: 18px 20px;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-left-color: var(--gengar-eye);
    background: rgba(45, 26, 71, 0.5);
    box-shadow: 0 0 15px rgba(160, 72, 255, 0.1);
    transform: translateX(4px);
}

/* Titre de catégorie */
.skill-category-title {
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gengar-eye);
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(160, 72, 255, 0.4);
}

/* Liste de compétences */
.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Ligne de compétence individuelle */
.skill-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-color);
}

.skill-name::before {
    content: "> ";
    color: var(--gengar-eye);
    flex-shrink: 0;
}

.skill-level-label {
    font-size: 0.68rem;
    color: var(--gengar-neon);
    opacity: 0.75;
    letter-spacing: 0.05em;
    white-space: nowrap;
    margin-left: 8px;
}

/* Barre de progression style terminal */
.skill-bar {
    height: 4px;
    background: rgba(160, 72, 255, 0.12);
    border: 1px solid rgba(160, 72, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gengar-purple), var(--gengar-neon));
    box-shadow: 0 0 6px var(--gengar-neon);
    transition: width 0.8s ease;
    position: relative;
}

/* Variante rouge (gengar-eye) pour les compétences fortes */
.skill-fill.strong {
    background: linear-gradient(90deg, var(--gengar-purple), var(--gengar-eye));
    box-shadow: 0 0 6px var(--gengar-eye);
}

/* Badge "En cours" */
.skill-badge {
    display: inline-block;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 1px 6px;
    border: 1px solid var(--gengar-neon);
    color: var(--gengar-neon);
    background: rgba(160, 72, 255, 0.08);
    margin-left: 6px;
    vertical-align: middle;
    animation: blink 1.5s infinite;
}

/* Responsive : 1 colonne sur mobile */
@media (max-width: 600px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   RESPONSIVE PATCH — toutes pages (nav, header, projets, ssh)
   ============================================================ */

/* --- nav-system : passe en colonne sur mobile --- */
@media (max-width: 700px) {
    .nav-system {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 15px;
    }

    /* Le bloc centré absolu ne fonctionne plus en colonne */
    .nav-system > div {
        position: static;
        transform: none;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-status {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    nav a, .btn-back {
        margin: 0 6px 0 0;
        font-size: 0.8rem;
    }
}

/* --- header index.html : réduit le padding --- */
@media (max-width: 700px) {
    header {
        padding: 1.5rem 1rem;
    }

    header nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
}

/* --- .window : retire le margin horizontal fixe sur mobile --- */
@media (max-width: 700px) {
    .window {
        margin: 1rem 10px;
        box-shadow: 4px 4px 0px var(--gengar-neon);
    }

    .window-body {
        padding: 15px;
    }
}

/* --- Grille de projets : 1 colonne sous 400px --- */
@media (max-width: 400px) {
    .grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 20px;
    }
}

/* --- ssh.html / bot_discord / boccia : project-grid & project-container --- */
.project-grid {
    display: flex;
    flex-direction: column;   /* image AU-DESSUS du texte par défaut */
    gap: 20px;
    align-items: flex-start;
}

.project-media {
    width: 100%;              /* prend toute la largeur disponible */
    max-width: 100%;
}

.project-media img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border: 1px solid var(--gengar-purple);
}

.project-text {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Sur grands écrans (> 900px) : image à gauche, texte à droite */
@media (min-width: 900px) {
    .project-grid.layout-side {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .project-grid.layout-side .project-media {
        flex: 0 0 auto;
        width: auto;
        max-width: 45%;
    }

    .project-grid.layout-side .project-text {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .project-grid {
        flex-direction: column;
    }

    /* project-footer : empile les éléments */
    .project-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* typing-effect : retire white-space nowrap sur mobile */
    .typing-effect {
        white-space: normal;
        border-right: none;
        animation: none;
        overflow: visible;
    }

    /* footer : réduit le padding */
    footer {
        padding: 2rem 1rem;
    }
}