:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.flow-section {
    margin-bottom: 80px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.section-description {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
}

.flow-container {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

#flowCanvas0, #flowCanvas1, #flowCanvas2, #flowCanvas3, #flowCanvas4 {
    width: 100%;
    height: 1200px;
    border-radius: 10px;
    background: var(--bg);
    min-height: 700px;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--primary);
}

.btn-export {
    background: var(--success);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-export:hover {
    background: #059669;
    transform: translateY(-2px);
}

.export-component {
    position: relative;
    display: inline-block;
}

.export-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.export-component.active .export-arrow {
    transform: rotate(180deg);
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.export-component.active .export-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-menu button {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.export-menu button:last-child {
    border-bottom: none;
}

.export-menu button:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.info-panel {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--info);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.info-panel strong {
    color: var(--info);
    display: block;
    margin-bottom: 10px;
}

.info-panel ul {
    list-style: none;
    padding-left: 0;
}

.info-panel li {
    padding: 5px 0;
    color: var(--text-muted);
}

.info-panel li::before {
    content: '▸';
    color: var(--info);
    margin-right: 10px;
}

.legend {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    margin-top: 40px;
}

.legend h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab:hover {
    border-color: var(--primary);
}

.flow-content {
    display: none;
}

.flow-content.active {
    display: block;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 14px;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
}

.tooltip-description {
    color: var(--text);
    margin-bottom: 15px;
    line-height: 1.6;
}

.tooltip-details {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.tooltip-details strong {
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

.tooltip-details ul {
    list-style: none;
    padding-left: 0;
    margin: 5px 0 0 0;
}

.tooltip-details li {
    padding: 3px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.tooltip-details li::before {
    content: '▸';
    color: var(--primary);
    margin-right: 8px;
}

.flow-description {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.6;
}

