/* Conteneur principal des filtres */
.acf-filters-container {
    width: 100%;
    margin: 20px 0;
}

/* Formulaire de filtres */
.acf-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Groupe de filtres */
.filter-group {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

/* Champs de saisie */
.acf-filter-select,
.acf-filter-input,
.acf-filter-date {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
}

.acf-filter-select:focus,
.acf-filter-input:focus,
.acf-filter-date:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* État de chargement pour les filtres en cascade */
.acf-filter-select.loading {
    opacity: 0.6;
    pointer-events: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230073aa" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-opacity="0.25"/><path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/></path></svg>');
    background-repeat: no-repeat;
    background-position: right 30px center;
    background-size: 20px;
}

/* Boutons d'action */
.filter-actions {
    flex: 1 1 100%;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 10px;
}

.btn-filter,
.btn-reset {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-filter {
    background: #0073aa;
    color: white;
}

.btn-filter:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.btn-reset {
    background: #e0e0e0;
    color: #333;
}

.btn-reset:hover {
    background: #d0d0d0;
}

/* Loader */
.filter-loader {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Résultats filtrés */
.filtered-results {
    margin-top: 30px;
}

.results-count {
    background: #e8f5e9;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #2e7d32;
}

/* Grille de posts */
.filtered-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.filtered-post-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.filtered-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.filtered-post-item .post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.filtered-post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.filtered-post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.filtered-post-item .post-content {
    padding: 20px;
}

.filtered-post-item h3 {
    margin: 0 0 15px;
    font-size: 20px;
}

.filtered-post-item h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.filtered-post-item h3 a:hover {
    color: #0073aa;
}

.post-meta {
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.post-meta p {
    margin: 5px 0;
}

.post-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s;
}

.read-more:hover {
    color: #005a87;
}

.no-results,
.error {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.error {
    background: #ffebee;
    color: #c62828;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.btn-pagination {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #0073aa;
    color: white;
}

.btn-pagination:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.btn-pagination:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.page-indicator {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    padding: 0 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .acf-filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        flex: 1 1 100%;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .btn-filter,
    .btn-reset {
        width: 100%;
    }
    
    .filtered-posts-grid {
        grid-template-columns: 1fr;
    }
}
