/* Styles pour l'affichage des sessions */

/* Container principal */
.sessions-container {
    margin-bottom: 40px;
}

.sessions-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

/* Barre de recherche et filtres */
.sessions-search-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.sessions-search {
    width: 350px !important;
    padding: 12px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease !important;
    background-color: #fff;
}

.sessions-search:focus {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
    outline: none;
}

.sessions-sort-select {
    width: 300px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sessions-sort-select:focus {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
    outline: none;
}

/* Rendre les conteneurs flexibles pour aligner à gauche et à droite */
.sessions-search-container {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 991px) and (min-width: 768px) {
    .sessions-search {
        width: 280px;
    }

    .sessions-sort-select {
        width: 250px;
    }
}

@media (max-width: 767px) {
    .sessions-search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .sessions-search,
    .sessions-sort-select {
        width: 100%;
    }
}

/* Grille responsive avec loader */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    position: relative;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.sessions-grid.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

.sessions-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(34, 113, 177, 0.2);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: spin 1s infinite linear;
    z-index: 11;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

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

@media (min-width: 768px) {
    .sessions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sessions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Carte de session */
.session-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.session-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.session-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.session-card-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    height: 100%;
}

.session-card-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    transition: background 0.3s ease;
}

.session-card:hover .session-card-bg::before {
    background: rgba(0, 0, 0, 0.8);
}

.session-card-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* En-tête de la carte */
.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.session-card-counter {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.session-card-counter i {
    margin-right: 5px;
}

/* Badges de statut */
.session-card-status {
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 17px;
}

.session-status-en-cours {
    background-color: #4caf50;
    color: #fff;
}

.session-status-prochainement {
    background-color: #2196f3;
    color: #fff;
}

.session-status-terminee {
    background-color: #757575;
    color: #fff;
}

/* Titre et contenu */
.session-card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 52px;
    text-transform:uppercase;
}

.session-card-excerpt {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    font-weight: 500;
}

/* Informations supplémentaires */
.session-card-info {
    margin-top: auto;
    font-size: 13px;
    line-height: 1.4;
}

.session-card-date {
    margin-bottom: 5px;
    opacity: 0.9;
}

.session-card-animateurs {
    font-style: italic;
    opacity: 1;
    font-size: 14px;
}

/* Bouton "Voir plus" */
.sessions-load-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 40px;
}

.sessions-load-more-btn {
    background-color: #2271b1;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sessions-load-more-btn:hover {
    background-color: #135e96;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.sessions-load-more-btn:focus {
    outline: none;
}

.sessions-load-more-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    padding-left: 45px;
}

.sessions-load-more-btn.loading::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s infinite linear;
}

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