/* Wondalizer Easy Forms - Admin Styles */

/* ===== Base Admin ===== */
.wef-admin .button { border-radius: 3px; }
.wef-admin .button-primary { background: #2271b1; border-color: #2271b1; }
.wef-admin .button-primary:hover { background: #135e96; border-color: #135e96; }

/* ===== Server Health Panel ===== */
.wef-server-health { background: #f0f6fc; border: 1px solid #c5d9ed; border-radius: 4px; padding: 15px 20px; margin: 15px 0; }
.wef-server-health h3 { margin-top: 0; font-size: 14px; }
.wef-health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.wef-health-item { background: #fff; padding: 8px 12px; border-radius: 3px; border: 1px solid #dcdcde; font-size: 12px; }

/* ===== Builder Layout ===== */
.wef-builder-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; margin-top: 15px; }
.wef-builder-sidebar { display: flex; flex-direction: column; gap: 15px; }
.wef-builder-main { display: flex; flex-direction: column; gap: 15px; }

/* Builder actions bar */
.wef-builder-actions-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.wef-auto-save-status { font-size: 11px; color: #646970; margin-right: auto; font-style: italic; display: none; }

/* ===== Panels ===== */
.wef-panel { background: #fff; border: 1px solid #c3c4c7; padding: 15px; border-radius: 4px; }
.wef-panel h3 { margin-top: 0; font-size: 14px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f1; }
.wef-panel label { display: block; font-weight: 600; font-size: 11px; margin-bottom: 3px; margin-top: 10px; }
.wef-panel input, .wef-panel select, .wef-panel textarea { margin-bottom: 6px; }
.wef-panel .description { font-size: 11px; color: #646970; margin-top: -4px; margin-bottom: 8px; }

/* ===== Field Palette ===== */
.wef-field-palette { display: flex; flex-direction: column; gap: 4px; }
.wef-palette-item { background: #f6f7f7; border: 1px solid #dcdcde; padding: 6px 10px; cursor: grab; font-size: 12px; border-radius: 3px; transition: all 0.15s; }
.wef-palette-item:hover { background: #f0f6fc; border-color: #2271b1; }
.wef-palette-item .dashicons { font-size: 14px; width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; color: #646970; }

/* ===== Form Canvas ===== */
#wef-form-canvas { min-height: 200px; background: #f6f7f7; border: 2px dashed #c3c4c7; padding: 15px; border-radius: 4px; }
#wef-form-canvas.ui-sortable { background: #f0f6fc; border-color: #2271b1; }

/* ===== Builder Fields ===== */
.wef-builder-field { background: #fff; border: 1px solid #ccd0d4; margin-bottom: 8px; padding: 10px; cursor: move; transition: box-shadow 0.15s; }
.wef-builder-field:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.wef-field-header { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.wef-field-type { text-transform: capitalize; }
.wef-remove-field { color: #b32d2e; border: none; background: none; cursor: pointer; margin-left: auto; font-size: 16px; padding: 0 4px; }
.wef-remove-field:hover { background: #f8d7da; border-radius: 3px; }
.wef-field-body input,
.wef-field-body textarea { width: 100%; margin-bottom: 4px; font-size: 12px; }

/* Compact Required Checkbox */
.wef-check-req { display: inline-flex !important; width: auto !important; font-size: 11px !important; margin: 4px 0 8px !important; padding: 2px 6px !important; background: #f6f7f7; border-radius: 3px; border: 1px solid #c3c4c7; width: fit-content !important; }
.wef-check-req input { margin: 0 4px 0 0 !important; }

/* Enhanced Options Editor */
.wef-opts-editor { margin: 6px 0 8px; }
.wef-opts-editor > label { font-size: 11px; font-weight: 600; color: #1d2327; margin-bottom: 4px; display: block; }
.wef-opts-list { margin-bottom: 4px; }
.wef-opt-row { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.wef-opt-row .wef-opt-input { flex: 1; margin-bottom: 0; padding: 4px 6px; font-size: 12px; border: 1px solid #ccc; border-radius: 2px; }
.wef-opt-remove { color: #b32d2e; border: 1px solid #dcdcde; background: #f6f7f7; cursor: pointer; font-size: 14px; width: 26px; height: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; border-radius: 2px; flex-shrink: 0; padding: 0; }
.wef-opt-remove:hover { background: #f8d7da; border-color: #b32d2e; }
.wef-opt-add { font-size: 11px !important; padding: 3px 8px !important; height: auto !important; line-height: 1.4 !important; }
.wef-field-options { display: none; }

/* ===== Quiz Section ===== */
.wef-quiz-item { margin-bottom: 8px; }
#wef-modal-quiz { background: #f6f7f7; padding: 10px 14px; border-radius: 4px; font-size: 13px; }

/* ===== All Forms Table ===== */
.wef-bulk-skin-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; padding: 10px 12px; background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 3px; }
.wef-bulk-skin-bar label { font-size: 12px; }
.wef-bulk-skin-bar select { font-size: 12px; }

/* Form status toggle */
.wef-status-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.wef-status-toggle input[type="checkbox"] { margin: 0; }
.wef-status-label { font-size: 11px; font-weight: 600; white-space: nowrap; }

/* Per-form skin dropdown */
.wef-form-skin { font-size: 12px; padding: 3px 6px; height: auto; min-height: 28px; line-height: 1.4; max-width: 160px; }
.wef-skin-saved { font-weight: 600; white-space: nowrap; }

/* Submission count link */
.wef-sub-count { font-weight: 600; }

/* Shortcode copy */
.wef-shortcode-copy { cursor: pointer; background: #f0f6fc; padding: 2px 6px; border-radius: 3px; font-size: 11px; transition: background 0.15s; }
.wef-shortcode-copy:hover { background: #c5d9ed; }

/* ===== Submissions Page ===== */
.wef-submissions-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.wef-per-page { display: flex; align-items: center; gap: 6px; }
.wef-per-page label { font-size: 12px; }

/* Unread styles */
.wef-unread { background: #f0f6fc; }
.wef-read { background: #fff; }
.wef-unread-dot { display: inline-block; width: 8px; height: 8px; background: #2271b1; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* Form tabs */
.wef-form-tabs a { text-decoration: none; }
.wef-form-tabs a.current { font-weight: 600; }
.wef-form-tabs .count { font-size: 11px; }

/* Tag styles */
.wef-tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.wef-tag.pass { background: #d4edda; color: #155724; }
.wef-tag.fail { background: #f8d7da; color: #721c24; }
.wef-tag.active { background: #d4edda; color: #155724; }
.wef-tag.inactive { background: #f8d7da; color: #721c24; }

/* ===== Modal ===== */
.wef-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.wef-modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.wef-modal-content { position: relative; background: #fff; border-radius: 4px; max-width: 700px; width: 90%; max-height: 90vh; overflow: auto; box-shadow: 0 5px 25px rgba(0,0,0,0.2); z-index: 1; }
.wef-modal-large { max-width: 900px; }
.wef-modal-header { padding: 15px 20px; border-bottom: 1px solid #dcdcde; display: flex; justify-content: space-between; align-items: center; }
.wef-modal-header h2 { margin: 0; font-size: 18px; }
.wef-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #646970; padding: 0; width: 30px; height: 30px; line-height: 1; }
.wef-modal-close:hover { color: #b32d2e; }
.wef-modal-body { padding: 20px; }
.wef-modal-footer { padding: 15px 20px; border-top: 1px solid #dcdcde; text-align: right; }
.wef-modal-columns { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.wef-modal-left { border-right: 1px solid #dcdcde; padding-right: 15px; }
.wef-modal-avatar img { border-radius: 50%; }
#wef-modal-data .data-row { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f1; }
#wef-modal-data .data-row strong { display: inline-block; width: 140px; color: #1d2327; }

/* ===== Newsletter ===== */
.wef-stats { display: flex; gap: 15px; margin-bottom: 20px; }
.wef-stat-box { background: #fff; border: 1px solid #c3c4c7; padding: 15px; border-radius: 4px; flex: 1; text-align: center; }
.wef-stat-box h4 { margin: 0 0 8px; font-size: 12px; color: #646970; font-weight: 400; text-transform: uppercase; }
.wef-stat-num { font-size: 24px; font-weight: 700; color: #1d2327; }
.wef-recipient-list { max-height: 300px; overflow-y: auto; border: 1px solid #dcdcde; padding: 8px; margin: 8px 0; background: #fff; }
.wef-recipient-list label { display: block; margin-bottom: 3px; }

/* ===== Toolbar ===== */
.wef-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.wef-toolbar form { display: flex; gap: 5px; }
.wef-toolbar input[type="text"] { width: 250px; }

/* ===== Pagination ===== */
.pagination { margin: 15px 0; }
.tablenav-pages { margin: 5px 0; }

/* ===== Checkboxes ===== */
.wef-check { display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 400; }
.wef-check-inline { display: inline-flex !important; margin-right: 15px; margin-bottom: 5px; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .wef-builder-grid { grid-template-columns: 1fr; }
    .wef-modal-columns { grid-template-columns: 1fr; }
    .wef-modal-left { border-right: none; border-bottom: 1px solid #dcdcde; padding-right: 0; padding-bottom: 15px; }
    .wef-submissions-controls { flex-direction: column; align-items: flex-start; }
    .wef-health-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 782px) {
    .wef-toolbar { flex-direction: column; align-items: stretch; }
    .wef-toolbar form, .wef-toolbar .wef-actions { width: 100%; }
    .wef-toolbar form input[type="text"] { width: 100%; }
    .wef-bulk-skin-bar { flex-wrap: wrap; }
    .wef-health-grid { grid-template-columns: 1fr; }
}
