/* General Styles */
#cmfwc-categories {
    width: 100%; /* mobile screen */
}

@media (min-width: 768px) {
    #cmfwc-categories {
        width: 80%; /* tablet screen */
    }
}

@media (min-width: 1024px) {
    #cmfwc-categories {
        width: 60%; /* desktop screen */
    }
}

.cmfwc-add-category-form {
    background: #fff;
    border: 1px solid #ddd;
    padding: 0;
    margin-bottom: 20px;
    width: 60%;
    box-sizing: border-box;
}

.cmfwc-accordion-header {
    padding: 10px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cmfwc-accordion-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.cmfwc-toggle-icon {
    font-size: 1.2em;
}

.cmfwc-add-category-form form {
    display: none;
}

.cmfwc-add-category-form .form-table th {
    width: 150px;
    padding: 10px 0;
}

.cmfwc-add-category-form .form-table td {
    padding: 10px 0;
}

.cmfwc-add-category-form input[type="text"],
.cmfwc-add-category-form textarea,
.cmfwc-add-category-form select {
    width: 100%;
    max-width: 400px;
}

.cmfwc-add-category-form textarea {
    height: 100px;
}

#cmfwc-add-category {
    padding: 20px;
}

.cmfwc-message.success {
    color: green;
}

.cmfwc-message.error {
    color: red;
}

.cmfwc-category-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0 20px;
}

.cmfwc-subcategories {
    margin-left: 20px;
    min-height: 20px;
    padding: 5px 0;
}

.cmfwc-subcategories:empty {
    border: 1px dashed #ccc;
}

.cmfwc-category {
    background: #fff;
    border: 1px solid #ddd;
    margin: 5px 0;
    padding: 10px;
    width: 90%;
    box-sizing: border-box;
    transition: opacity 0.5s ease;
}

.cmfwc-category.fading {
    opacity: 0;
}

.cmfwc-category-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    justify-content: space-between;
}

.cmfwc-handle {
    cursor: move;
    margin-right: 10px;
    font-size: 18px;
    color: #888;
}

.cmfwc-name {
    flex-grow: 1;
}

.cmfwc-actions {
    display: flex;
    align-items: center;
}

.cmfwc-actions .cmfwc-edit,
.cmfwc-actions .cmfwc-delete,
.cmfwc-actions .cmfwc-confirm-delete {
    margin-left: 10px;
    text-decoration: none;
    color: #0073aa;
    transition: color 0.2s ease;
}

.cmfwc-actions .cmfwc-edit:hover {
    color: #005177;
}

.cmfwc-actions .cmfwc-delete,
.cmfwc-actions .cmfwc-confirm-delete {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #dc3545;
}

.cmfwc-actions .cmfwc-delete:hover,
.cmfwc-actions .cmfwc-confirm-delete:hover {
    color: #a00;
}

.cmfwc-actions .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.cmfwc-edit-form {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cmfwc-edit-form .form-table th {
    width: 150px;
    padding: 10px 0;
}

.cmfwc-edit-form .form-table td {
    padding: 10px 0;
}

.cmfwc-edit-form input[type="text"],
.cmfwc-edit-form textarea,
.cmfwc-edit-form select {
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
}

.cmfwc-edit-form textarea {
    height: 100px;
}

.cmfwc-drag-over {
    background-color: #f0f0f0;
    border: 2px dashed #0073aa;
}

.cmfwc-dragging,
.sortable-chosen {
    opacity: 0.8;
    border: 2px solid #0073aa;
    background-color: #e8f0fe;
}

.sortable-ghost {
    visibility: hidden !important;
}

.cmfwc-sticky-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.cmfwc-sticky-message.error {
    background-color: #dc3545;
}

.cmfwc-sticky-message .undo-btn {
    background: #fff;
    color: #28a745;
    border: 1px solid #28a745;
    padding: 2px 10px;
    margin-left: 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cmfwc-sticky-message .undo-btn:hover {
    background: #28a745;
    color: #fff;
}

.cmfwc-image-preview {
    max-height: 150px;
    display: none;
}

.cmfwc-image-preview.has-image {
    display: block;
}

#cmfwc-undo-timer {
    margin-left: 10px;
    font-weight: bold;
    background-color: #fff;
    color: #28a745;
    padding: 2px 8px;
    border-radius: 3px;
}

.cmfwc-category-image-wrapper {
    display: inline-block;
    vertical-align: middle;
    margin: 0 5px;
}

.cmfwc-category-image {
    max-width: 20px;
    max-height: 20px;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.cmfwc-highlight {
    background-color: #e6ffed; /* سبز کمرنگ */
    transition: background-color 0.5s ease;
}