/* استایل‌های اختصاصی صفحه دسته‌بندی‌ها */

.action-buttons-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-bulk-actions {
    margin-bottom: 25px;
}

.category-bulk-actions #bulk-delete-categories-btn {
    padding: 10px;
    background-color: #dc3545;
    border: none;
    border-radius: 10px;
    font-family: 'Vazirmatn';
    color: white;
}

.category-bulk-actions #bulk-delete-categories-btn:disabled {
    background-color: #f3b8be;
    cursor: not-allowed;
    opacity: 0.7;
}

.category-selected-summary {
    font-size: 0.9rem;
    color: #555;
}
.add-category-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.add-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.add-category-btn:active {
    transform: translateY(0);
}

.save-selection-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.save-selection-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.save-selection-btn:active {
    transform: translateY(0);
}

.save-selection-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

#category-form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

#category-form-container.hidden {
    display: none;
}

#form-title {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.5em;
}

.required {
    color: #dc3545;
}

/* استایل آپلود عکس */
.upload-area {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area #category-image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.upload-area #category-image-placeholder {
    color: #6c757d;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: column;
}

.upload-area #category-image-placeholder i {
    font-size: 48px;
    color: #adb5bd;
}

.upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.upload-status.loading {
    background: #e7f3ff;
    color: #0066cc;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* استایل لیست دسته‌بندی‌ها */
.categories-list {
    border: 1px solid #e1e5ea;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
    background: #fff;
}

.categories-list-header {
    display: grid;
    grid-template-columns: 140px 1fr 150px;
    background: #f1f3f5;
    padding: 12px 20px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    border-bottom: 1px solid #e1e5ea;
}

.categories-list-body {
    display: flex;
    flex-direction: column;
}

.category-row {
    display: grid;
    grid-template-columns: 140px 1fr 150px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf1f5;
    align-items: center;
    gap: 15px;
}

.category-row:last-child {
    border-bottom: none;
}

.category-row:hover {
    background: #f9fbfd;
}

.category-col {
    display: flex;
    align-items: center;
}

.col-select {
    justify-content: flex-start;
}

.col-info {
    gap: 15px;
}

.col-actions {
    justify-content: flex-end;
    gap: 8px;
}

.category-select-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
}

.category-select-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f5;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 24px;
}

.category-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.category-name-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.category-name {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.category-parent-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-description {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.5;
    max-height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #868e96;
    align-items: center;
}

.category-show-in-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #495057;
    background: #eef7f1;
    padding: 6px 10px;
    border-radius: 999px;
}

.category-show-in-home.compact {
    background: transparent;
    padding: 0;
}

.category-show-in-home input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #28a745;
    cursor: pointer;
}

.category-count i {
    margin-left: 4px;
}

.category-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn.edit {
    background: #17a2b8;
    color: white;
}

.action-btn.edit:hover {
    background: #138496;
}

.action-btn.delete {
    background: #dc3545;
    color: white;
}

.action-btn.delete:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .categories-list-header {
        display: none;
    }
    .category-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 15px;
    }
    .col-select {
        order: 2;
    }
    .col-info {
        order: 1;
    }
    .col-actions {
        order: 3;
        justify-content: center;
    }
    .category-actions {
        justify-content: center;
    }
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* استایل‌های تنظیمات نمایش */
.display-settings-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.display-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.display-settings-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.display-settings-container.hidden {
    display: none;
}

.display-settings-container h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.display-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.display-setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.display-setting-item label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.display-setting-item label i {
    font-size: 18px;
    color: #667eea;
}

.display-select {
    padding: 10px 15px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.display-select:hover {
    border-color: #667eea;
}

.display-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.display-settings-help {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #e7f3ff;
    border-radius: 6px;
    color: #0066cc;
    font-size: 14px;
}

.display-settings-help i {
    font-size: 18px;
}

/* استایل‌های لیست دسته‌بندی‌های انتخاب شده */
.selected-categories-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.selected-categories-container.hidden {
    display: none;
}

.selected-categories-container h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.drag-hint {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: normal;
}

.selected-categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.selected-category-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
}

.selected-category-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.selected-category-item.dragging {
    opacity: 0.5;
    border-color: #667eea;
}

.selected-category-item.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
}

.drag-handle {
    color: #adb5bd;
    font-size: 20px;
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.selected-category-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.selected-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-category-image .placeholder-img {
    color: #adb5bd;
    font-size: 24px;
}

.selected-category-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.selected-category-order {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.remove-selected-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-selected-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .category-actions {
        flex-direction: column;
    }

    .display-settings-grid {
        grid-template-columns: 1fr;
    }

    .selected-category-item {
        flex-wrap: wrap;
    }

    .drag-hint {
        display: block;
        width: 100%;
        margin-top: 5px;
    }
}
