/**
 * AD Pro Forms - Form Builder Styles
 */

.adpf-form-builder-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.adpf-fields-sidebar {
    width: 250px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px;
}

.adpf-fields-sidebar h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.adpf-field-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    cursor: move;
    transition: all 0.2s;
}

.adpf-field-item:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.adpf-field-item.dragging {
    opacity: 0.5;
}

.adpf-field-item .dashicons {
    color: #2271b1;
}

.adpf-form-builder-area {
    flex: 1;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    min-height: 400px;
}

.adpf-form-builder-dropzone {
    min-height: 300px;
    position: relative;
}

.adpf-form-builder-dropzone.drag-over {
    background: #f0f6fc;
    border: 2px dashed #2271b1;
}

.adpf-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
    font-style: italic;
    border: 2px dashed #dcdcde;
    border-radius: 4px;
}

.adpf-form-field {
    margin-bottom: 15px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s;
}

.adpf-form-field:hover {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.adpf-field-config {
    display: none;
    padding: 15px;
    border-top: 1px solid #dcdcde;
    background: #f9f9f9;
}

.adpf-field-config.expanded {
    display: block;
}

.adpf-field-config .form-table {
    margin-top: 0;
}

.adpf-field-config-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dcdcde;
    display: flex;
    gap: 10px;
}

.adpf-field-toggle .dashicons {
    transition: transform 0.2s;
}

.adpf-field-handle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: move;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
}

.adpf-field-handle .dashicons {
    color: #2271b1;
    cursor: move;
}

.adpf-field-label {
    font-weight: 600;
    color: #1d2327;
    width: auto;
    max-width: none;
}

.adpf-required-badge {
    color: #d63638;
    margin-left: 5px;
}

.adpf-field-type {
    margin-left: auto;
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 3px;
}

.adpf-field-actions {
    display: flex;
    gap: 5px;
}

.adpf-field-actions .button-link {
    padding: 0;
    min-height: auto;
    line-height: 1;
    cursor: pointer;
}

.adpf-field-actions .adpf-field-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #2271b1 !important;
    color: #fff !important;
    border: 1px solid #2271b1 !important;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    transition: all 0.2s;
}

.adpf-field-actions .adpf-field-toggle:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
    color: #fff !important;
}

.adpf-field-actions .adpf-field-duplicate {
    color: #50575e;
    padding: 4px 8px;
    transition: all 0.2s;
}

.adpf-field-actions .adpf-field-duplicate:hover {
    color: #2271b1;
}

.adpf-edit-text {
    font-size: 13px;
    color: #fff;
}

.adpf-field-toggle:hover .adpf-edit-text {
    color: #fff;
}

.adpf-field-toggle .dashicons {
    color: #fff;
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.adpf-field-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.adpf-field-placeholder {
    height: 60px;
    background: #f0f6fc;
    border: 2px dashed #2271b1;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Modal */
.adpf-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.adpf-modal-overlay.show {
    display: flex;
}

.adpf-modal {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.adpf-modal-header {
    padding: 20px;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.adpf-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.adpf-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #646970;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.adpf-modal-close:hover {
    color: #1d2327;
}

.adpf-modal-body {
    padding: 20px;
}

.adpf-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dcdcde;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Options */
.adpf-option-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.adpf-option-input {
    flex: 1;
}

.adpf-remove-option {
    min-width: 30px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

/* Drag ghost */
.adpf-drag-ghost {
    pointer-events: none;
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 4px;
    margin: 0;
}

/* Drop indicator line */
.adpf-drop-indicator {
    height: 3px;
    background: #2271b1;
    border-radius: 2px;
    margin: 8px 0;
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Form Editor Header */
.adpf-form-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.adpf-form-editor-title {
    margin: 0;
}

.adpf-top-actions {
    display: flex;
    gap: 10px;
}

/* Form Action Buttons (Save/Cancel) */
.adpf-form-action-button {
    font-size: 16px !important;
    padding: 10px 20px !important;
    height: auto !important;
    min-height: auto !important;
    line-height: 1.5 !important;
}

.adpf-form-editor-footer-actions {
    margin-top: 30px;
}

/* Field width toggle */
.adpf-field-width-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    color: #50575e;
    font-size: 11px;
    border: 1px solid #dcdcde !important;
    border-radius: 3px;
    background: #f6f7f7 !important;
    transition: all 0.2s;
    cursor: pointer;
}

.adpf-field-width-toggle:hover {
    color: #2271b1;
    border-color: #2271b1 !important;
}

.adpf-field-width-toggle .dashicons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    color: inherit !important;
}

.adpf-field-width-toggle.adpf-width-half {
    background: #e7f1fa !important;
    border-color: #2271b1 !important;
    color: #2271b1;
}

.adpf-width-label {
    font-weight: 600;
    font-size: 11px;
}

/* Half-width field visual indicator in builder */
.adpf-form-field-half {
    border-color: #2271b1;
    border-left: 3px solid #2271b1;
}