/* AI Loading Bar */
.loading-bar-container {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    animation: loading-fill 2s ease-in-out forwards, gradient-move 1s linear infinite;
    border-radius: 5px;
}

@keyframes loading-fill {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

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

.loading-steps .step {
    opacity: 0.5;
    transition: all 0.3s;
}
.loading-steps .step.active {
    opacity: 1;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* AI Terminal */
.log-line {
    color: #00ff88;
    margin-bottom: 5px;
    font-family: 'Consolas', monospace;
    opacity: 0;
    animation: fade-in 0.2s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-line.error { color: #ff5f56; }
.log-line.warn { color: #ffbd2e; }
.log-line.info { color: #5865F2; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* AI Blueprint Area */
.blueprint-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

.ai-node {
    position: absolute;
    width: 140px;
    height: 50px;
    background: #2f3136;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-node.visible {
    opacity: 1;
    transform: scale(1);
}

.ai-node.trigger { border-left: 4px solid #5865F2; }
.ai-node.action { border-left: 4px solid #00ff88; }
.ai-node.condition { border-left: 4px solid #ffbd2e; }

.ai-connection {
    position: absolute;
    height: 2px;
    background: #555;
    transform-origin: left center;
    z-index: 1;
    width: 0;
    transition: width 0.5s ease-out;
}

.ai-connection.visible {
    /* Width will be set inline by JS */
}

/* Success Overlay */
@keyframes scale-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Chat Interface */
.chat-message {
    display: flex;
    gap: 15px;
    max-width: 85%;
    animation: fade-in 0.3s forwards;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.ai {
    align-self: flex-start;
}

.chat-message .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #2b2d31;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.chat-message.user .avatar { background: #5865F2; color: white; }
.chat-message.ai .avatar { background: #00ff88; color: black; }

.chat-message .content {
    background: #2b2d31;
    padding: 12px 16px;
    border-radius: 12px;
    color: #dcddde;
    line-height: 1.5;
    font-size: 0.95em;
    border: 1px solid rgba(255,255,255,0.05);
}

.chat-message.user .content {
    background: #5865F2;
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-message.ai .content {
    background: #2f3136;
    border-bottom-left-radius: 2px;
}

.chat-message.system {
    align-self: center;
    max-width: 100%;
}
.chat-message.system .content {
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.85em;
    font-style: italic;
    padding: 5px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 5px 0;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
