/* Enhanced UI Components for Agentic System */

/* Results Header Enhancements */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.results-title-section h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.agent-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.1), rgba(113, 107, 98, 0.1));
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.agent-badge:hover {
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.15), rgba(113, 107, 98, 0.15));
    border-color: rgba(191, 180, 163, 0.3);
    transform: translateY(-2px);
}

.agent-icon {
    font-size: 1.2rem;
}

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

.agent-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.1), rgba(113, 107, 98, 0.1));
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.2), rgba(113, 107, 98, 0.2));
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 180, 163, 0.2);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(191, 180, 163, 0.15);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.metric-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px rgba(191, 180, 163, 0.3));
}

.metric-card:hover .metric-icon {
    transform: scale(1.1);
}

.metric-card:hover .metric-icon svg {
    filter: drop-shadow(0 4px 12px rgba(191, 180, 163, 0.5));
}

.metric-content {
    flex: 1;
    min-width: 0;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

/* Enhanced Quality Display */
.quality-display-enhanced {
    width: 100%;
}

.quality-bar-container {
    position: relative;
    width: 100%;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.quality-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    border-radius: 16px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quality-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.quality-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.quality-status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quality-status-badge.high {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.quality-status-badge.medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.quality-status-badge.low {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(191, 180, 163, 0.05), rgba(113, 107, 98, 0.05));
    border-radius: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 100%;
    height: 100%;
}

.stat-item:hover .stat-icon svg {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

/* Enhanced Section Headers */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(191, 180, 163, 0.3));
    transition: transform 0.3s ease;
}

.result-section-header:hover .section-icon svg {
    transform: scale(1.1);
}

.section-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.label-count-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(191, 180, 163, 0.15);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Labels Visual Grid - Consolidated in label_ui_improvements.css */
/* Removed duplicate definitions to avoid conflicts */

.label-card-key {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-card-value {
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-word;
}

.label-card-value.array {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.label-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(191, 180, 163, 0.1);
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* JSON View Container */
.json-view-container {
    margin-top: 1.5rem;
}

.json-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.json-view-header span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.json-toggle-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(191, 180, 163, 0.1);
    border: 1px solid rgba(191, 180, 163, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.json-toggle-btn:hover {
    background: rgba(191, 180, 163, 0.2);
    border-color: var(--primary-color);
}

/* Expanded state for labels section */
.result-section.expanded .result-section-content {
    display: block !important;
}

.result-section.expanded .expand-btn {
    transform: rotate(180deg);
}

/* Badge Enhancements - Consolidated in label_ui_improvements.css */
/* Removed duplicate definitions to avoid conflicts */

/* Responsive Design */
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Labels grid responsive styles consolidated in label_ui_improvements.css */
}
