/**
 * Styles pour l'affichage des événements de Sainte-Maxime PRO
 * Plugin: Sainte-Maxime Events Display Pro
 * Version: 2.0.0
 */

/* Wrapper principal */
.sm-events-wrapper {
    width: 100%;
    margin: 20px 0;
}

/* === BARRE DE FILTRES === */
.sm-filters-bar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}

/* Filtres de période */
.sm-period-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.sm-period-btn {
    background: #e9ecef;
    border: 2px solid #0066cc;
    color: #0066cc;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.sm-period-btn:hover {
    background: #d3d9df;
    border-color: #0052a3;
    color: #0052a3;
}

.sm-period-btn.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* Recherche et filtres */
.sm-search-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.sm-search-box {
    flex: 1;
    min-width: 250px;
}

.sm-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.sm-search-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.sm-category-filter {
    min-width: 200px;
}

.sm-category-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s ease;
}

.sm-category-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.sm-reset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.sm-reset-btn:hover {
    background: #5a6268;
}

/* === COMPTEUR D'ÉVÉNEMENTS === */
.sm-events-counter {
    text-align: center;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #0066cc;
    font-weight: 600;
    font-size: 15px;
}

.sm-events-counter-bottom {
    margin-top: 20px;
    margin-bottom: 0;
}

/* === CONTAINER PRINCIPAL === */
.sm-events-container {
    width: 100%;
}

/* État de chargement */
.sm-events-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Grille d'événements */
.sm-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

/* Liste d'événements */
.sm-events-list .sm-event-card {
    display: flex;
    margin-bottom: 25px;
    flex-direction: row;
}

.sm-events-list .sm-event-image {
    width: 280px;
    min-width: 280px;
    height: auto;
}

.sm-events-list .sm-event-content {
    flex: 1;
}

/* === CARTE D'ÉVÉNEMENT === */
.sm-event-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sm-event-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Image de l'événement */
.sm-event-image {
    width: 100%;
    height: 220px;
    background: #f5f5f5;
    overflow: hidden;
}

.sm-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sm-event-card:hover .sm-event-image img {
    transform: scale(1.05);
}

/* Contenu de l'événement */
.sm-event-content {
    padding: 20px;
}

/* Date de l'événement */
.sm-event-date {
    color: #0066cc;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Titre de l'événement */
.sm-event-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #222;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sm-event-card:hover .sm-event-title {
    color: #0066cc;
}

/* Catégorie */
.sm-event-category {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Description de l'événement */
.sm-event-description {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Métadonnées (lieu, heure) */
.sm-event-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

/* Lien "Voir les détails" */
.sm-event-link {
    display: inline-block;
    background: #0066cc;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.sm-event-link:hover {
    background: #0052a3;
    transform: translateX(3px);
    text-decoration: none !important;
}

/* === BOUTON CHARGER PLUS === */
.sm-load-more-container {
    text-align: center;
    padding: 30px 0;
}

.sm-load-more-btn {
    background: #0066cc;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 102, 204, 0.2);
}

.sm-load-more-btn:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 102, 204, 0.3);
}

/* Messages d'erreur */
.sm-events-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 6px;
    color: #856404;
    text-align: center;
    margin: 20px 0;
}

.sm-events-error strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sm-events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sm-events-list .sm-event-card {
        flex-direction: column;
    }
    
    .sm-events-list .sm-event-image {
        width: 100%;
        height: 200px;
    }
    
    .sm-event-title {
        font-size: 18px;
    }
    
    .sm-period-filters {
        gap: 8px;
    }
    
    .sm-period-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .sm-search-filters {
        flex-direction: column;
    }
    
    .sm-search-box,
    .sm-category-filter {
        width: 100%;
        min-width: 100%;
    }
    
    .sm-reset-btn {
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sm-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Animation de chargement */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.sm-events-loading p {
    animation: pulse 1.5s ease-in-out infinite;
}
