/**
 * Styles pour les widgets de taxonomie
 */

/* Style général des widgets */
.widget {
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e52e2e;
}

.widget-icon {
    font-size: 20px;
}

/* Widgets avec cases à cocher */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.checkbox-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.checkbox-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.checkbox-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    position: relative;
}

.checkbox-item:hover {
    background: #f9f9f9;
    border-color: #e52e2e;
    transform: translateX(3px);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #e52e2e;
}

.checkbox-label {
    flex: 1;
    color: #333;
    font-size: 15px;
    font-weight: 500;
}

.checkbox-item .count {
    color: #666;
    font-size: 13px;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* État sélectionné */
.checkbox-item:has(input:checked) {
    background: #fff5f5;
    border-color: #e52e2e;
}

.checkbox-item:has(input:checked) .checkbox-label {
    color: #e52e2e;
    font-weight: 600;
}

/* Styles pour la hiérarchie */
.checkbox-item.level-1 {
    margin-left: 20px;
    background: #fafafa;
    border-left: 3px solid #e0e0e0;
}

.checkbox-item.level-2 {
    margin-left: 40px;
    background: #fcfcfc;
    border-left: 3px solid #f0f0f0;
}

.checkbox-item.level-1 .checkbox-label,
.checkbox-item.level-2 .checkbox-label {
    font-size: 14px;
}

/* Indicateur de sous-catégorie */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Hover spécial pour les sous-catégories */
.checkbox-item.level-1:hover,
.checkbox-item.level-2:hover {
    background: #fff5f5;
    border-left-color: #e52e2e;
}

/* Responsive */
@media (max-width: 768px) {
    .widget {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .widget-title {
        font-size: 16px;
    }
    
    .checkbox-list {
        max-height: 300px;
    }
    
    .checkbox-item {
        padding: 8px 10px;
    }
    
    .checkbox-label {
        font-size: 14px;
    }
}

/* Bouton de réinitialisation */
.reset-filters-btn {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background: #e52e2e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-filters-btn:hover {
    background: #c41e1e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 46, 46, 0.3);
}

.reset-filters-btn:active {
    transform: translateY(0);
}

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

/* Message d'erreur */
.error {
    text-align: center;
    padding: 20px;
    background: #fee;
    color: #c00;
    border-radius: 6px;
    margin: 20px 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .widget {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .widget-title {
        color: #e0e0e0;
    }
    
    .widget-fuel-type .fuel-type-dropdown {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .checkbox-item {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .checkbox-label {
        color: #e0e0e0;
    }
    
    .checkbox-item:hover {
        background: #333;
    }
    
    .checkbox-item .count {
        background: #333;
        color: #aaa;
    }
}