/* Research Progress Indicators */

/* Main Research Indicator Container */
.research-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.75rem;
    animation: fadeIn 0.3s ease-in;
}

.research-indicator.active {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Research Status Icon */
.research-indicator-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    position: relative;
}

.research-indicator-icon.spinning {
    animation: spin 1s linear infinite;
}

.research-indicator-icon svg {
    width: 20px;
    height: 20px;
}

/* Research Status Text */
.research-indicator-content {
    flex: 1;
}

.research-indicator-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.research-indicator-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Phase Indicators */
.research-phases {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.research-phase {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.research-phase.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.research-phase.completed {
    background: var(--success-color);
    color: white;
}

.research-phase-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Agent Activity Indicator */
.agent-activity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border-left: 3px solid var(--primary-color);
    margin: 0.5rem 0;
    border-radius: 0.25rem;
    animation: slideInLeft 0.3s ease-out;
}

.agent-activity-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Different agent type colors */
.agent-activity.researcher .agent-activity-icon {
    background: #3b82f6; /* Blue */
}

.agent-activity.reader .agent-activity-icon {
    background: #10b981; /* Green */
}

.agent-activity.discussant .agent-activity-icon {
    background: #f59e0b; /* Amber */
}

.agent-activity.analyst .agent-activity-icon {
    background: #ec4899; /* Pink */
}

.agent-activity-text {
    flex: 1;
}

.agent-activity-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.agent-activity-task {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Tool Usage Indicators */
.tool-usage {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--primary-color);
    margin: 0.25rem;
    animation: fadeIn 0.2s ease-in;
}

.tool-usage-icon {
    width: 14px;
    height: 14px;
}

/* Sources Found Indicator */
.sources-found {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.source-badge:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.source-badge-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* Progress Bar for Research */
.research-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 9999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.research-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 9999px;
    transition: width 0.3s ease-out;
    position: relative;
}

.research-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 1.5s infinite;
}

/* Stream Chunk Container */
.stream-chunk {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--bg-primary);
    border-left: 2px solid var(--primary-color);
    border-radius: 0.25rem;
    animation: fadeInUp 0.2s ease-out;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
    }
}

@keyframes shimmer {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(200%);
    }
}

/* Dark Mode Adjustments */
.dark .research-indicator {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.dark .research-phase {
    background: #1f2937;
    color: #9ca3af;
}

.dark .research-phase.active {
    background: var(--primary-color);
    color: white;
}

.dark .agent-activity {
    background: #1f2937;
}

.dark .tool-usage {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.1);
}

.dark .source-badge {
    background: #1f2937;
    border-color: #374151;
}

.dark .source-badge:hover {
    background: var(--primary-color);
    color: white;
}

.dark .research-progress-bar {
    background: #374151;
}

.dark .stream-chunk {
    background: #1f2937;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .research-indicator {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .research-phases {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .research-phase {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
    }
    
    .agent-activity {
        padding: 0.375rem 0.75rem;
    }
    
    .sources-found {
        justify-content: center;
    }
}

/* Research Complete Animation */
.research-complete {
    animation: completeGlow 0.5s ease-out;
}

@keyframes completeGlow {
    0% {
        background-color: var(--success-color);
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Error State */
.research-indicator.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.research-indicator.error .research-indicator-icon {
    background: var(--danger-color);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}
