/* Workflow System Styles */

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}

.timeline-marker.bg-success {
    background-color: #28a745;
}

.timeline-marker.bg-danger {
    background-color: #dc3545;
}

.timeline-marker.bg-warning {
    background-color: #ffc107;
}

.timeline-marker.bg-info {
    background-color: #17a2b8;
}

.timeline-marker.bg-secondary {
    background-color: #6c757d;
}

.timeline-marker.bg-dark {
    background-color: #343a40;
}

.timeline-content {
    margin-left: 20px;
}

/* Workflow Timeline Styles */
.workflow-timeline {
    position: relative;
}

.workflow-step {
    position: relative;
}

.workflow-step::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: 30px;
    background: #007bff;
    transform: translateX(-50%);
}

.workflow-step:last-child::after {
    display: none;
}

/* Status Badges */
.badge-lg {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Progress Bar Enhancements */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Card Enhancements */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none;
}

/* Action Cards */
.action-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Step Cards */
.step-card {
    border-left: 4px solid #007bff;
}

.step-card.completed {
    border-left-color: #28a745;
}

.step-card.current {
    border-left-color: #ffc107;
    background-color: #fff9e6;
}

.step-card.rejected {
    border-left-color: #dc3545;
    background-color: #f8f9fa;
}

/* Modal Enhancements */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 10px 10px;
}

/* Form Enhancements */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Button Enhancements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0;
}

.btn-group .btn:only-child {
    border-radius: 6px;
}

/* Alert Enhancements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Workflow Status Colors */
.status-active {
    color: #007bff;
    background-color: #e7f3ff;
}

.status-completed {
    color: #28a745;
    background-color: #e8f5e8;
}

.status-rejected {
    color: #dc3545;
    background-color: #f8e8e8;
}

.status-cancelled {
    color: #6c757d;
    background-color: #f8f9fa;
}

.status-suspended {
    color: #ffc107;
    background-color: #fff9e6;
}

/* Loading Spinner */
.workflow-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline {
        padding-left: 20px;
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-marker {
        left: -17px;
        width: 12px;
        height: 12px;
    }
    
    .timeline-content {
        margin-left: 15px;
    }
    
    .workflow-step::after {
        left: 20px;
        transform: none;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 6px !important;
        margin-bottom: 0.25rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #343a40;
        color: #fff;
    }
    
    .card-header {
        background-color: #495057;
        color: #fff;
    }
    
    .timeline::before {
        background: #6c757d;
    }
    
    .form-control {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }
    
    .form-control:focus {
        background-color: #495057;
        border-color: #007bff;
        color: #fff;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Print Styles */
@media print {
    .btn, .modal, .card-footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .timeline::before {
        background: #000 !important;
    }
    
    .timeline-marker {
        border-color: #000 !important;
    }
}
