/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: transparent;
    min-height: 100vh;
    color: #1e293b;
    overflow: hidden;
    position: relative;
}

.container {
    height: 100vh;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Background Grid - lighter and more subtle */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(74, 144, 226, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 144, 226, 0.01) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -2;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 15px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #4A90E2, #6366f1);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4A90E2, #6366f1);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 400;
}

/* Main Flow Container - Clean Layout */
.flow-container {
    flex: 1;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

/* Left Column - Vertically Centered Container */
.left-column {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: auto;
}

/* User Query - Modern AI Chat Bubble */
.user-query-section {
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.95) 0%, 
        rgba(74, 144, 226, 0.9) 50%, 
        rgba(139, 92, 246, 0.85) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 24px 28px;
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(99, 102, 241, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-query-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.user-query-section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(99, 102, 241, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Portfolio & Transactions - Sophisticated Glass Card */
#portfolio-transactions {
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(74, 144, 226, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

#portfolio-transactions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.3), transparent);
}

#portfolio-transactions:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    border-color: rgba(74, 144, 226, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(74, 144, 226, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* User Preferences - Elegant Minimal Card */
#preferences {
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 0.8) 0%, 
        rgba(241, 245, 249, 0.6) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 26px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(148, 163, 184, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

#preferences::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
}

#preferences:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 0.9) 0%, 
        rgba(241, 245, 249, 0.7) 100%);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(148, 163, 184, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.source-node {
    background: transparent;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: none;
}

.source-node:hover {
    background: transparent;
    border: none;
    transform: scale(1.02);
    box-shadow: none;
}

.source-node.active {
    background: transparent;
    border: none;
    box-shadow: none;
}

.node-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.node-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.user-query-section .node-label {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.node-status {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 16px;
    font-weight: 400;
    letter-spacing: 0.025em;
}

.question-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.025em;
}

/* Enhanced Broker Icons */
.broker-icons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.broker-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4A90E2;
    animation: float 4s ease-in-out infinite;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.broker-icon:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(74, 144, 226, 0.2);
}

.broker-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.broker-icon:nth-child(1) { animation-delay: 0s; }
.broker-icon:nth-child(2) { animation-delay: 0.5s; }
.broker-icon:nth-child(3) { animation-delay: 1s; }
.broker-icon:nth-child(4) { animation-delay: 1.5s; }

/* Enhanced Account Badges */
.account-badges {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.account-badge {
    padding: 8px 16px;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.9) 0%, 
        rgba(74, 144, 226, 0.8) 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(99, 102, 241, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: badge-glow 3s ease-in-out infinite;
}

.account-badge:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(99, 102, 241, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.15);
}

.account-badge:nth-child(1) { animation-delay: 0s; }
.account-badge:nth-child(2) { animation-delay: 0.4s; }
.account-badge:nth-child(3) { animation-delay: 0.8s; }

/* AI Core - Centered */
.ai-core {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.ai-core.active {
    background: rgba(74, 144, 226, 0.05);
    box-shadow: 0 0 60px rgba(74, 144, 226, 0.3);
    animation: coreGlow 2s infinite ease-in-out;
}

@keyframes coreGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.core-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    color: #4A90E2;
}

.core-icon-image {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 12px rgba(74, 144, 226, 0.3));
    transition: all 0.3s ease;
    object-fit: contain;
}

.ai-core.active .core-icon-image {
    filter: drop-shadow(0 6px 16px rgba(74, 144, 226, 0.5)) 
            brightness(1.1) 
            contrast(1.1);
    transform: scale(1.05);
}

.core-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4A90E2;
}

.processing-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 3px solid transparent;
    border-top-color: rgba(74, 144, 226, 0.8);
    border-radius: 50%;
    opacity: 0;
    animation: spin 2s linear infinite;
}

