/* WooCommerce Advanced Category Manager - Admin Styles */

.wcacm-wrap {
    margin: 20px 20px 0 0;
}

.wcacm-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-top: 20px;
}

/* Toolbar */
.wcacm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #dcdcde;
    background: #f9f9f9;
}

.wcacm-toolbar-left,
.wcacm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcacm-view-toggle {
    display: flex;
    gap: 0;
    margin-left: 10px;
}

.wcacm-view-btn {
    border-radius: 0;
    border-right: none;
}

.wcacm-view-btn:first-child {
    border-radius: 3px 0 0 3px;
}

.wcacm-view-btn:last-child {
    border-radius: 0 3px 3px 0;
    border-right: 1px solid #2271b1;
}

.wcacm-view-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.wcacm-search {
    padding: 4px 10px;
    min-width: 250px;
}

.wcacm-tree-sort {
    padding: 6px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    min-width: 180px;
    margin-left: 10px;
    background: #fff;
    cursor: pointer;
    height: 32px;
}

.wcacm-tree-sort:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.wcacm-export-dropdown {
    position: relative;
}

.wcacm-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 1000;
}

.wcacm-dropdown-menu.active {
    display: block;
}

.wcacm-dropdown-menu a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: #2c3338;
}

.wcacm-dropdown-menu a:hover {
    background: #f0f0f1;
}

/* Bulk Actions */
.wcacm-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #f0f6fc;
    border-bottom: 1px solid #c3d9f0;
}

.wcacm-selected-count {
    font-weight: 600;
    color: #2271b1;
}

#wcacm-bulk-action,
#wcacm-bulk-parent {
    max-width: 200px;
}

/* Views */
.wcacm-view {
    display: none;
    padding: 20px;
}

.wcacm-view.active {
    display: block;
}

/* Tree View */
.wcacm-tree-container {
    min-height: 400px;
}

.wcacm-tree-item {
    position: relative;
    padding: 10px 15px;
    margin: 5px 0;
    background: #f9f9f9;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: move;
    transition: all 0.2s;
}

.wcacm-tree-item:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.wcacm-tree-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Drop zones - verschillende visuele feedback */
.wcacm-tree-item.drag-over-top {
    border-top: 3px solid #2271b1;
    background: #f0f6fc;
}

.wcacm-tree-item.drag-over-bottom {
    border-bottom: 3px solid #2271b1;
    background: #f0f6fc;
}

.wcacm-tree-item.drag-over-child {
    background: #e0f0ff;
    border: 2px dashed #2271b1;
    box-shadow: inset 0 0 0 2px #2271b1;
}

.wcacm-tree-item.drag-over-child::after {
    content: "⤷ Drop hier om subcategorie te maken";
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #2271b1;
    font-weight: 600;
    text-align: center;
}

/* Old drag-over class for backward compatibility */
.wcacm-tree-item.drag-over {
    border-color: #2271b1;
    border-width: 2px;
    background: #f0f6fc;
}

.wcacm-tree-children {
    margin-left: 30px;
    padding-left: 15px;
    border-left: 2px solid #dcdcde;
    min-height: 20px;
    transition: all 0.2s ease;
}

.wcacm-tree-children:empty {
    min-height: 10px;
    padding: 5px 0;
}

.wcacm-tree-children.ui-sortable-over {
    min-height: 50px;
    background: #e0f0ff;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    padding: 10px 15px;
}

.wcacm-tree-children.ui-sortable-over:empty::before {
    content: "⤷ Drop hier om subcategorie te maken";
    display: block;
    color: #2271b1;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.wcacm-tree-placeholder {
    background: #e0f0ff;
    border: 2px dashed #2271b1;
    height: 50px;
    margin: 5px 0;
    border-radius: 4px;
    visibility: visible !important;
}

.wcacm-tree-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wcacm-tree-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.wcacm-tree-item-name {
    font-weight: 600;
    font-size: 14px;
}

.wcacm-tree-item-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #646970;
}

.wcacm-tree-item-actions {
    display: flex;
    gap: 5px;
}

.wcacm-tree-item-checkbox {
    margin-right: 10px;
}

.wcacm-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #dcdcde;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.wcacm-badge.primary {
    background: #2271b1;
    color: #fff;
}

/* Table View */
.wcacm-table-view table {
    margin: 0;
}

.wcacm-table-view th,
.wcacm-table-view td {
    padding: 12px 10px;
}

