/* Section des filtres par tags */
.tags-filter-section {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

.tags-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 0;
    border: none;
    background: none;
    width: 100%;
    font-size: 1em;
    font-weight: 600;
    color: #495057;
    transition: color 0.2s ease;
}

.tags-filter-toggle:hover {
    color: #007bff;
}

.tags-filter-toggle .toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.tags-filter-section.expanded .tags-filter-toggle .toggle-icon {
    transform: rotate(180deg);
}

.tags-filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.tags-filter-section.expanded .tags-filter-content {
    max-height: 300px;
    opacity: 1;
    padding-top: 15px;
}

/* Nuage de tags */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 50px;
    align-items: center;
    justify-content: center;
}

.tags-cloud:empty::after {
    content: "Aucun tag disponible";
    color: #6c757d;
    font-style: italic;
}

.tag-filter {
    background-color: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
    position: relative;
}

.tag-filter:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-1px);
}

.tag-filter.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.tag-filter.active::after {
    content: "✓";
    margin-left: 6px;
    font-weight: bold;
}

/* Badge pour compter les tags sélectionnés */
.selected-tags-badge {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Actions des filtres */
.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.clear-filters-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background-color: #495057;
    transform: translateY(-1px);
}

.clear-filters-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.active-filters-info {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .clear-filters-btn {
        width: 100%;
    }
}