/* Flow Builder v1 Styles */

.wp-flow-builder-v1 {
    max-width: 900px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header */
.wp-flow-builder-header {
    background: #fff;
    padding: 20px;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px 4px 0 0;
}

.wp-flow-builder-title-row {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.flow-name-input {
    font-size: 1.2em !important;
    font-weight: 600;
    width: 300px;
    border: 1px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}
.flow-name-input:hover, .flow-name-input:focus {
    border: 1px solid #8c8f94 !important;
    background: #fff !important;
}

/* Status Switch */
.flow-status-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #646970;
}
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: #2271b1; }
input:checked + .slider:before { transform: translateX(16px); }

/* Main Content */
.wp-flow-builder-content {
    border: 1px solid #c3c4c7;
    background: #f0f0f1;
}

.builder-section {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #f0f0f1;
    position: relative;
}
.builder-section.trigger-section { border-left: 4px solid #2271b1; }
.builder-section.conditions-section { border-left: 4px solid #f0b849; background: #fafafa; }
.builder-section.actions-section { border-left: 4px solid #4ab866; border-bottom: none; border-radius: 0 0 4px 4px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.section-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}
.trigger-badge { background: #2271b1; }
.condition-badge { background: #f0b849; }
.action-badge { background: #4ab866; }

/* Cards & Items */
.card {
    background: #fff;
    border: 1px solid #dcdcde;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.item-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.condition-config-fields, .action-config-fields {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    flex-wrap: wrap;
    align-items: center;
}
.action-config-fields {
    display: block; /* Actions take full width usually */
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form Elements */
select, input[type="text"], input[type="email"], input[type="url"], textarea {
    min-width: 200px;
}
.action-field-row {
    margin-bottom: 10px;
}
.action-field-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 12px;
}
.action-field-row .full-width {
    width: 100%;
}

.config-container {
    margin-top: 10px;
    padding: 15px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    display: none; /* Hidden by default until selected */
}
.config-container.active { display: block; }

.remove-item {
    background: none;
    border: none;
    color: #d63638;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}
.remove-item:hover { opacity: 1; }

.section-footer {
    margin-top: 15px;
}

/* Preview Box */
.wp-flow-builder-preview {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 15px;
    border-radius: 4px;
}
.wp-flow-builder-preview h4 { margin: 0 0 10px; font-size: 12px; color: #646970; text-transform: uppercase; }
.preview-box {
    font-family: monospace;
    color: #2c3338;
    white-space: pre-wrap;
    line-height: 1.5;
}
