/* Category Selector Styles */
.categories-tree-container {
    max-height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.categories-tree-container::-webkit-scrollbar {
    width: 8px;
}

.categories-tree-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.categories-tree-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.categories-tree-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #f8f9fa;
    animation: fadeIn 0.3s ease-in-out;
}

.category-item:hover {
    background: #e9ecef;
    transform: translateX(-2px);
}

.category-item.level-0 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 1.05em;
    margin: 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.category-item.level-0:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.category-item.level-0.has-children {
    padding-left: 40px;
}

.category-item.level-1.has-children {
    padding-left: 40px;
    position: relative;
}

.category-item.level-1 .toggle-icon {
    background: rgba(33, 150, 243, 0.2);
}

.category-item.level-1 .toggle-icon:hover {
    background: rgba(33, 150, 243, 0.3);
}

.toggle-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.toggle-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.toggle-icon.collapsed {
    transform: translateY(-50%) rotate(-90deg);
}

.category-item.level-1 {
    margin-right: 25px;
    background: #e3f2fd;
    border-right: 3px solid #2196F3;
    transition: all 0.3s ease, max-height 0.5s ease;
    overflow: hidden;
}

.category-item.level-1.collapsed {
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    border: none !important;
}

.category-item.level-2 {
    margin-right: 50px;
    background: #fff3e0;
    border-right: 3px solid #ff9800;
    font-size: 0.9em;
    transition: all 0.3s ease, max-height 0.5s ease;
    overflow: hidden;
}

.category-item.level-2.collapsed {
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    border: none !important;
}

.category-item .form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.category-item.level-0 .form-check-input {
    border-color: white;
}

.category-item input[type="checkbox"]:checked + label {
    font-weight: 600;
}

.category-item.level-0 input[type="checkbox"]:checked {
    background-color: white;
    border-color: white;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.85em;
}

.category-badge .remove-cat {
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
}

.category-badge .remove-cat:hover {
    color: #ff6b6b;
}

.modal-content {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}
