/**
 * News Dashboard UX/UI Enhancements
 * Modern, interactive, information-dense design
 */

/* ==================== */
/* Sentiment Visualization with Progress Bars */
/* ==================== */

.sentiment-indicator {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}

.sentiment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.sentiment-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.sentiment-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sentiment-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 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%); }
}

/* Sentiment Colors */
.sentiment-bullish .sentiment-label {
    color: #10b981;
}

.sentiment-bullish .sentiment-progress-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.sentiment-bearish .sentiment-label {
    color: #ef4444;
}

.sentiment-bearish .sentiment-progress-bar {
    background: linear-gradient(90deg, #ef4444, #f87171);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.sentiment-neutral .sentiment-label {
    color: #f59e0b;
}

.sentiment-neutral .sentiment-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.confidence-value {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-inline-start: auto;
}

/* ==================== */
/* Dynamic Chips & Clickable Badges */
/* ==================== */

.entity-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    margin: 2px 4px 2px 0;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.entity-chip:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.entity-chip:active {
    transform: translateY(0);
}

/* Different chip types */
.entity-chip.chip-stock {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.entity-chip.chip-stock:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.entity-chip.chip-crypto {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.entity-chip.chip-crypto:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fcd34d;
}

.entity-chip.chip-sector {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
}

.entity-chip.chip-sector:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
}

.entity-chip svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.entity-chip:hover svg {
    opacity: 1;
}

/* ==================== */
/* Enhanced AI Provider Banner */
/* ==================== */

.ai-capabilities-banner {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-capabilities-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

.provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin: 4px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #a78bfa;
    transition: all 0.2s;
}

.provider-badge:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    transform: scale(1.05);
}

.provider-badge.badge-gemini {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.provider-badge.badge-groq {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.provider-badge.badge-deepseek {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.provider-badge.badge-finbert {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.provider-badge.badge-openai {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.provider-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* ==================== */
/* Typography & Spacing Improvements */
/* ==================== */

.key-drivers-list {
    line-height: 1.8;
    margin: 16px 0;
}

.key-drivers-list li {
    margin-bottom: 12px;
    padding-inline-start: 8px;
    border-inline-start: 3px solid rgba(59, 130, 246, 0.3);
    transition: border-color 0.2s;
}

.key-drivers-list li:hover {
    border-inline-start-color: rgba(59, 130, 246, 0.6);
}

.dominant-sectors-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dominant-sectors-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 600;
}

/* ==================== */
/* Relative Time Display */
/* ==================== */

.relative-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.relative-time.recent {
    color: #10b981;
    font-weight: 600;
}

.relative-time.recent::before {
    content: "●";
    color: #10b981;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* pulse animation defined in dashboard.css */

/* ==================== */
/* Enhanced Advanced Button */
/* ==================== */

.advanced-filter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #60a5fa;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.advanced-filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    padding: 1px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.advanced-filter-btn:hover::before {
    opacity: 1;
}

.advanced-filter-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.advanced-filter-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-filter-btn:hover svg {
    transform: rotate(90deg);
}

.advanced-filter-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    color: #93c5fd;
}

/* ==================== */
/* Digest Card Enhancements */
/* ==================== */

.digest-key-driver-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    margin: 4px 6px 4px 0;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #60a5fa;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.digest-key-driver-chip:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.digest-sentiment-enhanced {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}

.digest-confidence-bar {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.digest-confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.digest-confidence-fill.high {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.digest-confidence-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.digest-confidence-fill.low {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ==================== */
/* Mobile Optimizations */
/* ==================== */

@media (max-width: 768px) {
    .sentiment-indicator {
        min-width: 100px;
    }
    
    .entity-chip {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    .provider-badges-container {
        justify-content: center;
    }
    
    .advanced-filter-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== */
/* Mobile Optimizations */
/* ==================== */

/* Mobile: Ensure AI stats remain visible */
@media (max-width: 768px) {
    .ai-banner-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    .ai-stat {
        font-size: 0.75rem;
        padding: 3px 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .ai-providers-badges {
        display: none;
    }
}

/* ==================== */
/* Accessibility Enhancements */
/* ==================== */

.entity-chip:focus-visible,
.advanced-filter-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sentiment-progress-bar::after,
    .relative-time.recent::before {
        animation: none;
    }
    
    .ai-capabilities-banner:hover,
    .entity-chip:hover,
    .advanced-filter-btn:hover {
        transform: none;
    }
}
