/**
 * Execution Flow Styles
 * Styles for Safe/YOLO mode toggle, execution modals, and progress panel
 */

/* ==========================================================================
   EXECUTION MODE TOGGLE
   ========================================================================== */

.execution-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.execution-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.execution-mode-toggle .mode-icon {
    font-size: 16px;
}

.execution-mode-toggle .mode-label {
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
}

.execution-mode-toggle .mode-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #374151;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.execution-mode-toggle .mode-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.execution-mode-toggle.yolo-active .mode-switch {
    background: #f59e0b;
}

.execution-mode-toggle.yolo-active .mode-switch::after {
    transform: translateX(16px);
}

.execution-mode-toggle.safe-active .mode-switch {
    background: #3b82f6;
}

.execution-mode-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Hide toggle checkbox visually but keep accessible */
.execution-mode-toggle .toggle-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   WORKFLOW ENABLE TOGGLE
   ========================================================================== */

.workflow-enabled-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.workflow-enabled-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.workflow-enabled-toggle .toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
}

.workflow-enabled-toggle .toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: #374151;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.workflow-enabled-toggle .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}

.workflow-enabled-toggle.enabled .toggle-track {
    background: #22c55e;
}

.workflow-enabled-toggle.enabled .toggle-thumb {
    transform: translateX(16px);
}

.workflow-enabled-toggle.disabled .toggle-track {
    background: #4b5563;
}

.workflow-enabled-toggle.disabled .toggle-thumb {
    transform: translateX(0);
    background: #d1d5db;
}

/* ==========================================================================
   EXECUTION MODAL OVERLAY
   ========================================================================== */

.execution-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.execution-modal-overlay.visible {
    opacity: 1;
}

/* ==========================================================================
   EXECUTION MODAL
   ========================================================================== */

.execution-modal {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.execution-modal-overlay.visible .execution-modal {
    transform: scale(1) translateY(0);
}

.execution-modal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #374151;
}

.execution-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f3f4f6;
}

.execution-modal .modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.execution-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #374151;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==========================================================================
   MODAL BUTTONS
   ========================================================================== */

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-btn.btn-primary {
    background: #3b82f6;
    color: white;
}

.modal-btn.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.modal-btn.btn-secondary {
    background: #374151;
    color: #e5e7eb;
}

.modal-btn.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.modal-btn.btn-danger {
    background: #dc2626;
    color: white;
}

.modal-btn.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.modal-btn.btn-danger:disabled {
    background: #7f1d1d;
}

.modal-btn.btn-danger.enabled {
    background: #dc2626;
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* ==========================================================================
   VIRTUAL RUN REQUIRED CONTENT
   ========================================================================== */

.vr-required-content p {
    margin: 0 0 16px;
    color: #d1d5db;
    line-height: 1.6;
}

.vr-required-content strong {
    color: #3b82f6;
}

.vr-required-tip {
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #fbbf24;
}

/* ==========================================================================
   EXECUTION CONFIRMATION CONTENT
   ========================================================================== */

.execution-confirm-content {
    color: #d1d5db;
}

.workflow-summary {
    padding: 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    margin-bottom: 16px;
}

.workflow-name {
    font-size: 16px;
    font-weight: 600;
    color: #f3f4f6;
    margin-bottom: 4px;
}

.workflow-steps {
    font-size: 13px;
    color: #9ca3af;
}

.steps-preview {
    margin-bottom: 16px;
}

.step-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 4px;
}

.step-preview-item .step-icon {
    font-size: 16px;
}

.step-preview-item .step-name {
    font-size: 13px;
    color: #e5e7eb;
}

.step-preview-more {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #6b7280;
}

.execution-warning {
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #fbbf24;
}

/* ==========================================================================
   DESTRUCTIVE CONFIRMATION CONTENT
   ========================================================================== */

.destructive-confirm-content {
    color: #d1d5db;
}

.destructive-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 12px;
    margin-bottom: 16px;
}

.destructive-warning .warning-icon {
    font-size: 24px;
}

.destructive-warning .warning-text {
    font-size: 14px;
    color: #fca5a5;
}

.destructive-actions-list {
    margin-bottom: 20px;
}

.destructive-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 6px;
    margin-bottom: 4px;
}

.destructive-action-item .action-icon {
    font-size: 12px;
}

.destructive-action-item .action-name {
    font-size: 13px;
    color: #fca5a5;
}

.destructive-more {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #6b7280;
}

.type-confirm-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.type-confirm-section label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    color: #d1d5db;
}

.type-confirm-section strong {
    color: #f87171;
    font-family: monospace;
    background: rgba(220, 38, 38, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.type-confirm-input {
    width: 100%;
    padding: 12px 16px;
    background: #111827;
    border: 2px solid #374151;
    border-radius: 8px;
    color: #f3f4f6;
    font-size: 14px;
    font-family: monospace;
    transition: border-color 0.2s ease;
}

.type-confirm-input:focus {
    outline: none;
    border-color: #dc2626;
}

.type-confirm-input::placeholder {
    color: #6b7280;
}

/* ==========================================================================
   EXECUTION PROGRESS PANEL
   ========================================================================== */

.execution-progress-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.execution-progress-panel.visible {
    transform: translateY(0);
    opacity: 1;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #374151;
}

.progress-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #f3f4f6;
}

.progress-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.progress-close:hover {
    color: #f3f4f6;
    background: rgba(255, 255, 255, 0.1);
}

.progress-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.status-indicator.running {
    background: #3b82f6;
}

.status-indicator.saving {
    background: #f59e0b;
}

.status-indicator.completed {
    background: #10b981;
    animation: none;
}

.status-indicator.error {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 13px;
    color: #d1d5db;
}

.progress-steps {
    padding: 12px 20px;
    max-height: 240px;
    overflow-y: auto;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-step:last-child {
    border-bottom: none;
}

.progress-step .step-status {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.progress-step .step-icon {
    font-size: 14px;
}

.progress-step .step-name {
    font-size: 13px;
    color: #9ca3af;
    flex: 1;
}

.progress-step.running .step-name {
    color: #3b82f6;
}

.progress-step.completed .step-name {
    color: #10b981;
}

.progress-step.error .step-name {
    color: #ef4444;
}

.progress-step.skipped .step-name {
    color: #fbbf24;
}

.progress-footer {
    padding: 12px 20px;
    border-top: 1px solid #374151;
}

.progress-time {
    font-size: 12px;
    color: #6b7280;
}

.progress-time span {
    font-family: monospace;
    color: #9ca3af;
}

/* ==========================================================================
   TOAST ANIMATION
   ========================================================================== */

@keyframes slide-up {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 640px) {
    .execution-modal {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    .execution-progress-panel {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
    }

    .execution-mode-toggle .mode-label {
        display: none;
    }
}
