/* Auto Create Categories Feature Styles */

.auto-create-categories-container {
    max-width: 1200px;
    margin: 20px 0;
}

/* Container for left column */
.auto-create-categories-container-left {
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Show meta box when moved to left column */
#auto-create-categories-meta-box {
    display: block !important;
}

/* Adjust trigger buttons for left column */
#auto-create-categories-container .auto-create-categories-trigger {
    margin: 0 0 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    border-radius: 4px;
}

#auto-create-categories-container .auto-create-categories-trigger .button {
    width: 100%;
    margin-left: 0 !important;
    margin-bottom: 10px;
}

#auto-create-categories-container .auto-create-categories-trigger .button:last-child {
    margin-bottom: 0;
}

/* Adjust cron status widget for left column */
#auto-create-categories-container .cron-descriptions-status-widget {
    margin: 0 0 20px 0;
}

.aiautotool-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    border-radius: 4px;
    padding: 20px;
}

.aiautotool-card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.aiautotool-card-header h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
}

.aiautotool-card-header p {
    margin: 0;
    color: #646970;
    font-size: 14px;
    line-height: 1.6;
}

.aiautotool-card-body {
    padding: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #23282d;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    border-color: #00875c;
    outline: none;
    box-shadow: 0 0 0 1px #00875c;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 30px;
}

.loading-indicator .spinner {
    float: none;
    margin: 0 auto 15px;
}

.loading-indicator p {
    margin: 0;
    color: #646970;
    font-size: 14px;
}

/* Category Tree Container */
.category-tree-container {
    margin-top: 25px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.category-tree-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}

/* Category Tree List */
.category-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-tree-list.level-0 {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 10px;
}

.category-tree-list.level-1 {
    margin-left: 30px;
    margin-top: 10px;
    padding-left: 20px;
    border-left: 2px solid #e5e5e5;
}

.category-tree-list.level-2 {
    margin-left: 30px;
    margin-top: 8px;
    padding-left: 20px;
    border-left: 2px solid #d0d0d0;
}

.category-item {
    margin-bottom: 10px;
}

.category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: all 0.2s;
}

.category-row:hover {
    background: #f5f5f5;
    border-color: #00875c;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #23282d;
    padding-right: 15px;
}

.category-name.editable {
    cursor: pointer;
    padding: 5px 8px;
    border: 1px dashed transparent;
    border-radius: 3px;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.category-name.editable:hover {
    border-color: #00875c;
    background: #e8f5e8;
    color: #00875c;
}

.category-name.editable:active {
    border-color: #007a52;
    background: #d4edda;
}

/* Show edit indicator on hover */
.category-name.editable:hover::after {
    content: '✎';
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.6;
    vertical-align: middle;
    display: inline-block;
}

.category-name-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #00875c;
    border-radius: 3px;
    font-size: 15px;
    font-weight: 500;
    color: #23282d;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 135, 92, 0.1);
}

.category-name.editing {
    border: 1px solid #00875c;
    background: #fff;
    outline: none;
}

