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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

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

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

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

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

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

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

.diagram-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 1200px;
    width: 100%;
    margin-bottom: 30px;
}

.flow-diagram {
    position: relative;
    min-height: 800px;
}

.step {
    position: absolute;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.step:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.step.active {
    background: linear-gradient(135deg, #00b894, #00a085);
    animation: pulse 1s infinite;
}

.step.error {
    background: linear-gradient(135deg, #e17055, #d63031);
}

.step.completed {
    background: linear-gradient(135deg, #00b894, #00a085);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.arrow {
    position: absolute;
    width: 2px;
    background: #2d3436;
    z-index: 1;
}

.arrow::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 10px solid #2d3436;
}

.arrow.animated {
    background: linear-gradient(to bottom, transparent 0%, #00b894 50%, transparent 100%);
    background-size: 100% 20px;
    animation: flow 2s infinite;
}

@keyframes flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

.decision {
    background: linear-gradient(135deg, #fdcb6e, #e17055) !important;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
}

.info-panel {
    position: fixed;
    top: 50%;
    right: -350px;
    transform: translateY(-50%);
    width: 320px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: right 0.3s ease;
    z-index: 1000;
}

.info-panel.show {
    right: 20px;
}

.info-panel h3 {
    color: #2d3436;
    margin-bottom: 10px;
    font-size: 18px;
}

.info-panel p {
    color: #636e72;
    line-height: 1.6;
    font-size: 14px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.8);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00a085);
    width: 0%;
    transition: width 0.5s ease;
}

/* Step positions */
.step1 { top: 50px; left: 50%; transform: translateX(-50%); }
.step2 { top: 150px; left: 50%; transform: translateX(-50%); }
.step3 { top: 250px; left: 30%; }
.step4 { top: 250px; left: 70%; }
.step5 { top: 350px; left: 50%; transform: translateX(-50%); }
.step6 { top: 450px; left: 50%; transform: translateX(-50%); }
.step7 { top: 550px; left: 30%; }
.step8 { top: 550px; left: 70%; }
.step9 { top: 650px; left: 50%; transform: translateX(-50%); }
.step10 { top: 750px; left: 50%; transform: translateX(-50%); }

/* Arrows */
.arrow1 { top: 110px; left: 50%; height: 30px; }
.arrow2 { top: 210px; left: 50%; height: 30px; }
.arrow3 { top: 310px; left: 50%; height: 30px; }
.arrow4 { top: 410px; left: 50%; height: 30px; }
.arrow5 { top: 510px; left: 50%; height: 30px; }
.arrow6 { top: 610px; left: 50%; height: 30px; }
.arrow7 { top: 710px; left: 50%; height: 30px; }

/* Documentation Section */
.documentation-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 1200px;
    width: 100%;
    margin-bottom: 30px;
}

.documentation-section h2 {
    text-align: center;
    color: #2d3436;
    margin-bottom: 30px;
    font-size: 2em;
}

.doc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.doc-card {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.doc-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.doc-card p {
    margin-bottom: 15px;
    opacity: 0.9;
    font-size: 14px;
}

.doc-card a {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: bold;
}

.doc-card a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 20px;
    opacity: 0.8;
}

footer p {
    margin-bottom: 5px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .diagram-container {
        padding: 15px;
    }
    
    .flow-diagram {
        min-height: 900px;
    }
    
    .step {
        min-width: 140px;
        padding: 12px 15px;
        font-size: 12px;
    }
    
    .decision {
        width: 100px;
        height: 100px;
        font-size: 10px;
    }
    
    .info-panel {
        width: 280px;
        right: -300px;
    }
    
    .info-panel.show {
        right: 10px;
    }
    
    .legend {
        gap: 10px;
    }
    
    .legend-item {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .doc-links {
        grid-template-columns: 1fr;
    }
    
    .documentation-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .step {
        min-width: 120px;
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .info-panel {
        width: 250px;
        right: -270px;
    }
    
    .info-panel.show {
        right: 5px;
    }
}