/* Styles pour la section Top Projets */

.top-projects-section {
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.top-projects-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row-reverse;
    gap: 1.5rem;
}

.top-projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    flex-grow: 1;
}

.project-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.project-cover {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-cover img {
    transform: scale(1.1);
}

.project-rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
    color: #fff;
}

.rank-2 {
    background: #C0C0C0; /* Argent */
}

.rank-3 {
    background: #CD7F32; /* Bronze */
}

.rank-4, .rank-5, .rank-6, .rank-7, .rank-8, .rank-9 {
    background: #3498db; /* Bleu pour les autres rangs */
}

.manga-type-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 3px 8px;
    font-size: 0.8rem;
    border-radius: 3px;
    z-index: 2;
}

.project-info {
    padding: 1rem;
}

.project-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card:hover .project-title {
    animation: scrollText 5s linear infinite;
}

@keyframes scrollText {
    0% { transform: translateX(0); }
    50% { transform: translateX(calc(-100% + 100%)); }
    50.01% { transform: translateX(100%); }
    100% { transform: translateX(0); }
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #aaa;
}

.project-genres {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.project-views {
    white-space: nowrap;
}

/* Overlay d'information au survol */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.project-overlay-genres {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.project-overlay-rating {
    color: #ffd700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-overlay-description {
    font-size: 0.8rem;
    color: #ddd;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-overlay-views {
    font-size: 0.8rem;
    color: #aaa;
}

.project-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Projet vedette */
.featured-project {
    width: 300px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.featured-project:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.featured-project-cover {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.featured-project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-project:hover .featured-project-cover img {
    transform: scale(1.05);
}

.top-rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #FFD700; /* Or */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    z-index: 2;
    color: #000;
}

.manga-tag-featured {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    font-size: 0.9rem;
    border-radius: 3px;
    z-index: 2;
}

.featured-project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.featured-project-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-project:hover .featured-project-title {
    animation: scrollText 5s linear infinite;
}

.featured-project-genres {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.featured-project-description {
    font-size: 0.9rem;
    color: #ddd;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.featured-project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #aaa;
}

.featured-project-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Responsive */
@media (max-width: 992px) {
    .top-projects-container {
        flex-direction: column;
    }
    
    .featured-project {
        width: 100%;
        height: auto;
    }
    
    .featured-project-cover {
        height: 300px;
    }
    
    .top-projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .top-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    /* Modification pour afficher en défilement horizontal sur mobile */
    .top-projects-container {
        flex-direction: column;
        max-width: 100%;
        overflow: hidden;
    }
    
    .top-projects-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding: 1rem 0;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        scroll-behavior: smooth;
        width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .top-projects-grid::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
    
    .project-card {
        flex: 0 0 auto;
        width: 180px;
        scroll-snap-align: start;
        margin-right: 0.5rem;
    }
    
    .featured-project {
        width: 100%;
        margin-top: 1.5rem;
    }
}
