/**
 * AI Analytics Dashboard Styles
 * Modern, professional design for Data Quality Analytics
 */

/* ===== AI ANALYTICS CONTAINER ===== */
#tab-content-ai_analytics {
    animation: fadeIn 0.4s ease-in;
}

/* ===== HEADER SECTION ===== */
.ai-analytics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .ai-analytics-header {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
}

.ai-analytics-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-analytics-header p {
    opacity: 0.9;
    font-size: 0.875rem;
}

.ai-analytics-status {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-analytics-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== METRIC CARDS ===== */
.ai-metric-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.dark .ai-metric-card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
}

.ai-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.ai-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dark .ai-metric-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}

.ai-metric-card:hover::before {
    transform: scaleX(1);
}

.ai-metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.ai-metric-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 12px;
}

.ai-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .ai-metric-value {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.dark .ai-metric-label {
    color: #9ca3af;
}

.ai-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 1rem;
    position: relative;
}

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

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 9999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ai-progress-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%);
    }
}

/* ===== SECTION CARDS ===== */
.ai-section-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.dark .ai-section-card {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
}

.ai-section-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .ai-section-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.ai-section-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark .ai-section-header {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ai-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.dark .ai-section-title {
    color: #f9fafb;
}

.ai-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.ai-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ai-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.dark .ai-legend-item {
    color: #9ca3af;
}

.ai-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== COMPLETENESS ITEMS ===== */
.ai-completeness-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dark .ai-completeness-item {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.1);
}

.ai-completeness-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark .ai-completeness-item:hover {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-completeness-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-completeness-info {
    flex: 1;
    min-width: 0;
}

.ai-completeness-field-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.dark .ai-completeness-field-name {
    color: #f9fafb;
}

.ai-completeness-stats {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.dark .ai-completeness-stats {
    color: #9ca3af;
}

.ai-completeness-progress {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.dark .ai-completeness-progress {
    background: #374151;
}

.ai-completeness-progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ai-completeness-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.ai-completeness-rate {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    min-width: 60px;
    text-align: right;
}

.dark .ai-completeness-rate {
    color: #f9fafb;
}

/* ===== STAT ITEMS ===== */
.ai-stat-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.dark .ai-stat-item {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.1);
}

.ai-stat-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .ai-stat-item:hover {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dark .ai-stat-icon-wrapper {
    background: #374151;
}

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

.ai-stat-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.dark .ai-stat-name {
    color: #f9fafb;
}

.ai-stat-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.dark .ai-stat-meta {
    color: #9ca3af;
}

.ai-stat-values {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.ai-stat-value-group {
    text-align: right;
}

.ai-stat-value-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.dark .ai-stat-value-label {
    color: #9ca3af;
}

.ai-stat-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
}

.dark .ai-stat-value {
    color: #f9fafb;
}

/* ===== RECOMMENDATIONS ===== */
.ai-recommendation-item {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid #f59e0b;
    transition: all 0.3s ease;
}

.dark .ai-recommendation-item {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-left-color: #f59e0b;
}

.ai-recommendation-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ai-recommendation-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.ai-recommendation-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.dark .ai-recommendation-title {
    color: #fbbf24;
}

.ai-recommendation-text {
    font-size: 0.75rem;
    color: #78350f;
    line-height: 1.5;
}

.dark .ai-recommendation-text {
    color: #fcd34d;
}

/* ===== EMPTY STATES ===== */
.ai-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.ai-empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: #9ca3af;
}

.dark .ai-empty-state-icon {
    background: #374151;
    color: #6b7280;
}

.ai-empty-state-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.dark .ai-empty-state-title {
    color: #f9fafb;
}

.ai-empty-state-text {
    font-size: 0.75rem;
    color: #6b7280;
}

.dark .ai-empty-state-text {
    color: #9ca3af;
}

/* ===== LOADING STATES ===== */
.ai-loading-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.dark .ai-spinner {
    border-color: #374151;
    border-top-color: #818cf8;
}

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

/* ===== ERROR STATES ===== */
.ai-error-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.ai-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: #dc2626;
}

.dark .ai-error-icon {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

.ai-error-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 0.25rem;
}

.dark .ai-error-title {
    color: #f87171;
}

.ai-error-text {
    font-size: 0.75rem;
    color: #6b7280;
}

.dark .ai-error-text {
    color: #9ca3af;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ai-analytics-header {
        padding: 1.5rem;
    }

    .ai-analytics-header h2 {
        font-size: 1.5rem;
    }

    .ai-metric-card {
        padding: 1.25rem;
    }

    .ai-metric-value {
        font-size: 2rem;
    }

    .ai-section-header {
        padding: 1rem 1.25rem;
    }

    .ai-completeness-item {
        padding: 0.875rem 1rem;
    }

    .ai-stat-item {
        padding: 0.875rem 1rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== UTILITY CLASSES ===== */
.ai-gradient-blue {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.ai-gradient-green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ai-gradient-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.ai-gradient-amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}


