/* Workflow Module Styles */

/* ========================================
   Modal Layout
   ======================================== */

.workflow-modal-content {
    width: 850px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #3498db;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.workflow-modal-content .modal-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 18px 25px;
    border-bottom: 3px solid #2471a3;
    user-select: none;
}

.workflow-modal-content .modal-header h2 {
    color: white;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Validation Display
   ======================================== */

.workflow-validation {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.workflow-validation h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.workflow-validation ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.workflow-validation li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

/* Validation States */
.workflow-validation-errors {
    background: linear-gradient(135deg, #fadbd8 0%, #f5cac3 100%);
    border-left: 5px solid #e74c3c;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.workflow-validation-errors h4 {
    color: #c0392b;
    font-weight: 700;
}

.workflow-validation-errors li {
    color: #c0392b;
}

.workflow-validation-warnings {
    background: linear-gradient(135deg, #fcf3cf 0%, #f9e79f 100%);
    border-left: 5px solid #f39c12;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.workflow-validation-warnings h4 {
    color: #d68910;
    font-weight: 700;
}

.workflow-validation-warnings li {
    color: #d68910;
}

.workflow-validation-success {
    background: linear-gradient(135deg, #d5f4e6 0%, #c3f0d9 100%);
    border-left: 5px solid #27ae60;
    padding: 14px;
    color: #27ae60;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

/* ========================================
   Current Node Display
   ======================================== */

.workflow-current-node {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.workflow-current-node h3 {
    margin: 0 0 12px 0;
    font-size: 26px;
    color: #2c3e50;
    font-weight: 700;
}

.workflow-current-node p {
    margin: 8px 0;
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
}

/* Category Badges */
.workflow-category-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.workflow-category-start-end {
    background-color: #3498db;
    color: white;
}

.workflow-category-task {
    background-color: #2ecc71;
    color: white;
}

.workflow-category-decision {
    background-color: #f39c12;
    color: white;
}

.workflow-category-unknown {
    background-color: #95a5a6;
    color: white;
}

/* ========================================
   Position Indicator
   ======================================== */

.workflow-position {
    background-color: #f8f9fa;
    padding: 15px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Connections Display (Inputs/Outputs)
   ======================================== */

.workflow-connections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.workflow-inputs,
.workflow-outputs {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

.workflow-inputs h4,
.workflow-outputs h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.workflow-inputs ul,
.workflow-outputs ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow-inputs li,
.workflow-outputs li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #555;
}

.workflow-inputs li:last-child,
.workflow-outputs li:last-child {
    border-bottom: none;
}

.workflow-inputs strong,
.workflow-outputs strong {
    color: #2c3e50;
    font-weight: 600;
}

.workflow-no-connections {
    color: #95a5a6;
    font-style: italic;
}

/* ========================================
   Navigation Buttons
   ======================================== */

.workflow-navigation {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px;
    border-top: 2px solid #e0e0e0;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    min-height: 80px;
}

.workflow-nav-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    min-width: 200px;
    max-width: 45%;
}

.workflow-nav-group:first-child {
    align-items: flex-start;
}

.workflow-nav-group:last-child {
    align-items: flex-end;
}

.workflow-nav-btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* ========================================
   Dropdown for Multiple Previous Nodes
   ======================================== */

.workflow-dropdown-container {
    position: relative;
    display: inline-block;
}

.workflow-dropdown-toggle {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.workflow-dropdown-toggle:hover {
    background-color: #7f8c8d;
}

.workflow-dropdown-list {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 5px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.workflow-dropdown-list.hidden {
    display: none;
}

.workflow-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.workflow-dropdown-item:last-child {
    border-bottom: none;
}

.workflow-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #3498db;
}

/* ========================================
   Validation Details Modal
   ======================================== */

.workflow-validation-details {
    font-size: 14px;
    line-height: 1.6;
}

.validation-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.validation-section:last-child {
    border-bottom: none;
}

.validation-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2c3e50;
}

.validation-section h4 {
    margin: 15px 0 10px 0;
    font-size: 15px;
    color: #34495e;
}

.validation-section p {
    margin: 8px 0;
    color: #555;
}

.validation-success {
    color: #27ae60;
    font-weight: 500;
}

.validation-error {
    color: #e74c3c;
    font-weight: 500;
}

.validation-error-list,
.validation-warning-list {
    margin: 10px 0;
    padding-left: 20px;
}

.validation-error-list li {
    color: #c0392b;
    margin-bottom: 8px;
}

.validation-warning-list li {
    color: #d68910;
    margin-bottom: 8px;
}

/* Disconnected Chains */
.disconnected-chain {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.disconnected-chain h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #e67e22;
}

.disconnected-chain p {
    margin: 8px 0;
    font-size: 13px;
    color: #555;
    word-wrap: break-word;
}

.workflow-highlight-chain {
    margin-top: 10px;
    padding: 8px 14px;
    font-size: 13px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.workflow-highlight-chain:hover {
    background-color: #2980b9;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .workflow-modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .workflow-connections {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .workflow-navigation {
		display: flex;
		gap: 20px;
		align-items: flex-start;
		justify-content: space-between;
		padding: 20px;
		border-top: 2px solid #e0e0e0;
		background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
		min-height: 80px;
	}

	.workflow-nav-group {
		display: flex;
		flex-direction: column;
		gap: 10px;
		align-items: stretch;
		min-width: 200px;
		max-width: 45%;
	}

	.workflow-nav-group:first-child {
		align-items: flex-start;
	}

	.workflow-nav-group:last-child {
		align-items: flex-end;
	}
    
    .workflow-nav-btn {
        flex: 1;
        min-width: 0;
    }
    
    .workflow-dropdown-list {
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
    }
    
    .workflow-current-node h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .workflow-modal-content {
        padding: 15px;
    }
    
    .workflow-current-node {
        padding: 15px;
    }
    
    .workflow-nav-btn,
    .workflow-dropdown-toggle {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .workflow-position {
        font-size: 13px;
        padding: 10px;
    }
    
    .workflow-category-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ========================================
   Additional Button Styles
   ======================================== */

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Ensure proper button styling in modals */
.workflow-navigation .btn,
.workflow-validation-details .btn {
    margin: 0;
}

.workflow-navigation .btn-secondary {
    background-color: #95a5a6;
}

.workflow-navigation .btn-secondary:hover {
    background-color: #7f8c8d;
}

.workflow-navigation .btn-primary {
    background-color: #3498db;
}

.workflow-navigation .btn-primary:hover {
    background-color: #2980b9;
}