/* WorkflowPages.module.css - Shared styles for workflow pages */

.page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text-primary, #1a1a2e);
    margin: 0 0 0.5rem 0;
}

.subtitle {
    color: var(--color-text-secondary, #6b7280);
    margin: 0;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section {
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
}

.section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary, #1a1a2e);
    margin: 0 0 1rem 0;
}

/* Loading, Error, Empty states */
.loading,
.error,
.empty {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-secondary, #6b7280);
}

.error {
    color: var(--color-error, #dc2626);
}

/* Table styles */
.tableContainer {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.table th {
    font-weight: 600;
    color: var(--color-text-secondary, #6b7280);
    background: var(--color-surface-secondary, #f9fafb);
}

.table tbody tr:hover {
    background: var(--color-surface-hover, #f3f4f6);
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--color-surface-secondary, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
}

.badge.running,
.badge.active {
    background: var(--color-info-bg, #dbeafe);
    color: var(--color-info, #2563eb);
}

.badge.completed {
    background: var(--color-success-bg, #dcfce7);
    color: var(--color-success, #16a34a);
}

.badge.error,
.badge.failed {
    background: var(--color-error-bg, #fee2e2);
    color: var(--color-error, #dc2626);
}

.badge.stopped,
.badge.pending {
    background: var(--color-warning-bg, #fef3c7);
    color: var(--color-warning, #d97706);
}

/* Button styles */
.actions {
    display: flex;
    gap: 0.5rem;
}

.deleteButton,
.executeButton,
.submitButton,
.stopButton,
.toggleButton {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.deleteButton {
    background: var(--color-error-bg, #fee2e2);
    color: var(--color-error, #dc2626);
    border-color: var(--color-error, #dc2626);
}

.deleteButton:hover:not(:disabled) {
    background: var(--color-error, #dc2626);
    color: white;
}

.executeButton {
    background: var(--color-info-bg, #dbeafe);
    color: var(--color-info, #2563eb);
    border-color: var(--color-info, #2563eb);
}

.executeButton:hover:not(:disabled) {
    background: var(--color-info, #2563eb);
    color: white;
}

.submitButton {
    background: var(--color-primary, #4f46e5);
    color: white;
}

.submitButton:hover:not(:disabled) {
    background: var(--color-primary-dark, #4338ca);
}

.stopButton {
    background: var(--color-error, #dc2626);
    color: white;
}

.stopButton:hover:not(:disabled) {
    background: var(--color-error-dark, #b91c1c);
}

.toggleButton {
    background: var(--color-surface-secondary, #f3f4f6);
    color: var(--color-text-secondary, #6b7280);
    border-color: var(--color-border, #e5e7eb);
}

.toggleButton.active {
    background: var(--color-success-bg, #dcfce7);
    color: var(--color-success, #16a34a);
    border-color: var(--color-success, #16a34a);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form styles */
.select {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: var(--color-surface, #ffffff);
    font-size: 0.875rem;
}

.inputForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
}

.textarea:focus {
    outline: none;
    border-color: var(--color-primary, #4f46e5);
    box-shadow: 0 0 0 3px var(--color-primary-light, rgba(79, 70, 229, 0.1));
}

.buttonGroup {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Messages display */
.messagesContainer {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--color-surface-secondary, #f9fafb);
    border-radius: 6px;
}

.messageRole {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary, #6b7280);
    text-transform: uppercase;
}

.messageContent {
    color: var(--color-text-primary, #1a1a2e);
    white-space: pre-wrap;
}

.emptyMessage {
    text-align: center;
    color: var(--color-text-secondary, #6b7280);
    padding: 2rem;
}

/* Log display */
.logContainer {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: monospace;
    font-size: 0.8rem;
}

.logEntry {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--color-surface-secondary, #f9fafb);
    border-radius: 4px;
}

.logStatus {
    font-weight: 600;
    color: var(--color-info, #2563eb);
}

.logMessage {
    color: var(--color-text-primary, #1a1a2e);
}
