/* /wpx/assets/css/cpt-admin.css */

.wpx-tab-content {
    padding: 20px 0;
}

.wpx-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wpx-tab-header h2 {
    margin: 0;
}

#wpx-cpt-tabs {
    margin-top: 20px;
}

#wpx-cpt-tabs .ui-tabs-nav {
    padding-left: 0;
}

#wpx-cpt-tabs .ui-tabs-panel {
    padding: 0;
    margin-top: 20px;
}

/* Modal Styles */
.ui-dialog {
    z-index: 160000;
}

.ui-dialog-titlebar {
    text-align: center;
    font-weight: bold;
}

.ui-dialog-content {
    padding: 15px !important;
}

.ui-dialog .form-table th {
    width: 150px;
    font-weight: 600;
}

.ui-dialog .form-table td {
    padding: 10px;
}

/* Field Group Specific Styles */
.field-item {
    background: #f9f9f9;
    border-radius: 5px;
    position: relative;
}

.field-item:hover {
    background: #f1f1f1;
}

.field-item .form-table {
    margin: 0;
}

.field-item .form-table th {
    width: 120px;
    padding: 8px 10px;
    font-size: 13px;
}

.field-item .form-table td {
    padding: 8px 10px;
}

.remove-field-btn {
    background-color: #dc3232;
    border-color: #dc3232;
    color: white;
}

.remove-field-btn:hover {
    background-color: #aa2323;
    border-color: #aa2323;
}

#add-field-btn {
    margin-left: 10px;
}

#fields-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
}

/* Table Styles */
.wp-list-table th,
.wp-list-table td {
    vertical-align: middle;
}

.wp-list-table .button {
    margin-right: 5px;
}

/* Checkbox and Radio Groups */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

fieldset label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
}

fieldset input[type="checkbox"],
fieldset input[type="radio"] {
    margin-right: 8px;
}

/* Form Spacing */
.form-table th {
    padding: 15px 10px 15px 0;
}

.form-table td {
    padding: 15px 0;
}

/* Modal Button Styling */
.ui-dialog-buttonpane .ui-button {
    margin-right: 10px;
}

.ui-dialog-buttonpane .ui-button.ui-priority-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.ui-dialog-buttonpane .ui-button.ui-priority-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .wpx-tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ui-dialog {
        width: 95% !important;
        margin: 2.5%;
    }
    
    .field-item .form-table th,
    .field-item .form-table td {
        display: block;
        width: 100%;
        padding: 5px 0;
    }
    
    .field-item .form-table th {
        font-weight: 600;
        margin-bottom: 5px;
    }
}

/* Status indicators */
.status-active {
    color: #46b450;
    font-weight: bold;
}

.status-inactive {
    color: #dc3232;
    font-weight: bold;
}

/* Loading states */
.wpx-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpx-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wpx-spin 1s linear infinite;
}

@keyframes wpx-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Field type specific styles */
.field-type-select {
    width: 150px;
}

.options-row textarea {
    font-family: monospace;
    font-size: 12px;
}

/* Relationship visualization */
.relationship-visual {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.relationship-box {
    padding: 8px 12px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.relationship-arrow {
    font-size: 16px;
    color: #666;
}

/* Success/Error messages */
.wpx-notice {
    margin: 15px 0;
    padding: 10px;
    border-left: 4px solid;
    background: white;
}

.wpx-notice.success {
    border-left-color: #46b450;
    background-color: #f7fff7;
}

.wpx-notice.error {
    border-left-color: #dc3232;
    background-color: #fff7f7;
}

/* Tabs customization */
#wpx-cpt-tabs.ui-tabs .ui-tabs-nav li {
    margin: 0 2px 0 0;
}

#wpx-cpt-tabs.ui-tabs .ui-tabs-nav li a {
    padding: 8px 16px;
    font-weight: 600;
}

/* Drag and drop styles for field reordering */
.field-item.ui-sortable-helper {
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: rotate(2deg);
}

.field-item.ui-sortable-placeholder {
    background: #e1f5fe;
    border: 2px dashed #0073aa;
    height: 100px;
}

/* Collapsible sections */
.wpx-collapsible {
    border: 1px solid #c3c4c7;
    margin-bottom: 10px;
}

.wpx-collapsible-header {
    background: #f6f7f7;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #c3c4c7;
    user-select: none;
}

.wpx-collapsible-header:hover {
    background: #f0f0f1;
}

.wpx-collapsible-content {
    padding: 15px;
    display: none;
}

.wpx-collapsible.open .wpx-collapsible-content {
    display: block;
}

.wpx-collapsible-toggle {
    float: right;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.wpx-collapsible.open .wpx-collapsible-toggle {
    transform: rotate(180deg);
}

#cpt-modal,
#field-group-modal,
#relationship-modal,
#taxonomy-modal {
    width: 100% !important;
}