/**
 * WhatsApp Flow Help Diagram Styles
 * Styles for the process flow diagram modal
 */

/* ========================================
   FLOW DIAGRAM CONTAINER
   ======================================== */

.flow-diagram-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px 20px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.flow-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    min-width: 700px;
    position: relative;
}

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

.flow-step {
    position: relative;
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    min-width: 180px;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: all 0.3s ease;
}

.flow-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

/* Decision Steps (Questions) */
.decision-step {
    background: #f9a825;
    color: #fff;
    border: 2px solid #f57f17;
}

/* Action Steps */
.action-step {
    background: #81c784;
    color: #1b5e20;
    border: 2px solid #66bb6a;
}

/* Final Steps */
.final-step {
    background: #64b5f6;
    color: #fff;
    border: 2px solid #42a5f5;
}

/* ========================================
   FLOW ROWS
   ======================================== */

.flow-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    width: 100%;
    position: relative;
    min-height: 80px;
}

/* ========================================
   ARROWS AND CONNECTORS
   ======================================== */

/* Main vertical connector line - DISABLED */
.flow-diagram::before {
    display: none;
}

/* Flow connectors between steps */
.flow-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    position: relative;
}

.flow-connector::before {
    content: '→';
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 50%;
    box-shadow: 0 2px 4px var(--shadow-light);
    position: relative;
    z-index: 5;
}

/* Path Labels */
.path-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    z-index: 5;
}

.no-path {
    background: var(--danger-color);
    color: var(--text-white);
}

.yes-path {
    background: var(--success-color);
    color: var(--text-white);
}

.immediate-path {
    background: var(--success-color);
    color: var(--text-white);
}

.scheduled-path {
    background: var(--info-color);
    color: var(--text-white);
}

.recurring-path {
    background: var(--primary-color);
    color: var(--text-white);
}

/* Special styling for steps with paths */
.flow-step[data-path="no"] {
    position: relative;
}

.flow-step[data-path="yes"] {
    position: relative;
}

/* Final row special styling */
.final-row {
    gap: 40px;
}

.final-row .flow-step {
    position: relative;
}

/* Vertical connectors from decision steps (except the final one) */
.flow-row .flow-step.decision-step::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: var(--primary-color);
    z-index: 2;
}

/* Remove connector from the final decision step (Tipo de envío) */
.flow-diagram > .flow-step.decision-step::after {
    display: none;
}

/* ========================================
   FLOW INSTRUCTIONS
   ======================================== */

.flow-instructions {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
}

.flow-instructions h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.flow-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.flow-instructions li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.flow-instructions strong {
    color: var(--text-primary);
}

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

@media (max-width: 768px) {
    .flow-diagram-container {
        padding: 20px 10px;
        overflow-x: scroll;
    }
    
    .flow-diagram {
        min-width: 600px;
    }
    
    .flow-step {
        min-width: 150px;
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .flow-row {
        gap: 40px;
        min-height: 70px;
    }
    
    .flow-connector::before {
        font-size: 20px;
        padding: 6px 10px;
    }
    
    .path-label {
        font-size: 10px;
        padding: 3px 8px;
        top: -25px;
    }
    
    .final-row {
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .flow-diagram {
        min-width: 500px;
    }
    
    .flow-step {
        min-width: 120px;
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .flow-row {
        gap: 30px;
        min-height: 60px;
    }
    
    .flow-connector::before {
        font-size: 18px;
        padding: 4px 8px;
    }
    
    .path-label {
        font-size: 9px;
        padding: 2px 6px;
        top: -20px;
    }
    
    .final-row {
        gap: 20px;
    }
    
    .flow-instructions {
        padding: 15px;
    }
    
    .flow-instructions h4 {
        font-size: 14px;
    }
    
    .flow-instructions li {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* ========================================
   MODAL BODY OVERRIDE FOR FLOW
   ======================================== */

#flow-help-modal .modal-body {
    padding: 20px;
}

#flow-help-modal .modal-content {
    max-height: 95vh;
    overflow-y: auto;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ========================================
   HEADER BUTTON POSITIONING
   ======================================== */

.header-help-button {
    margin-top: 10px;
    margin-bottom: 10px;
}

.header-help-button .btn {
    box-shadow: 0 2px 4px var(--shadow-light);
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
}
