* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.flowchart-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-height: 400px;
    max-height: 80vh;
    position: relative;
    overflow: auto;
}

.flowchart {
    position: relative;
    min-height: 350px;
    min-width: 25000px; /* Ajustado para acomodar todas as etapas */
    padding: 20px;
}

.step-bubble {
    position: absolute;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    min-width: 120px;
    max-width: 150px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 3px solid transparent;
    user-select: none;
    font-size: 0.85rem;
    line-height: 1.2;
    z-index: 5;
    touch-action: none;
}

.step-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
    border-color: #ffd700;
    z-index: 10;
}

.step-bubble.selected {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 10;
}

.step-bubble.dragging {
    cursor: grabbing !important;
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    z-index: 15;
    opacity: 0.9;
}

.step-bubble.level-1 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-size: 1rem;
    font-weight: bold;
    min-width: 140px;
}

.step-bubble.level-2 {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    font-size: 0.85rem;
}

.step-bubble.level-3 {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    font-size: 0.8rem;
}

.step-bubble.level-4 {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    font-size: 0.75rem;
}

.step-bubble.level-5 {
    background: linear-gradient(135deg, #fa709a, #fee140);
    font-size: 0.7rem;
}

.step-title {
    font-weight: bold;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.step-description {
    font-size: 0.75rem;
    opacity: 0.9;
    word-wrap: break-word;
}

.connection-line {
    position: absolute;
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 2px;
    border-radius: 1px;
    z-index: 0;
}

.connection-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid #667eea;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    z-index: 0;
}

.info-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    border-left: 4px solid #667eea;
}

.info-panel h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.step-info {
    color: #333;
    line-height: 1.6;
    font-family: 'Georgia', serif;
}

.step-info h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 5px;
}

.step-info p {
    margin-bottom: 10px;
    text-align: justify;
}

.step-info .details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 3px solid #667eea;
    font-style: italic;
    color: #555;
}

/* Controles de navegação para o fluxograma */
.flowchart-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.flowchart-nav button {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.flowchart-nav button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .flowchart-container {
        padding: 20px;
        max-height: 50vh;
    }
    
    .step-bubble {
        min-width: 100px;
        padding: 12px 15px;
        font-size: 0.75rem;
    }
    
    .step-bubble.level-1 {
        font-size: 0.85rem;
        min-width: 120px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-bubble {
    animation: fadeIn 0.5s ease-out;
}

/* Scroll personalizado */
.flowchart-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.flowchart-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.flowchart-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.flowchart-container::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Indicador de progresso */
.progress-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Zoom controls */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
} 

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover,
.close:focus {
    color: #667eea;
    text-decoration: none;
}

.modal-body {
    margin-top: 20px;
}

.data-option {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    background: #fafafa;
}

.data-option h3 {
    margin-bottom: 15px;
    color: #333;
}

.data-option input[type="file"] {
    margin: 10px 0;
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    width: 100%;
    background: white;
}

.data-option textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.data-option textarea:focus {
    border-color: #667eea;
    outline: none;
}

/* Status indicators */
.status-success {
    color: #4CAF50;
    font-weight: bold;
}

.status-error {
    color: #f44336;
    font-weight: bold;
}

.status-info {
    color: #2196F3;
    font-weight: bold;
}

/* Validation results */
.validation-results {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.validation-success {
    background: #e8f5e8;
    border-left: 4px solid #4CAF50;
}

.validation-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.validation-warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .data-option {
        padding: 15px;
    }
    
    .data-option textarea {
        height: 120px;
    }
}

/* Estilos para drag and drop */
.step-bubble {
    cursor: grab;
}

.step-bubble:active {
    cursor: grabbing;
}

.step-bubble.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    z-index: 1000;
}

.step-bubble:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
} 