.ai-core.active .processing-ring {
    opacity: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Agent Status Grid - Better Aligned Below AI Core */
.agent-status-grid {
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
    width: 520px;
    z-index: 8;
}

.agent-status-card {
    background: rgba(156, 163, 175, 0.4);
    backdrop-filter: blur(8px);
    color: #64748b;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.6;
    transform: translateY(10px);
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(156, 163, 175, 0.08);
    border: 1px solid rgba(156, 163, 175, 0.15);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-status-card.active {
    opacity: 1;
    transform: translateY(0);
    background: rgba(245, 158, 11, 0.8);
    color: white;
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.3);
}

.agent-status-card.completed {
    background: rgba(16, 185, 129, 0.8);
    color: white;
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Remove icon styling */
.agent-status-card .status-icon {
    display: none;
}

/* Dynamic MCP Agents - Bigger and No Background */
.mcp-agent {
    position: absolute;
    width: 48px;
    height: 48px;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    opacity: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #4A90E2;
    box-shadow: none;
    border: none;
}

.mcp-agent::before {
    content: '🤖';
    font-size: 32px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.mcp-agent.active {
    opacity: 1;
}

/* Agent movement animations - Slower */
.mcp-agent.move-up {
    animation: moveUp 5s ease-in-out forwards;
}

.mcp-agent.move-down {
    animation: moveDown 5s ease-in-out forwards;
}

.mcp-agent.move-left {
    animation: moveLeft 5s ease-in-out forwards;
}

.mcp-agent.move-right {
    animation: moveRight 5s ease-in-out forwards;
}

@keyframes moveUp {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    15% { opacity: 1; transform: scale(1); }
    30% { transform: translate(0, -200px) scale(1.1); }
    60% { transform: translate(-100px, -300px) scale(0.9); }
    80% { transform: translate(50px, -250px) scale(1.1); }
    95% { transform: translate(0, -50px) scale(1); }
    100% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
}

@keyframes moveDown {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    15% { opacity: 1; transform: scale(1); }
    30% { transform: translate(0, 200px) scale(1.1); }
    60% { transform: translate(100px, 300px) scale(0.9); }
    80% { transform: translate(-50px, 250px) scale(1.1); }
    95% { transform: translate(0, 50px) scale(1); }
    100% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
}

@keyframes moveLeft {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    15% { opacity: 1; transform: scale(1); }
    30% { transform: translate(-250px, 0) scale(1.1); }
    60% { transform: translate(-400px, -100px) scale(0.9); }
    80% { transform: translate(-300px, 100px) scale(1.1); }
    95% { transform: translate(-50px, 0) scale(1); }
    100% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
}

@keyframes moveRight {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    15% { opacity: 1; transform: scale(1); }
    30% { transform: translate(250px, 0) scale(1.1); }
    60% { transform: translate(400px, 100px) scale(0.9); }
    80% { transform: translate(300px, -100px) scale(1.1); }
    95% { transform: translate(50px, 0) scale(1); }
    100% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
}

/* Data Collection Trails */
.data-trail {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(99, 102, 241, 0.8);
    border-radius: 50%;
    opacity: 0;
    z-index: 12;
}

.data-trail.active {
    opacity: 0.6;
    animation: trailFade 2s ease-out forwards;
}

@keyframes trailFade {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* Output Section - Hidden by Default */
.output-section {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.output-section.active {
    opacity: 1;
}

.insights-node {
    background: transparent;
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateX(30px);
}

.insights-node.active {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.2);
    opacity: 1;
    transform: translateX(0);
}

.insight-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
    display: block;
    color: #f59e0b;
}

.insight-label {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 16px;
}

.insight-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border-left: 3px solid rgba(245, 158, 11, 0.6);
}

.insight-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: #f59e0b;
}

.insight-text {
    font-size: 0.8rem;
    color: #1e293b;
    line-height: 1.4;
}

/* Flow Lines - Minimal for clean look */
.flow-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.flow-line {
    stroke: rgba(74, 144, 226, 0.6);
    stroke-width: 2;
    fill: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flow-line.active {
    opacity: 0.4;
    animation: flowAnimation 2s ease-in-out infinite;
}

@keyframes flowAnimation {
    0% { stroke-dashoffset: 10; }
    100% { stroke-dashoffset: -10; }
}

/* Particle Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Enhanced Data Flow Particles */
.data-flow-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(74, 144, 226, 0.8);
    border-radius: 50%;
    opacity: 0;
    z-index: 12;
    pointer-events: none;
}

.data-flow-particle.active {
    opacity: 0.8;
    animation: flowParticle 2s ease-out forwards;
}

@keyframes flowParticle {
    0% { 
        opacity: 0.8; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5); 
    }
    100% { 
        opacity: 0; 
        transform: scale(0.5); 
    }
}

/* Enhanced Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes badge-glow {
    0%, 100% { 
        box-shadow: 
            0 4px 16px rgba(99, 102, 241, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% { 
        box-shadow: 
            0 6px 20px rgba(99, 102, 241, 0.4),
            0 3px 6px rgba(0, 0, 0, 0.15);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ai-core {
        width: 140px;
        height: 140px;
    }
    
    .core-icon {
        font-size: 2.5rem;
    }
    
    .output-section {
        width: 250px;
    }
    
    .agent-status-grid {
        width: 400px;
    }
    
    .left-column {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .ai-core {
        width: 120px;
        height: 120px;
        top: 35%;
    }
    
    .core-icon {
        font-size: 2rem;
    }
    
    .agent-status-grid {
        top: 60%;
        width: 300px;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    
    .output-section {
        width: 220px;
        right: 20px;
    }
    
    .left-column {
        left: 20px;
        width: 220px;
        gap: 20px;
    }
    
    .mcp-agent {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .mcp-agent::before {
        font-size: 28px;
    }
} 

