/**
 * Animated Decision Flowchart
 * Visual comparison of failure vs success paths
 */

/* Flowchart Container */
.decision-flowchart {
    background: linear-gradient(135deg, rgba(29, 38, 58, 0.95), rgba(29, 38, 58, 1));
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.decision-flowchart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(200, 157, 92, 0.1));
    pointer-events: none;
}

.flowchart-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.flowchart-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.flowchart-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Flowchart Paths Container */
.flowchart-paths {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    position: relative;
}

/* Individual Path */
.flowchart-path {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 2rem;
    position: relative;
}

.flowchart-path.failure {
    border-color: rgba(239, 68, 68, 0.3);
}

.flowchart-path.success {
    border-color: rgba(200, 157, 92, 0.5);
    background: rgba(200, 157, 92, 0.05);
}

.path-label {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.flowchart-path.failure .path-label {
    color: var(--urgency-red);
    background: rgba(239, 68, 68, 0.1);
}

.flowchart-path.success .path-label {
    color: var(--gold-primary);
    background: rgba(200, 157, 92, 0.15);
}

/* Flow Steps */
.flow-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.flow-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.step-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.flowchart-path.failure .step-icon {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: var(--urgency-red);
}

.flowchart-path.success .step-icon {
    background: rgba(200, 157, 92, 0.15);
    border: 2px solid var(--gold-primary);
    color: var(--gold-primary);
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.step-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Connector Arrow */
.flow-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.flow-connector.visible {
    opacity: 1;
}

.connector-line {
    width: 2px;
    height: 24px;
    position: relative;
}

.flowchart-path.failure .connector-line {
    background: linear-gradient(to bottom, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0.2));
}

.flowchart-path.success .connector-line {
    background: linear-gradient(to bottom, rgba(200, 157, 92, 0.5), rgba(200, 157, 92, 0.2));
}

.connector-line::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.flowchart-path.failure .connector-line::after {
    border-top: 8px solid rgba(239, 68, 68, 0.5);
}

.flowchart-path.success .connector-line::after {
    border-top: 8px solid rgba(200, 157, 92, 0.5);
}

/* Final Outcome */
.flow-outcome {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.flow-outcome.visible {
    opacity: 1;
    transform: scale(1);
}

.flowchart-path.failure .flow-outcome {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.4);
}

.flowchart-path.success .flow-outcome {
    background: rgba(200, 157, 92, 0.15);
    border: 2px solid var(--gold-primary);
}

.outcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.flowchart-path.failure .outcome-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--urgency-red);
}

.flowchart-path.success .outcome-icon {
    background: rgba(200, 157, 92, 0.2);
    color: var(--gold-primary);
}

.outcome-title {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.flowchart-path.failure .outcome-title {
    color: var(--urgency-red);
}

.flowchart-path.success .outcome-title {
    color: var(--gold-primary);
}

.outcome-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Comparison Stats */
.flowchart-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--gold-primary);
    background: rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.stat-card.danger .stat-value {
    color: var(--urgency-red);
}

.stat-card.success .stat-value {
    color: var(--victory-green);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .decision-flowchart {
        padding: 2rem 1.5rem;
    }
    
    .flowchart-title {
        font-size: 1.5rem;
    }
    
    .flowchart-paths {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .flowchart-stats {
        grid-template-columns: 1fr;
    }
}

/* Animation Delays */
.flow-step:nth-child(1) { transition-delay: 0.1s; }
.flow-step:nth-child(2) { transition-delay: 0.2s; }
.flow-step:nth-child(3) { transition-delay: 0.3s; }
.flow-step:nth-child(4) { transition-delay: 0.4s; }

.flow-connector:nth-child(2) { transition-delay: 0.15s; }
.flow-connector:nth-child(4) { transition-delay: 0.25s; }
.flow-connector:nth-child(6) { transition-delay: 0.35s; }

.flow-outcome { transition-delay: 0.5s; }
