/* ==========================================================================
   Carousel - Slide "Derniers résultats"
   Extrait du bloc <style> de templates/carousel/match-results-slide.html
   Keyframes mutualisés (slideInDown/slideInUp/fadeIn/bounce/slideInLeft/
   drift) : voir carousel.css
   ========================================================================== */

.match-results-slide {
    position: relative;
    min-height: 450px;
    height: auto;
    border-radius: 16px;
    overflow: visible;
    display: flex;
    align-items: center;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background-attachment: fixed;
}

.match-results-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M30 30m-6 0a6 6 0 1 1 12 0a6 6 0 1 1 -12 0'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: drift 20s infinite linear;
}

.slide-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.slide-header {
    text-align: center;
    margin-bottom: 1rem;
}

.slide-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.8s ease-out;
}

.bounce {
    animation: bounce 2s infinite;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: fit-content;
    margin: 0 auto;
    animation: slideInUp 0.8s ease-out 0.5s both;
    max-width: 100%;
}

/* Layout adaptatif selon le nombre de résultats */
.results-container:has(.result-card-compact:nth-child(3)) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
    width: 100%;
    max-width: 900px;
}

.results-container:has(.result-card-compact:nth-child(5)) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
    gap: 0.6rem;
}

.result-card-compact {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
    transform: translateX(-30px);
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    /* Taille fixe pour tous les rectangles */
    width: 280px;
    height: 140px;
    min-width: 280px;
    max-width: 280px;
    min-height: 140px;
    max-height: 140px;
    margin: 0 auto;
}

/* Ajustements pour grille avec 3+ résultats */
.results-container:has(.result-card-compact:nth-child(3)) .result-card-compact {
    width: 280px;
    height: 140px;
    padding: 0.75rem 0.9rem;
}

.results-container:has(.result-card-compact:nth-child(5)) .result-card-compact {
    width: 260px;
    height: 135px;
    padding: 0.7rem 0.85rem;
}

/* Ajustements légers pour 5+ résultats (encore plus compact) */
.results-container:has(.result-card-compact:nth-child(5)) .team-name-result {
    font-size: 0.65rem;
    max-width: 100px;
}

.results-container:has(.result-card-compact:nth-child(5)) .team-score {
    font-size: 1.5rem;
}

.results-container:has(.result-card-compact:nth-child(5)) .result-badge-mini {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    min-width: 20px;
}

.results-container:has(.result-card-compact:nth-child(5)) .result-date-compact {
    font-size: 0.7rem;
}

.results-container:has(.result-card-compact:nth-child(5)) .result-category-compact {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    max-width: 85px;
}

.result-card-compact[data-result-index="0"] { animation-delay: 0.7s; }
.result-card-compact[data-result-index="1"] { animation-delay: 0.9s; }
.result-card-compact[data-result-index="2"] { animation-delay: 1.1s; }

.result-card-compact:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Header avec date et catégorie */
.result-datetime-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.result-date-compact {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

/* Badge mini V/D/N dans le header */
.result-badge-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    text-transform: uppercase;
    min-width: 22px;
}

.result-badge-mini.victory {
    background: rgba(5, 150, 105, 0.2);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.4);
}

.result-badge-mini.defeat {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.result-badge-mini.draw {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.4);
}

.result-category-compact {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary-600, #dc2626);
    background: rgba(var(--color-primary-rgb, 220, 38, 38), 0.1);
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(var(--color-primary-rgb, 220, 38, 38), 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* Container du score */
.result-score-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex: 1;
}

.result-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.home-result {
    align-items: flex-start;
    text-align: left;
}

.away-result {
    align-items: flex-end;
    text-align: right;
}

.team-name-result {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-score {
    font-size: 1.6rem;
    font-weight: 900;
    color: #6b7280;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

/* Score du vainqueur en vert */
.winner-score {
    color: #059669 !important;
}

/* Score du perdant en rouge */
.loser-score {
    color: #dc2626 !important;
}

/* Score en cas d'égalité */
.draw-score {
    color: #6b7280 !important;
}

/* Score neutre (pas de données) */
.neutral-score {
    color: #6b7280;
}

.score-separator {
    font-size: 1.2rem;
    font-weight: 700;
    color: #6b7280;
    padding: 0 0.3rem;
}

/* Indicateur de résultat - supprimé car déplacé dans header */

.slide-footer {
    margin-top: auto;
    margin-bottom: 5px;
}

.cta-section {
    text-align: center;
}

.cta-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    animation: fadeIn 1s ease-out 1.2s both;
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: slideInUp 0.8s ease-out 1.4s both;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-cta.primary {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-cta.primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-cta.secondary {
    background: transparent;
    color: inherit;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-cta.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

/* Responsive pour les résultats */
@media (max-width: 768px) {
    .match-results-slide {
        height: auto;
        min-height: 400px;
        padding: 1.5rem;
    }

    .slide-title {
        font-size: 2rem;
    }

    .results-container {
        gap: 0.6rem;
    }

    /* En mobile, toujours en colonne même avec 3+ résultats */
    .results-container:has(.result-card-compact:nth-child(3)),
    .results-container:has(.result-card-compact:nth-child(5)) {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }

    .result-card-compact,
    .results-container:has(.result-card-compact:nth-child(3)) .result-card-compact,
    .results-container:has(.result-card-compact:nth-child(5)) .result-card-compact {
        padding: 0.8rem 1rem;
        width: 300px;
        height: 140px;
        min-width: 300px;
        max-width: 300px;
        min-height: 140px;
        max-height: 140px;
    }

    .result-datetime-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem;
        align-items: center;
        justify-content: space-between;
    }

    .result-score-container {
        gap: 0.5rem;
    }

    .team-name-result,
    .results-container:has(.result-card-compact:nth-child(3)) .team-name-result,
    .results-container:has(.result-card-compact:nth-child(5)) .team-name-result {
        font-size: 0.65rem;
        max-width: 130px;
        line-height: 1.1;
    }

    .team-score,
    .results-container:has(.result-card-compact:nth-child(3)) .team-score,
    .results-container:has(.result-card-compact:nth-child(5)) .team-score {
        font-size: 1.4rem;
    }

    .score-separator {
        font-size: 1rem;
    }

    .result-category-compact {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
        max-width: 90px;
    }

    .result-date-compact {
        font-size: 0.65rem;
    }

    .result-badge-mini {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
        min-width: 20px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-cta {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}