/* Category item actions (edit/delete buttons) */
.category-item-actions {
    display: flex !important;
    gap: 8px;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.category-item-actions .button {
    padding: 6px 12px;
    min-height: auto;
    line-height: 1.4;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.category-item-actions .button .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.category-item-actions .button i {
    font-size: 14px;
    display: inline-block;
    width: auto;
    height: auto;
    line-height: 1;
}

.category-item-actions .button:empty {
    min-width: 36px;
    padding: 6px;
}

/* Ensure Font Awesome icons are visible */
.category-item-actions .button i.fa-solid,
.category-item-actions .button i.fa-regular,
.category-item-actions .button i.fa-brands {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.edit-category {
    color: #00875c;
    border-color: #00875c;
}

.edit-category:hover {
    background: #00875c;
    color: #fff;
}

.delete-category {
    color: #d63638 !important;
    border-color: #d63638 !important;
    background: transparent;
}

.delete-category:hover {
    background: #d63638 !important;
    color: #fff !important;
}

.delete-category i {
    display: inline-block !important;
    font-size: 14px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
}

.delete-category i.fa-solid,
.delete-category i.fa-trash {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
}

/* Fallback if Font Awesome doesn't load - show text */
.delete-category:not(:has(i))::before,
.delete-category i:empty::before {
    content: "×";
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

/* Ensure button is always visible */
.category-item-actions .delete-category {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
}

/* Category Actions */
.category-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

/* Progress Bar */
.add-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e5e5e5;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00875c, #00b57b);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    color: #646970;
    font-size: 14px;
    margin: 0;
}

/* Error Message */
.error-message {
    padding: 12px 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
}

/* Success Message */
.success-message {
    padding: 12px 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 15px;
}

/* Trigger Button Styles */
.auto-create-categories-trigger {
    margin: 20px 0;
    text-align: center;
}

.auto-create-categories-trigger .button {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auto-create-categories-trigger .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.auto-create-categories-trigger .button i {
    margin-right: 8px;
}

/* Modal Overlay */
.auto-create-categories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Container */
.auto-create-categories-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideInModal 0.3s ease;
    overflow: hidden;
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.auto-create-categories-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.auto-create-categories-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-create-categories-modal-header h2 i {
    color: #00875c;
}

.auto-create-categories-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #646970;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.auto-create-categories-close:hover {
    background: #f0f0f0;
    color: #d63638;
}

/* Modal Body */
.auto-create-categories-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.auto-create-categories-modal-body .auto-create-categories-container {
    margin: 0;
}

/* Modal Styles (for edit-tags.php) */
#auto-create-categories-meta-box {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#auto-create-categories-meta-box .aiautotool-card {
    box-shadow: none;
    border: none;
    padding: 0;
}

/* Responsive */
@media (max-width: 782px) {
    .auto-create-categories-overlay {
        padding: 10px;
    }
    
    .auto-create-categories-modal {
        max-height: 95vh;
    }
    
    .auto-create-categories-modal-header {
        padding: 15px 20px;
    }
    
    .auto-create-categories-modal-header h2 {
        font-size: 18px;
    }
    
    .auto-create-categories-modal-body {
        padding: 20px 15px;
    }
    
    .category-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-item-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .category-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .category-tree-list.level-1,
    .category-tree-list.level-2 {
        margin-left: 15px;
    }
}

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

.category-tree-container {
    animation: fadeIn 0.3s ease;
}

.category-item {
    animation: fadeIn 0.3s ease;
}

/* Step Header Styles */
.step-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e5e5e5;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 200px;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e5e5e5;
    color: #646970;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border: 3px solid #e5e5e5;
}

.step-item.active .step-number {
    background: #00875c;
    color: #fff;
    border-color: #00875c;
    box-shadow: 0 0 0 4px rgba(0, 135, 92, 0.1);
}

.step-item.completed .step-number {
    background: #00a32a;
    color: #fff;
    border-color: #00a32a;
    font-size: 0;
}

.step-item.completed .step-number::after {
    content: '\2713';
    font-size: 24px;
    font-weight: bold;
    line-height: 50px;
    display: block;
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: #646970;
    text-align: center;
    transition: color 0.3s ease;
}

.step-item.active .step-label {
    color: #00875c;
    font-weight: 600;
}

.step-item.completed .step-label {
    color: #00a32a;
}

.step-connector {
    flex: 1;
    height: 3px;
    background: #e5e5e5;
    margin: 0 15px;
    margin-top: -25px;
    position: relative;
    transition: background 0.3s ease;
}

.step-connector.completed {
    background: #00a32a;
}

/* Step Content */
.step-content {
    min-height: 200px;
    padding: 20px 0;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.step-navigation .button {
    min-width: 120px;
}

.category-preview {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* Responsive Step Header */
@media (max-width: 782px) {
    .step-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .step-connector {
        display: none;
    }
    
    .step-item {
        max-width: 100%;
        width: 100%;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .step-navigation .button {
        width: 100%;
    }
}

/* Category Selector Styles */
.category-select-item {
    padding: 8px 0;
    transition: background 0.2s;
}

.category-select-item:hover {
    background: #f5f5f5;
    border-radius: 4px;
}

.category-select-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.category-select-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.category-select-item input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #00875c;
}

/* Description Progress Item */
.desc-progress-item {
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    transition: all 0.3s ease;
}

.desc-progress-item.processing {
    border-color: #00875c;
    background: #e8f5e8;
}

.desc-progress-item.completed {
    border-color: #00a32a;
    background: #d4edda;
}

.desc-progress-item.failed {
    border-color: #d63638;
    background: #fcf0f1;
}

.desc-progress-item i {
    margin-right: 8px;
}

/* Category Selector Container */
#category-selector-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
    background: #fff;
}

#category-selector-container::-webkit-scrollbar {
    width: 8px;
}

#category-selector-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#category-selector-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#category-selector-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Multiple buttons in trigger */
.auto-create-categories-trigger {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

@media (max-width: 782px) {
    .auto-create-categories-trigger {
        flex-direction: column;
    }
    
    .auto-create-categories-trigger .button {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* Cron Status Widget Styles */
.cron-descriptions-status-widget {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #00875c;
}

.cron-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.cron-status-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cron-status-header h3 i {
    color: #00875c;
}

.cron-status-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-weight: 600;
    color: #646970;
    font-size: 13px;
}

.status-value {
    font-weight: 700;
    font-size: 18px;
    padding: 4px 12px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #ddd;
}

.status-value.pending {
    color: #d63638;
    border-color: #d63638;
    background: #fcf0f1;
}

.status-value.completed {
    color: #00a32a;
    border-color: #00a32a;
    background: #d4edda;
}

.cron-status-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.cron-status-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cron-status-section h4 i {
    color: #646970;
}

.cron-status-section h4 .badge {
    margin-left: auto;
    padding: 2px 8px;
    background: #00875c;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.cron-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.cron-status-list li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f9f9f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.cron-status-list.pending-list li {
    border-left-color: #d63638;
}

.cron-status-list.pending-list li i {
    color: #d63638;
}

.cron-status-list.completed-list li {
    border-left-color: #00a32a;
    background: #d4edda;
}

.cron-status-list.completed-list li i {
    color: #00a32a;
}

.cron-status-list li span {
    flex: 1;
    color: #23282d;
}

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

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

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

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

#refresh-cron-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

#refresh-cron-status i {
    animation: none;
}

#refresh-cron-status.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}



