/**
 * Admin styles for Alpaga Management
 */

/* Styles for the sire/dam parent field options in the alpaga form */
.alpaga-parent-field-container {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.alpaga-parent-option-container {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.alpaga-parent-option-container label {
    display: inline-block;
    margin-right: 20px;
    cursor: pointer;
    padding: 3px 0;
}

.alpaga-parent-option-container label:hover {
    color: #0073aa;
}

.alpaga-parent-option-container input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.alpaga-parent-dropdown-container {
    margin-bottom: 10px;
    padding: 5px 0;
}

.alpaga-parent-text-container {
    margin-bottom: 10px;
    padding: 5px 0;
}

.alpaga-parent-dropdown[disabled],
.alpaga-parent-text[disabled] {
    background-color: #f0f0f0 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    border-color: #ddd !important;
}

/* Field Management Table */
.alpaga-fields-table .column-order {
    width: 30px;
    cursor: move;
}

.alpaga-fields-table .column-name {
    width: 15%;
}

.alpaga-fields-table .column-type {
    width: 12%;
}

.alpaga-fields-table .column-required,
.alpaga-fields-table .column-list {
    width: 80px;
    text-align: center;
}

.alpaga-fields-table .column-actions {
    width: 150px;
}

/* Add/Edit Field Form */
.alpaga-add-field,
.alpaga-edit-field {
    margin-top: 20px;
    background: #fff;
    padding: 15px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Spinner next to submit button */
.submit .spinner {
    float: none;
    margin-top: 4px;
}

/* Admin notice */
.alpaga-admin-notice {
    margin: 15px 0;
}



/* Sortable placeholder */
.ui-state-highlight {
    height: 50px;
    background-color: #f1f1f1;
    border: 1px dashed #ccc;
}

/* Alpaga Details Meta Box */
.alpaga-details th {
    width: 25%;
    min-width: 150px;
}

/* Handle required fields */
.required {
    color: red;
}

/* Handle field errors */
.field-error {
    color: red;
    display: block;
    margin-top: 5px;
}

/* Loading state for buttons */
.loading {
    opacity: 0.6;
    cursor: wait;
}


/* Enhanced modal styling */
.alpaga-modal {
    display: none;
    position: fixed;
    z-index: 159999; /* Higher than WP admin UI */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.alpaga-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10vh auto;
    padding: 30px;
    border: 1px solid #888;
    width: 50%;
    max-width: 600px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalSlideDown 0.3s ease;
    max-height: 450px;
    overflow: auto;
}

@keyframes modalSlideDown {
    from {transform: translateY(-50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

.alpaga-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 28px;
}

body.modal-open {
    overflow: hidden;
}

/* Ensure the form inside modal looks good */
.alpaga-modal .form-table {
    margin-top: 15px;
}

.alpaga-modal .form-table th {
    padding: 15px 10px 15px 0;
    width: 140px;
}

.alpaga-modal .form-table td {
    padding: 15px 10px;
}

.alpaga-modal .submit {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}
