/* Professional Agent Status System */

/* Agent Status Container */
.agent-status-container {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    z-index: 1000;
    pointer-events: none;
}

.agent-status-container.visible {
    pointer-events: auto;
}

/* Professional Agent Status Box */
.agent-status-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRight 0.3s ease forwards;
}

[data-theme="dark"] .agent-status-box {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.agent-status-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .agent-status-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Professional Agent Header */
.agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.agent-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 600;
}

.agent-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.agent-close:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* Professional Agent Status */
.agent-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.agent-status.idle {
    color: var(--text-secondary);
}

.agent-status.idle::before {
    background: #94a3b8;
}

.agent-status.thinking {
    color: #d97706;
}

.agent-status.thinking::before {
    background: #d97706;
    animation: pulse 2s infinite;
}

.agent-status.processing {
    color: #059669;
}

.agent-status.processing::before {
    background: #059669;
    animation: pulse 1.5s infinite;
}

.agent-status.complete {
    color: #059669;
}

.agent-status.complete::before {
    background: #059669;
}

.agent-status.error {
    color: #dc2626;
}

.agent-status.error::before {
    background: #dc2626;
}

/* Progress Dots */
.agent-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    height: 8px;
    align-items: center;
}

.progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: dotPulse 1.5s infinite;
}

.progress-dot.completed {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Professional Agent Task */
.agent-task {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
    margin-top: 8px;
}

.agent-task.thinking {
    border-left-color: #d97706;
    background: rgba(217, 119, 6, 0.05);
}

.agent-task.processing {
    border-left-color: #059669;
    background: rgba(5, 150, 105, 0.05);
}

.agent-task.complete {
    border-left-color: #059669;
    background: rgba(5, 150, 105, 0.05);
}

.agent-task.error {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

/* Task Title */
.task-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

/* Task Description */
.task-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Task Progress */
.task-progress {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Agent Types */
.agent-status-box.analyzer .agent-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.agent-status-box.researcher .agent-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.agent-status-box.writer .agent-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.agent-status-box.synthesizer .agent-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.agent-status-box.validator .agent-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Professional Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

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

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

@keyframes statusGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .agent-status-container {
        position: fixed;
        top: auto;
        bottom: 100px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 200px;
    }
    
    .agent-status-box {
        margin-bottom: 8px;
        padding: 12px;
    }
    
    .agent-name {
        font-size: 13px;
    }
    
    .agent-task {
        font-size: 11px;
    }
}

/* Dark/Light Theme Support */
[data-theme="light"] .agent-status-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

[data-theme="light"] .agent-name {
    color: #1f2937;
}

[data-theme="light"] .agent-status {
    color: rgba(31, 41, 55, 0.8);
}

[data-theme="light"] .agent-task {
    color: rgba(31, 41, 55, 0.9);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .progress-dot {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .agent-close {
    color: rgba(31, 41, 55, 0.6);
}

[data-theme="light"] .agent-close:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.1);
}

/* Agent Status Toggle Button */
.agent-status-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(45, 45, 45, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.agent-status-toggle:hover {
    background: rgba(45, 45, 45, 1);
    transform: translateY(-1px);
}

.agent-status-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Agent Count Badge */
.agent-count-badge {
    background: #10b981;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    min-width: 16px;
    text-align: center;
}

/* Task Agent Specific Styling */
.task-agent {
    border-left: 3px solid var(--accent-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(16, 163, 127, 0.05) 100%);
    margin-bottom: 12px;
}

.task-agent .agent-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0d8f6b 100%);
}

.task-agent.processing {
    border-left-color: #d97706;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(217, 119, 6, 0.05) 100%);
}

.task-agent.complete {
    border-left-color: #059669;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(5, 150, 105, 0.05) 100%);
}

/* Agent Separator */
.agent-separator {
    display: flex;
    align-items: center;
    margin: 20px 0 16px 0;
    padding: 0 20px;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.separator-text {
    margin: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Task Progress */
.task-agent .task-progress {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.task-agent.processing .task-progress {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
    color: #d97706;
}

.task-agent.complete .task-progress {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
    color: #059669;
}
