/* modern-categories.css */
/* استایل کلی ویجت */
.widget_categories {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.widget_categories .widgettitle {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    text-align: center;
}

/* استایل لیست دسته بندی */
.widget_categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_categories li {
    margin-bottom: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.widget_categories li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #495057;
    padding: 10px 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
    padding-left: 45px; /* فضا برای تعداد پست */
    padding-right: 35px; /* فضا برای دکمه +- */
}

.widget_categories li a:hover {
    background-color: #e9f7fe;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
}

/* استایل تعداد پست ها - سمت چپ */
.widget_categories .post-count {
    position: absolute;
    left: 10px;
    background: #f1f3f4;
    color: #6c757d;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* استایل زیر دسته ها */
.widget_categories .children {
    margin-top: 8px;
    margin-right: 25px;
    display: none;
    border-right: 2px dashed #dee2e6;
    padding-right: 15px;
}

.widget_categories .children li {
    margin-bottom: 5px;
}

.widget_categories .children li a {
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding-left: 40px; /* فضا برای تعداد پست در زیردسته */
    padding-right: 30px; /* فضا برای دکمه +- در زیردسته */
}

/* دکمه باز و بسته کردن - سمت راست */
.widget_categories .toggle-children {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.widget_categories .toggle-children:hover {
    background: #0056b3;
    transform: translateY(-50%) scale(1.1);
}

/* آیتم های دارای زیردسته */
.widget_categories li.has-children > a {
    font-weight: 600;
    color: #2c3e50;
}

/* انیمیشن برای زیردسته ها */
.widget_categories .children.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* واکنش گرا */
@media (max-width: 768px) {
    .widget_categories {
        padding: 15px;
    }
    
    .widget_categories .widgettitle {
        font-size: 1.2rem;
    }
    
    .widget_categories li a {
        padding: 8px 12px;
        font-size: 0.9rem;
        padding-left: 40px;
        padding-right: 30px;
    }
    
    .widget_categories .children li a {
        padding-left: 35px;
        padding-right: 25px;
    }
}