/* ===== STYLES POUR LES REPOSITORIES GITHUB ===== */

.github-repos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.github-repo {
    border-left: 4px solid #24292e;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.github-repo:hover {
    border-left-color: #f9826c;
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(36, 41, 46, 0.15);
}

.github-repo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 49%, rgba(249, 130, 108, 0.05) 50%, transparent 51%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.github-repo:hover::before {
    opacity: 1;
}

.github-repo .project-header {
    position: relative;
    padding-bottom: 15px;
    border-bottom: 2px solid #f6f8fa;
}

.github-repo .project-icon {
    background: linear-gradient(135deg, #24292e, #586069);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.github-repo .project-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.github-repo .project-meta h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.github-repo .project-meta h4 a {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.github-repo .project-meta h4 a:hover {
    color: #f9826c;
    text-decoration: underline;
}

.visibility-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visibility-badge.public {
    background: linear-gradient(135deg, #28a745, #34ce57);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.visibility-badge.private {
    background: linear-gradient(135deg, #ffc107, #ffcd39);
    color: #212529;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.repo-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.repo-stats .stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #586069;
    font-size: 0.85rem;
    font-weight: 500;
}

.repo-stats .stat i {
    color: #f9826c;
    font-size: 0.9rem;
}

.github-repo .project-content {
    padding: 20px;
    background: rgba(246, 248, 250, 0.3);
}

.github-repo .project-content p {
    color: #586069;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.tech-tag.primary-lang {
    background: linear-gradient(135deg, #0366d6, #0550ae);
    color: white;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.3);
}

.tech-tag.topic {
    background: #f1f8ff;
    color: #0366d6;
    border: 1px solid #c8e1ff;
    font-size: 0.8rem;
}

.tech-tag.topic:hover {
    background: #dbedff;
    border-color: #0366d6;
}

.repo-dates {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6a737d;
    font-size: 0.8rem;
}

.date-info i {
    color: #959da5;
    width: 12px;
}

.github-repo .project-actions {
    background: #f6f8fa;
    padding: 15px 20px;
    border-top: 1px solid #e1e4e8;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.github-repo .project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    color: #24292e;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 15;
    pointer-events: auto;
    min-height: 36px;
}

.github-repo .project-link:hover {
    background: #f6f8fa;
    border-color: #0366d6;
    color: #0366d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 102, 214, 0.15);
}

/* Styles pour forcer la cliquabilité */
.github-repo .project-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(3, 102, 214, 0.2);
}

.github-repo .project-link i {
    pointer-events: none;
}

.github-repo .project-link span {
    pointer-events: none;
}

.github-repo .project-link.demo {
    background: linear-gradient(135deg, #28a745, #34ce57);
    color: white;
    border-color: #28a745;
}

.github-repo .project-link.demo:hover {
    background: linear-gradient(135deg, #218838, #28a745);
    border-color: #1e7e34;
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.github-repo .project-link.download {
    background: linear-gradient(135deg, #6f42c1, #8a63d2);
    color: white;
    border-color: #6f42c1;
}

.github-repo .project-link.download:hover {
    background: linear-gradient(135deg, #5a2d91, #6f42c1);
    border-color: #59339d;
    color: white;
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.category-count {
    background: linear-gradient(135deg, #f9826c, #ff6b47);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(249, 130, 108, 0.3);
}

/* Corrections spécifiques pour les boutons GitHub */
.github-repos {
    isolation: isolate;
    position: relative;
    z-index: 1;
}

.github-repo .project-actions {
    background: #f6f8fa;
    padding: 15px 20px;
    border-top: 1px solid #e1e4e8;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1050; /* Plus élevé que les autres éléments */
    isolation: isolate;
}

.github-repo .project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    color: #24292e !important;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 1051; /* Encore plus élevé */
    pointer-events: auto;
    min-height: 36px;
    /* Solution de débogage */
    box-shadow: 0 0 0 1px transparent;
}

/* Test de cliquabilité - bordure rouge au focus pour déboguer */
.github-repo .project-link:focus {
    outline: 2px solid #ff0000;
    outline-offset: 2px;
}
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.github-repo {
    animation: slideInFromBottom 0.6s ease-out;
    animation-fill-mode: both;
}

.github-repo:nth-child(1) { animation-delay: 0.1s; }
.github-repo:nth-child(2) { animation-delay: 0.2s; }
.github-repo:nth-child(3) { animation-delay: 0.3s; }
.github-repo:nth-child(4) { animation-delay: 0.4s; }
.github-repo:nth-child(5) { animation-delay: 0.5s; }
.github-repo:nth-child(6) { animation-delay: 0.6s; }

/* Loading state pour les repositories */
.github-repos.loading {
    position: relative;
    min-height: 200px;
}

.github-repos.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0366d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Message d'erreur pour l'API GitHub */
.github-error {
    background: #ffeaa7;
    border: 1px solid #fdcb6e;
    color: #2d3436;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

.github-error i {
    font-size: 2rem;
    color: #e17055;
    margin-bottom: 10px;
}

/* Responsive pour les repositories GitHub */
@media (max-width: 768px) {
    .github-repos {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .repo-stats {
        justify-content: center;
    }
    
    .github-repo .project-actions {
        justify-content: center;
    }
    
    .category-count {
        margin-left: 5px;
        margin-top: 5px;
    }
    
    .repo-dates {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .github-repo .project-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .repo-stats {
        justify-content: center;
    }
    
    .github-repo .project-actions {
        flex-direction: column;
    }
    
    .github-repo .project-link {
        justify-content: center;
        padding: 12px 16px;
    }
}