:root {
    --primary-color: #2271b1;
    --secondary-color: #00a32a;
    --error-color: #d63638;
    --bg-color: #fff;
    --border-color: #ddd;
    --text-color: #333;
    --muted-text-color: #666;
}

.wp-core-ui .button-delete {
    color: var(--error-color);
    border-color: var(--error-color);
    min-height: auto;
    line-height: 2.2;
    padding: 0 6px;

    span{
        font-size: 16px;
    }
}

.drcpu-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-color);
}

.model-uploader-inner{
    display: flex;
    gap: 10px;
}

.dprcu_input {
    width: 100%;
}

/* -- Detected Parts Panel -- */
.detected-parts-panel {
    border: 1px solid var(--border-color);
    margin-top: 15px;
    padding: 10px;
}

.detected-parts-panel h4 {
    margin: 0 0 10px 0;
}

.detected-parts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.part-tag {
    background: #e7e8ea;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
}

/* -- Steps Container -- */
#steps-container {
    display: flex;
    flex-direction: column;
}

/* -- Step Card -- */
.config-step {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-bottom: none;
    padding: 10px 0px;
}

.config-step:last-child {
    border-bottom: 1px solid var(--border-color);
}

.config-step.ui-sortable-helper {
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transform: rotate(1deg);
}

.config-step.sortable-placeholder {
    background: var(--bg-color);
    border: 2px dashed var(--primary-color);
    min-height: 50px;
    visibility: visible !important;
}

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

.filler {
    flex-grow: 1;
}

.step-drag-handle {
    cursor: grab;
    padding: 5px 10px;
    margin-right: 10px;
    color: #999;
    font-size: 18px;
}

.step-drag-handle:hover {
    color: #2271b1;
}

.step-drag-handle:active {
    cursor: grabbing;
}


input[type="text"].name-input {
    min-height: auto;
    line-height: 1.2;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid transparent;
    border-bottom: 2px solid var(--border-color);
    padding: 5px 0px;
    background: transparent;
    width: 350px;
}

/* -- Step Description -- */

.step-description-input {
    width: 100%;
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
}

/* -- Step Targets -- */

.step-targets small {
    color: #666;
    font-weight: normal;
}

.mesh-select-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 36px;
    max-height: 200px;
    overflow-y: auto;
}

.mesh-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.mesh-checkbox:hover {
    background: #e0e0e1;
}

.mesh-checkbox.selected {
    background: var(--secondary-color);
    color: #fff;
}

.mesh-checkbox input {
    margin: 0;
    display: none;
}

/* -- Options Section -- */

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* -- Option Card -- */
.option-card {
    border: 1px solid var(--border-color);
    padding: 12px;
}

.option-card.ui-sortable-helper {
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    transform: rotate(0.5deg);
}

.option-card.sortable-placeholder {
    background: #f0fff4;
    border: 2px dashed var(--primary-color);
    border-left: 3px solid var(--primary-color);
    min-height: 50px;
    visibility: visible !important;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.option-drag-handle {
    cursor: grab;
    padding: 4px 8px;
    margin-right: 8px;
    color: #999;
    font-size: 14px;
}

.option-drag-handle:hover {
    color: #00a32a;
}

.option-drag-handle:active {
    cursor: grabbing;
}

.option-header-left {
    display: flex;
    align-items: center;
}

.option-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* -- Texture Selection -- */
.option-texture {
}

.texture-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    min-height: 50px;
}

.texture-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.texture-preview span {
    font-size: 12px;
}

.texture-preview .no-texture,
.texture-preview-multi .no-texture {
    color: #999;
    font-style: italic;
}

/* Multi-texture preview */
.texture-preview-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 50px;
    padding: 8px;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.texture-thumb {
    position: relative;
    width: 50px;
    height: 50px;
}

.texture-thumb img,
.texture-thumb .thumb-color-swatch {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.texture-thumb .remove-tex {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #d63638;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    display: none;
}

.texture-thumb:hover .remove-tex {
    display: block;
}

.texture-thumb:hover img,
.texture-thumb:hover .thumb-color-swatch {
    border-color: #2271b1;
}

/* -- Geometry Logic -- */
.option-geometry {
}

.geometry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.geo-col strong {
    display: block;
    font-size: 10px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.geo-col.show strong {
    color: #00a32a;
}

.geo-col.hide strong {
    color: #d63638;
}

.mesh-checks {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 5px;
    font-size: 12px;
}

.mesh-checks label {
    display: block;
    padding: 2px 4px;
    cursor: pointer;
}
.mesh-checks label input{
    display: none;
}

.mesh-checks label:hover {
    background: #f0f0f0;
}

.mesh-checks.show label:has(input:checked) {
    background: var(--secondary-color);
    color: #fff;
}

.mesh-checks.hide label:has(input:checked) {
    background: var(--error-color);
    color: #fff;
}

/* -- Modal -- */
#tex-modal,
#bulk-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    width: 550px;
    max-width: 90%;
    max-height: 75vh;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-wide {
    width: 750px;
}

.modal-head {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    font-size: 14px;
}

.modal-head small {
    font-weight: normal;
    color: #666;
    margin-left: 10px;
}

.modal-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.bulk-count {
    margin-left: auto;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}

#bulk-modal .modal-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.modal-item {
    border: 2px solid #eee;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s;
    position: relative;
}

.modal-item:hover {
    border-color: #2271b1;
}

.modal-item.selected {
    border-color: #2271b1;
    background: #f0f7fc;
}

.modal-item.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #2271b1;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    line-height: 18px;
}

.modal-item img {
    width: 100%;
    height: 70px;
    object-fit: cover;
}

.modal-item span {
    display: block;
    font-size: 10px;
    padding: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-foot {
    padding: 12px 15px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* -- Empty State -- */
.empty-message {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    color: #646970;
}


.options-actions {
    padding: 10px 0px;
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding: 12px;
}

/* -- Step Toggle and Collapsed State -- */
.config-step.closed .step-body {
    display: none;
}

.config-step.closed{
    border-left: 1px solid var(--border-color);
}

.step-toggle-btn {
    padding: 6px;
    cursor: pointer;
    color: #555;
    transition: transform 0.2s ease;
    display: inline-block;
    vertical-align: middle;
}

.config-step:not(.closed) .step-toggle-btn {
    transform: rotate(180deg);
}

/* -- Viewer-Only Toggle -- */
.psc-viewer-only-row {
    margin: 12px 0;
}

.psc-viewer-only-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    cursor: pointer;
}

.psc-viewer-only-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.psc-viewer-only-label small {
    color: #646970;
}

/* -- Camera Toolbar Overlay -- */
.dprcu-cam-toolbar {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.dprcu-cam-toolbar .button {
    font-size: 11px;
    min-height: 28px;
    line-height: 26px;
    padding: 0 10px;
}

#admin-model-preview {
    position: relative;
    height: 500px;
    background: #eee;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* -- Category Filter Select -- */
select.button {
    height: auto;
}

/* -- Icon Picker -- */
.icon-preview[src=""] {
    display: none;
}

.icon-preview {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}