/**
 * BW Onboarding Guide — Admin Styles
 *
 * Styles for the step builder UI in the guide editor.
 */

/* Settings Grid */
.bw-settings-grid {
    max-width: 800px;
}

.bw-settings-grid .bw-field {
    margin-bottom: 16px;
}

.bw-settings-grid .bw-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.bw-settings-grid .bw-field-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bw-settings-grid .bw-field-row .bw-field {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.bw-shortcode {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f1;
    border-radius: 4px;
    font-size: 13px;
    user-select: all;
}

/* Step Rows */
#bw-steps-container {
    margin-bottom: 12px;
}

.bw-step-row {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.bw-step-row:hover {
    border-color: #b4b9be;
}

.bw-step-row.ui-sortable-helper {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #2271b1;
}

.bw-step-row.bw-step-placeholder {
    border: 2px dashed #2271b1;
    background: #f0f6fc;
    min-height: 50px;
}

/* Step Header */
.bw-step-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    gap: 8px;
    background: #f9f9f9;
    border-bottom: 1px solid transparent;
    border-radius: 4px 4px 0 0;
    user-select: none;
}

.bw-step-row.bw-step-open .bw-step-header {
    border-bottom-color: #dcdcde;
}

.bw-step-drag {
    cursor: grab;
    color: #b4b9be;
    font-size: 18px;
    flex-shrink: 0;
}

.bw-step-drag:hover {
    color: #50575e;
}

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

.bw-step-number {
    font-weight: 600;
    color: #50575e;
    font-size: 13px;
    flex-shrink: 0;
}

.bw-step-title-preview {
    flex: 1;
    color: #1d2327;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bw-step-title-preview:empty::after,
.bw-step-title-preview:only-child::after {
    content: "(untitled)";
    color: #b4b9be;
    font-style: italic;
}

.bw-step-type-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e7e8ea;
    color: #50575e;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bw-step-toggle,
.bw-step-delete {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #b4b9be;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.bw-step-toggle:hover {
    color: #2271b1;
    background: #f0f6fc;
}

.bw-step-delete:hover {
    color: #d63638;
    background: #fcf0f1;
}

.bw-step-row.bw-step-open .bw-step-toggle .dashicons {
    transform: rotate(180deg);
}

.bw-step-toggle .dashicons,
.bw-step-delete .dashicons {
    transition: transform 0.2s;
}

/* Step Body (collapsed by default) */
.bw-step-body {
    display: none;
    padding: 16px;
}

.bw-step-row.bw-step-open .bw-step-body {
    display: block;
}

/* Fields inside step body */
.bw-step-body .bw-field {
    margin-bottom: 14px;
}

.bw-step-body .bw-field:last-child {
    margin-bottom: 0;
}

.bw-step-body .bw-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #50575e;
}

.bw-step-body .bw-field-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.bw-step-body .bw-field-row .bw-field {
    flex: 1;
    margin-bottom: 0;
}

.bw-step-body .bw-field-row .bw-field-wide {
    flex: 2;
}

.bw-step-body .description {
    margin-top: 4px;
    font-size: 12px;
    color: #8c8f94;
}

.bw-step-body textarea {
    resize: vertical;
    min-height: 60px;
}

.bw-mono {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 12px;
}

/* Steps Footer */
.bw-steps-footer {
    padding: 8px 0;
}

.bw-steps-footer .button .dashicons {
    margin-top: 3px;
    margin-right: 2px;
    font-size: 16px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .bw-step-body .bw-field-row {
        flex-direction: column;
        gap: 14px;
    }

    .bw-settings-grid .bw-field-row {
        flex-direction: column;
    }

    .bw-step-type-badge {
        display: none;
    }
}

/* Settings page range input */
.bw-range-input {
    vertical-align: middle;
    width: 200px;
}

.bw-range-value {
    font-weight: 600;
    font-size: 13px;
    color: #50575e;
}

.bw-color-picker {
    vertical-align: middle;
    width: 60px;
    height: 34px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}
