/**
 * Styles pour le carousel de ressources
 *
 * @package Evofia
 * @since 1.0.0
 */

/* ==========================================================================
   Conteneur principal
   ========================================================================== */

.evofia-ressources-carousel-wrapper {
    padding: 2rem 0;
}

/* ==========================================================================
   Carousel container
   ========================================================================== */

.ressources-carousel {
    position: relative;
    min-height: 400px;
}
.carousel-inner {
    overflow: visible;
}
/* ==========================================================================
   Cards de ressources
   ========================================================================== */

.ressource-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
    height: 100%;
    background: #FBF7E6CC;
}

.ressource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 64, 82, 0.25);
}

/* ==========================================================================
   Image et badge de type
   ========================================================================== */

.ressource-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
}

.ressource-card .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ressource-card:hover .card-img-top {
    transform: scale(1.05);
}

.ressource-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #004052 0%, #003442 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 64, 82, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.ressource-type-badge i {
    font-size: 1.125rem;
}

/* ==========================================================================
   Contenu de la carte
   ========================================================================== */

.ressource-card .card-body {
    padding: 1.5rem;
}

/* Titre */
.ressource-card .card-title {
    font-size: 1.25rem;
    margin-bottom: 0;
    line-height: 1.3;
}

.ressource-card .card-title a {
    color: #004052;
    font-weight: 700;
    transition: color 0.3s ease;
}

.ressource-card .card-title a:hover {
    color: #46B370;
}

.ressource-card .card-title i {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ressource-card .card-title a:hover i {
    opacity: 1;
}

/* Texte */
.ressource-card .card-text {
    color: #6c757d;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Actions */
.ressource-actions {
    display: flex;
    gap: 0.75rem;
}

.ressource-actions .btn {
    /*border-radius: 2rem;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: #004052;
    border-color: #004052;
    color: white;
    flex: 1;*/
}

.ressource-actions .btn:hover {
    /*transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 64, 82, 0.4);
    background-color: #46B370;
    border-color: #46B370;*/
}

.ressource-actions .btn i {
    transition: transform 0.3s ease;
}

.ressource-actions .btn:hover i {
    transform: translateX(3px);
}

/* ==========================================================================
   Contrôles du carousel
   ========================================================================== */

.ressources-carousel .carousel-control-prev,
.ressources-carousel .carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: #004052;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.ressources-carousel .carousel-control-prev {
    left: -80px;
}

.ressources-carousel .carousel-control-next {
    right: -80px;
}

.ressources-carousel .carousel-control-prev:hover,
.ressources-carousel .carousel-control-next:hover {
    background-color: #46B370;
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.ressources-carousel .carousel-control-prev-icon,
.ressources-carousel .carousel-control-next-icon {
    width: 30px;
    height: 30px;
}

/* ==========================================================================
   Compteur de résultats
   ========================================================================== */

.ressources-count {
    margin-top: 2rem;
}

.ressources-count p {
    font-size: 1rem;
    margin: 0;
}

/* ==========================================================================
   Types de ressources spécifiques
   ========================================================================== */

/* Vidéo */
.ressource-card[data-type="video"] .ressource-type-badge {
    background: linear-gradient(135deg, #EB7421 0%, #d96310 100%);
}

/* Document PDF */
.ressource-card[data-type="pdf"] .ressource-type-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Lien externe */
.ressource-card[data-type="link"] .ressource-type-badge {
    background: linear-gradient(135deg, #46B370 0%, #3a9a5e 100%);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .ressources-carousel .carousel-control-prev {
        left: -40px;
    }

    .ressources-carousel .carousel-control-next {
        right: -40px;
    }
}

@media (max-width: 991px) {
    .ressources-carousel .carousel-control-prev {
        left: 10px;
    }

    .ressources-carousel .carousel-control-next {
        right: 10px;
    }

    .ressources-carousel .carousel-control-prev,
    .ressources-carousel .carousel-control-next {
        width: 50px;
        height: 50px;
    }

    .ressource-card .card-img-top {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .ressource-card .card-img-top {
        height: 200px;
    }

    .ressource-card .card-title {
        font-size: 1.125rem;
    }

    .ressources-carousel .carousel-control-prev,
    .ressources-carousel .carousel-control-next {
        width: 45px;
        height: 45px;
    }

    .ressources-carousel .carousel-control-prev-icon,
    .ressources-carousel .carousel-control-next-icon {
        width: 25px;
        height: 25px;
    }

    .ressource-type-badge {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .ressource-type-badge i {
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    .ressource-card .card-body {
        padding: 1.25rem;
    }

    .ressources-carousel .carousel-control-prev {
        left: 5px;
    }

    .ressources-carousel .carousel-control-next {
        right: 5px;
    }

    .ressource-actions {
        flex-direction: column;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ressource-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Animation du badge */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.ressource-type-badge {
    animation: pulse 2s ease-in-out infinite;
}

.ressource-card:hover .ressource-type-badge {
    animation: none;
}

/* ==========================================================================
   Accessibilité
   ========================================================================== */

.ressources-carousel .carousel-control-prev:focus,
.ressources-carousel .carousel-control-next:focus {
    outline: 3px solid #46B370;
    outline-offset: 4px;
}

.ressource-card:focus-within {
    outline: 2px solid #46B370;
    outline-offset: 4px;
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .ressources-carousel .carousel-control-prev,
    .ressources-carousel .carousel-control-next {
        display: none !important;
    }

    .ressource-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        page-break-inside: avoid;
    }

    .ressource-type-badge {
        box-shadow: none;
    }
}

/* ==========================================================================
   Dark mode support (optionnel)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ressource-card {
        background: #1a1a1a;
        color: #f0f0f0;
    }

    .ressource-card .card-title a {
        color: #46B370;
    }

    .ressource-card .card-text {
        color: #b0b0b0;
    }
}

/* FIX RAPIDE : Éviter le flash blanc pendant le défilement */
.carousel-inner {
    overflow: hidden !important;
}

.carousel-item {
    backface-visibility: hidden;
    perspective: 1000px;
}

.ressource-card {
    animation: none !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
}