.wcacm-col-id {
    width: 60px;
}

.wcacm-col-name {
    width: auto;
    min-width: 200px;
}

.wcacm-col-slug {
    width: 150px;
}

.wcacm-col-parent {
    width: 150px;
}

.wcacm-col-count {
    width: 80px;
    text-align: center;
}

.wcacm-col-date {
    width: 110px;
    text-align: center;
    font-size: 12px;
    color: #50575e;
}

.wcacm-col-actions {
    width: 120px;
    text-align: right;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px !important;
    transition: background 0.15s ease;
}

.sortable:hover {
    background: #f0f0f1;
}

.sortable .dashicons {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #8c8f94;
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.sortable.asc .dashicons-sort:before {
    content: "\f142";
    color: #2271b1;
    font-weight: bold;
}

.sortable.desc .dashicons-sort:before {
    content: "\f140";
    color: #2271b1;
    font-weight: bold;
}

/* Action Buttons - Perfect Centering */
.wcacm-btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 3px;
    font-size: 0 !important;
    line-height: 1 !important;
    height: 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #dcdcde;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
}

.wcacm-btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.wcacm-btn-icon.wcacm-edit-btn {
    color: #2271b1;
    border-color: #2271b1;
}

.wcacm-btn-icon.wcacm-edit-btn:hover {
    background: #2271b1;
    color: #fff;
}

.wcacm-btn-icon.wcacm-delete-btn {
    color: #d63638;
    border-color: #d63638;
}

.wcacm-btn-icon.wcacm-delete-btn:hover {
    background: #d63638;
    color: #fff;
}

.wcacm-btn-icon .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    line-height: 1 !important;
}

/* Toolbar buttons with icons */
.wcacm-toolbar .button .dashicons {
    vertical-align: middle;
    margin-right: 5px;
    line-height: 1;
}

.wcacm-toolbar .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* View toggle buttons */
.wcacm-view-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px;
    padding: 6px 12px !important;
}

.wcacm-view-btn .dashicons {
    margin: 0 !important;
    line-height: 1 !important;
}

/* Export button */
#wcacm-export-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px;
}

#wcacm-export-btn .dashicons {
    margin: 0 !important;
    line-height: 1 !important;
}

/* Add category button */
#wcacm-add-category {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px;
}

#wcacm-add-category .dashicons {
    margin: 0 !important;
    line-height: 1 !important;
}
}

/* Modal */
.wcacm-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.8) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    overflow-y: auto !important;
}

.wcacm-modal.show {
    display: flex !important;
}

.wcacm-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: visible;
    margin: auto;
    position: relative;
}

.wcacm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #dcdcde;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.wcacm-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.wcacm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #50575e;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.wcacm-modal-close:hover {
    background: #f0f0f1;
    color: #d63638;
}

.wcacm-modal-body {
    padding: 24px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.wcacm-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #dcdcde;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.wcacm-modal-footer .button {
    min-width: 100px;
    text-align: center;
}

/* Form */
.wcacm-form-group {
    margin-bottom: 20px;
}

.wcacm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.wcacm-form-group input[type="text"],
.wcacm-form-group textarea,
.wcacm-form-group select {
    width: 100%;
}

.wcacm-form-group .description {
    margin-top: 5px;
    font-size: 12px;
    color: #646970;
}

/* Loading */
.wcacm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #646970;
}

.wcacm-loading .spinner {
    float: none;
    margin: 0 10px 0 0;
}

/* Notifications */
.wcacm-notice {
    position: fixed;
    top: 32px;
    right: 20px;
    background: #fff;
    border-left: 4px solid #00a32a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 100001;
    animation: slideIn 0.3s ease;
}

.wcacm-notice.error {
    border-left-color: #d63638;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 782px) {
    .wcacm-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .wcacm-toolbar-left,
    .wcacm-toolbar-right {
        flex-direction: column;
        width: 100%;
    }
    
    .wcacm-search {
        width: 100%;
    }
    
    .wcacm-tree-children {
        margin-left: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wcacm-container {
        background: #1e1e1e;
        border-color: #3c3c3c;
    }
    
    .wcacm-toolbar {
        background: #2a2a2a;
        border-color: #3c3c3c;
    }
    
    .wcacm-tree-item {
        background: #2a2a2a;
        border-color: #3c3c3c;
    }
}
