/* Flow Versions Modal - Sprint 2 */

.version-history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.version-history-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.version-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.version-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-modal-header h2 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-modal-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.version-modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.version-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.version-stat-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.version-stat-card .stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.version-stat-card .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.version-list-container {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.version-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.version-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.version-item.current-version {
    border: 2px solid #4caf50;
    background: #f1f8f4;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.version-number {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.version-badge.current {
    background: #4caf50;
}

.version-date {
    font-size: 14px;
    color: #666;
}

.version-details {
    margin: 12px 0;
}

.version-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
}

.version-details strong {
    color: #333;
}

.version-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.version-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.version-meta-item i {
    color: #667eea;
}

.version-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.version-btn {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.version-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.version-btn.primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.version-btn.primary:hover {
    background: #5568d3;
}

.version-btn.danger {
    border-color: #f44336;
    color: #f44336;
}

.version-btn.danger:hover {
    background: #f44336;
    color: white;
}

.version-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

.version-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Compare Modal */
.compare-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.compare-modal.active {
    display: flex;
}

.compare-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.compare-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.diff-column h3 {
    margin-top: 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.diff-item {
    padding: 12px;
    margin: 8px 0;
    border-radius: 6px;
    border-left: 4px solid;
}

.diff-item.added {
    background: #e7f5e7;
    border-color: #4caf50;
}

.diff-item.removed {
    background: #ffeaea;
    border-color: #f44336;
}

.diff-item.modified {
    background: #fff4e5;
    border-color: #ff9800;
}

.diff-item strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .version-modal-content {
        max-width: 95%;
    }

    .version-stats {
        grid-template-columns: 1fr;
    }

    .diff-grid {
        grid-template-columns: 1fr;
    }

    .version-actions {
        flex-direction: column;
    }

    .version-btn {
        width: 100%;
    }
}
