/* ==========================================================================
   CONTEXTA CEIUS FLOW STYLES
   
   Consolidated styles for CEIUS workflow navigation
   Used on: Dashboard, Flow pages (Context, Evidence, Interpret, Uncertain, Synthesis)
   
   Dependencies: design-tokens.css (must be loaded first)
   
   Colour Scheme (from design-tokens.css):
   - --ctx-navy  : Primary dark (background gradient start)
   - --ctx-teal  : Primary light (background gradient end)
   - --ctx-gold  : Completed state
   - --ctx-gold-light : Completed hover
   - white       : Active state
   
   Structure:
   .flow-card
     .flow-header
       h2, .flow-header-meta, .flow-header-actions
     .flow-steps
       .flow-step (.done | .active | .disabled)
         .flow-step-circle
         .flow-step-label
         .flow-step-count
       .flow-connector
   ========================================================================== */

/* ==========================================================================
   BASE FLOW CARD
   ========================================================================== */

.flow-card {
    background: linear-gradient(135deg, var(--ctx-navy) 0%, var(--ctx-teal) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    color: white;
    margin-bottom: var(--space-4);
}

/* ==========================================================================
   FLOW HEADER
   ========================================================================== */

.flow-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.flow-header h2 {
    color: white;
    margin: 0 0 4px;
    font-size: var(--text-lg);
    font-weight: 600;
}

.flow-header-meta {
    font-size: var(--text-sm);
    opacity: 0.85;
}

.flow-header-actions {
    display: flex;
    gap: var(--space-2);
}

.flow-header .btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: var(--text-xs);
    padding: 6px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.flow-header .btn:hover {
    background: rgba(255,255,255,0.25);
    text-decoration: none;
}

/* ==========================================================================
   FLOW STEPS CONTAINER
   ========================================================================== */

.flow-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius);
    padding: var(--space-4);
}

/* ==========================================================================
   INDIVIDUAL STEP
   ========================================================================== */

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
    flex: 1;
}

.flow-step:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ==========================================================================
   STEP CIRCLE (Letter indicator: C, E, I, U, S)
   ========================================================================== */

.flow-step-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-xl);
    margin-bottom: 8px;
    border: 3px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.flow-step:hover .flow-step-circle {
    border-color: white;
    background: rgba(255,255,255,0.25);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* ==========================================================================
   STEP STATES
   ========================================================================== */

/* Completed step - Gold */
.flow-step.done .flow-step-circle {
    background: var(--ctx-gold);
    color: var(--ctx-navy);
    border-color: var(--ctx-gold);
    box-shadow: 0 2px 8px rgba(213,163,68,0.4);
}

.flow-step.done:hover .flow-step-circle {
    background: var(--ctx-gold-light);
    border-color: var(--ctx-gold-light);
}

.flow-step.done .flow-step-label {
    color: rgba(255,255,255,0.9);
}

/* Active/Current step - White */
.flow-step.active .flow-step-circle {
    background: white;
    color: var(--ctx-navy);
    border-color: white;
    box-shadow: 0 2px 8px rgba(255,255,255,0.4);
}

.flow-step.active .flow-step-label {
    color: white;
    font-weight: 700;
}

/* Disabled/Locked step */
.flow-step.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.flow-step.disabled:hover {
    transform: none;
}

/* ==========================================================================
   STEP LABELS
   ========================================================================== */

.flow-step-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.85);
}

.flow-step-count {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

/* ==========================================================================
   CONNECTOR LINE
   ========================================================================== */

.flow-connector {
    width: 40px;
    height: 3px;
    background: rgba(255,255,255,0.3);
    margin: 0 4px;
    margin-bottom: 28px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .flow-card {
        padding: var(--space-3);
    }
    
    .flow-header {
        flex-direction: column;
        gap: var(--space-2);
        margin-bottom: var(--space-3);
    }
    
    .flow-header-actions {
        width: 100%;
    }
    
    .flow-header .btn {
        flex: 1;
        text-align: center;
    }
    
    .flow-steps {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding: var(--space-3);
    }
    
    .flow-step {
        flex: 0 0 auto;
        min-width: 60px;
    }
    
    .flow-connector {
        display: none;
    }
    
    .flow-step-circle {
        width: 44px;
        height: 44px;
        font-size: var(--text-lg);
    }
    
    .flow-step-label {
        font-size: 10px;
    }
    
    .flow-step-count {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .flow-step-circle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .flow-step-label {
        font-size: 9px;
    }
}

/* ==========================================================================
   THEME: COMPACT (for sidebars)
   ========================================================================== */

.flow-card.theme-compact {
    padding: var(--space-3);
}

.flow-card.theme-compact .flow-header {
    margin-bottom: var(--space-3);
}

.flow-card.theme-compact .flow-header h2 {
    font-size: var(--text-sm);
}

.flow-card.theme-compact .flow-steps {
    padding: var(--space-3);
}

.flow-card.theme-compact .flow-step-circle {
    width: 36px;
    height: 36px;
    font-size: var(--text-sm);
    border-width: 2px;
}

.flow-card.theme-compact .flow-step-label {
    font-size: 9px;
}

.flow-card.theme-compact .flow-connector {
    width: 20px;
    margin-bottom: 18px;
}

/* ==========================================================================
   THEME: LIGHT (for light page backgrounds)
   ========================================================================== */

.flow-card.theme-light {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.flow-card.theme-light .flow-header h2 {
    color: var(--ctx-navy);
}

.flow-card.theme-light .flow-header-meta {
    color: var(--gray-500);
    opacity: 1;
}

.flow-card.theme-light .flow-header .btn {
    background: var(--ctx-teal);
    color: white;
    border-color: var(--ctx-teal);
}

.flow-card.theme-light .flow-steps {
    background: white;
    border: 1px solid var(--gray-200);
}

.flow-card.theme-light .flow-step {
    color: var(--gray-700);
}

.flow-card.theme-light .flow-step-circle {
    background: white;
    border-color: var(--gray-300);
    color: var(--gray-500);
    box-shadow: none;
}

.flow-card.theme-light .flow-step:hover .flow-step-circle {
    border-color: var(--ctx-teal);
    background: var(--gray-50);
}

.flow-card.theme-light .flow-step.done .flow-step-circle {
    background: var(--ctx-gold);
    border-color: var(--ctx-gold);
    color: var(--ctx-navy);
}

.flow-card.theme-light .flow-step.active .flow-step-circle {
    background: var(--ctx-navy);
    border-color: var(--ctx-navy);
    color: white;
}

.flow-card.theme-light .flow-step-label {
    color: var(--gray-600);
}

.flow-card.theme-light .flow-step.active .flow-step-label {
    color: var(--ctx-navy);
}

.flow-card.theme-light .flow-connector {
    background: var(--gray-300);
}
