/* skills.css - Design modernisé en mode "Cartes & Badges" */

.skills-wrapper {
    display: grid;
    /* On utilise min() pour éviter le débordement sur les très petits écrans */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* --- DESIGN DES CARTES --- */
.skill-category {
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 16px;
    /* Bords plus arrondis pour la modernité */
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Ombre douce pour la profondeur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.skill-category:hover {
    transform: translateY(-8px);
    /* La carte se soulève au survol */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

/* --- DESIGN DES TITRES --- */
.skill-category h3 {
    margin-bottom: 25px;
    color: var(--accent-color);
    font-family: 'Space Mono', monospace;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
    /* On supprime la ligne basique... */
    position: relative;
}

/* ...pour la remplacer par une petite ligne de soulignement animée */
.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.skill-category:hover h3::after {
    width: 80px;
    /* La ligne s'allonge quand on survole la carte */
    background: var(--accent-color);
}

/* --- DESIGN DES COMPÉTENCES (MODE BADGES) --- */
.skill-list {
    display: flex;
    flex-wrap: wrap;
    /* Permet aux éléments de passer à la ligne comme des tags */
    gap: 12px;
    margin-top: 10px;
}

.skill-item {
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    padding: 8px 16px;
    border-radius: 20px;
    /* Forme de pilule / badge */
    border-left: none;
    /* On enlève l'ancienne bordure gauche */
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
    border: 1px solid transparent;
}

.dark-mode .skill-item {
    background: rgba(255, 255, 255, 0.08);
}

.skill-item:hover {
    transform: translateY(-3px) scale(1.05);
    /* Petit effet de "pop" */
    background: var(--accent-color);
    color: #ffffff;
    /* Pour assurer la lisibilité sur fond accentué */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- ANIMATION D'APPARITION AU SCROLL --- */

/* État initial : invisible et décalé vers le bas */
.skill-category {
    opacity: 0;
    /* On garde l'ancien translateY si on survole, mais on l'écrase ici pour l'état initial */
    transform: translateY(40px);
    /* On combine les transitions (apparition lente + hover rapide) */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* État final (classe ajoutée par le JavaScript) */
.skill-category.visible {
    opacity: 1;
    transform: translateY(0);
}

/* On s'assure que le hover fonctionne toujours correctement une fois la carte visible */
.skill-category.visible:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* --- RESPONSIVE --- */
@media screen and (max-width: 480px) {
    .skills-wrapper {
        gap: 20px;
    }
    
    .skill-category {
        padding: 20px 15px; /* Réduction du padding pour laisser plus de place aux bulles */
    }
    
    .skill-list {
        justify-content: center; /* Centrer les bulles sur mobile */
    }

    .skill-item {
        font-size: 0.85rem; /* Texte légèrement plus petit */
        padding: 6px 12px;
        max-width: 100%; /* S'assure que les longs textes ne dépassent pas */
        text-align: center;
        white-space: normal; /* Permet le retour à la ligne si besoin */
    }
    
    .skill-category h3 {
        justify-content: center;
        text-align: center;
    }
    
    .skill-category h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}