/* Modern CSS Reset */
* {
    box-sizing: border-box;
}

/* Workflow Container */
.kdsamref-workflow-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Page Header */
.kdsamref-page-header {
    margin-bottom: 40px;
    text-align: center;
    padding: 40px 0;
}

.kdsamref-header-content {
    max-width: 600px;
    margin: 0 auto;
}

.kdsamref-page-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #000;
    letter-spacing: -0.02em;
}

.kdsamref-page-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Workflow Section */
.kdsamref-workflow-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kdsamref-section-header {
    padding: 24px 32px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.kdsamref-header-left h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.kdsamref-section-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    display: block;
}

.kdsamref-header-right {
    flex-shrink: 0;
}

.kdsamref-add-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.kdsamref-add-step-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

/* Workflow Form */
.kdsamref-workflow-form {
    padding: 32px;
}

/* Workflow Steps */
.kdsamref-workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.kdsamref-workflow-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    transition: all 0.2s ease;
    position: relative;
}

.kdsamref-workflow-step:hover {
    background: #fff;
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.kdsamref-workflow-step.sortable-ghost {
    opacity: 0.6;
    background: #f0f8ff;
    border-color: #007cba;
}

.kdsamref-step-drag-handle {
    cursor: grab;
    color: #999;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.kdsamref-step-drag-handle:hover {
    color: #666;
}

.kdsamref-step-drag-handle:active {
    cursor: grabbing;
}

.kdsamref-step-number {
    width: 32px;
    height: 32px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.kdsamref-step-content {
    flex: 1;
    min-width: 0;
}

.kdsamref-step-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kdsamref-step-display {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    min-height: 48px;
}

.kdsamref-step-status-info {
    flex: 1;
    min-width: 0;
}

.kdsamref-step-status-name {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin-bottom: 2px;
}

.kdsamref-step-status-slug {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kdsamref-step-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d0d0d0;
}

.kdsamref-step-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #000;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.kdsamref-step-select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.kdsamref-step-select:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.kdsamref-step-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.kdsamref-step-badge-processing {
    background: #e5f3ff;
    color: #0066cc;
}

.kdsamref-step-badge-completed {
    background: #e5f7e5;
    color: #008a00;
}

.kdsamref-step-remove-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    color: #999;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.kdsamref-step-remove-btn:hover:not(:disabled) {
    background: #ffebee;
    color: #d32f2f;
}

.kdsamref-step-remove-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Workflow Actions */
.kdsamref-workflow-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.kdsamref-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kdsamref-save-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

/* Sortable Placeholder */
.sortable-placeholder {
    height: 80px;
    background: #f0f8ff;
    border: 2px dashed #007cba;
    border-radius: 10px;
    margin: 8px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kdsamref-workflow-container {
        padding: 0 16px;
    }
    
    .kdsamref-page-header {
        margin-bottom: 32px;
        padding: 32px 0;
    }
    
    .kdsamref-page-header h1 {
        font-size: 28px;
    }
    
    .kdsamref-section-header {
        flex-direction: column;
        gap: 16px;
        padding: 20px 24px;
    }
    
    .kdsamref-workflow-form {
        padding: 24px;
    }
    
    .kdsamref-workflow-step {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px;
    }
    
    .kdsamref-step-content {
        width: 100%;
    }
    
    .kdsamref-step-select-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .kdsamref-workflow-actions {
        justify-content: center;
    }
    
    .kdsamref-add-step-btn,
    .kdsamref-save-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .kdsamref-workflow-container {
        padding: 0 12px;
    }
    
    .kdsamref-workflow-form {
        padding: 20px;
    }
    
    .kdsamref-page-header h1 {
        font-size: 24px;
    }
}

/* Inline styles moved to CSS */
.kdsamref-step-status-name {
    color: var(--status-color, #007cba);
}

.kdsamref-step-color-indicator {
    background-color: var(--status-color, #007cba);
}