/**
 * Media Bias Indicators Styles
 * Visual indicators for political bias and source credibility
 */

/* Bias Indicators */
.bias-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
}

/* Political Bias Colors */
.bias-far-left {
    background: linear-gradient(135deg, #8B0000, #A52A2A);
    color: white;
    box-shadow: 0 1px 3px rgba(139, 0, 0, 0.3);
}

.bias-left {
    background: linear-gradient(135deg, #DC143C, #FF1493);
    color: white;
    box-shadow: 0 1px 3px rgba(220, 20, 60, 0.3);
}

.bias-center-left {
    background: linear-gradient(135deg, #FF6347, #FF7F50);
    color: white;
    box-shadow: 0 1px 3px rgba(255, 99, 71, 0.3);
}

.bias-center {
    background: linear-gradient(135deg, #708090, #778899);
    color: white;
    box-shadow: 0 1px 3px rgba(112, 128, 144, 0.3);
}

.bias-center-right {
    background: linear-gradient(135deg, #4169E1, #6495ED);
    color: white;
    box-shadow: 0 1px 3px rgba(65, 105, 225, 0.3);
}

.bias-right {
    background: linear-gradient(135deg, #000080, #0000CD);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 128, 0.3);
}

.bias-far-right {
    background: linear-gradient(135deg, #191970, #483D8B);
    color: white;
    box-shadow: 0 1px 3px rgba(25, 25, 112, 0.3);
}

/* Credibility Indicators */
.credibility-indicator {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
}

.cred-very-high {
    background: #28a745;
    color: white;
}

.cred-high {
    background: #6f42c1;
    color: white;
}

.cred-mostly-factual {
    background: #17a2b8;
    color: white;
}

.cred-mixed {
    background: #ffc107;
    color: #212529;
}

.cred-low {
    background: #fd7e14;
    color: white;
}

.cred-very-low {
    background: #dc3545;
    color: white;
}

/* Bias Score Bar */
.bias-score-bar {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    border-radius: 2px;
    position: relative;
    margin: 2px 0;
}

.bias-score-marker {
    position: absolute;
    top: -2px;
    width: 8px;
    height: 8px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    transform: translateX(-50%);
}

/* Article Bias Info */
.article-bias-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.article-bias-info .source-name {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Bias Tooltip */
.bias-tooltip {
    position: relative;
    cursor: help;
}

.bias-tooltip .bias-tooltip-content {
    visibility: hidden;
    width: 280px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.bias-tooltip .bias-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.bias-tooltip:hover .bias-tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Bias Filter Controls */
.bias-filter-controls {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 16px;
}

.bias-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bias-filter-group label {
    font-weight: 500;
    margin-bottom: 0;
    font-size: 14px;
}

.bias-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.bias-filter-checkbox input[type="checkbox"] {
    margin: 0;
}

.bias-filter-checkbox .bias-indicator {
    font-size: 10px;
    padding: 2px 6px;
}

/* Source Reliability Badge */
.source-reliability {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6c757d;
}

.reliability-stars {
    color: #ffc107;
}

/* Article Card Bias Enhancement */
.article-card .article-bias-info {
    border-top: 1px solid #e9ecef;
    padding-top: 8px;
    margin-top: 8px;
}

.article-card.bias-enhanced {
    border-left: 3px solid;
}

.article-card.bias-enhanced.bias-left-leaning {
    border-left-color: #dc3545;
}

.article-card.bias-enhanced.bias-center {
    border-left-color: #6c757d;
}

.article-card.bias-enhanced.bias-right-leaning {
    border-left-color: #007bff;
}

/* Bias Legend */
.bias-legend {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
}

.bias-legend-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.bias-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bias-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bias-indicator {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .article-bias-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .bias-filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .bias-tooltip .bias-tooltip-content {
        width: 240px;
        margin-left: -120px;
    }
}

/* Dark Theme Support */
[data-theme="dark"] .bias-filter-controls {
    background: #2c3e50;
    border-color: #34495e;
}

[data-theme="dark"] .bias-legend {
    background: #2c3e50;
    border-color: #34495e;
    color: #ecf0f1;
}

[data-theme="dark"] .article-bias-info {
    border-top-color: #34495e;
}

[data-theme="dark"] .bias-tooltip .bias-tooltip-content {
    background-color: #2c3e50;
    color: #ecf0f1;
}

[data-theme="dark"] .bias-tooltip .bias-tooltip-content::after {
    border-color: #2c3e50 transparent transparent transparent;
}

/* Bias Analysis Confidence Indicator */
.bias-confidence {
    display: inline-block;
    width: 40px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    position: relative;
    margin-left: 4px;
}

.bias-confidence::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #28a745;
    border-radius: 2px;
    width: var(--confidence-width, 0%);
}

/* Animation for bias indicators */
.bias-indicator {
    transition: all 0.2s ease;
}

.bias-indicator:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Bias warning for extreme sources */
.bias-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #856404;
}

[data-theme="dark"] .bias-warning {
    background: #2c3e50;
    border-color: #f39c12;
    color: #f39c12;
}

.bias-warning-icon {
    margin-right: 6px;
}

/* Source diversity indicator */
.source-diversity {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.diversity-dots {
    display: flex;
    gap: 2px;
}

.diversity-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #dee2e6;
}

.diversity-dot.active {
    background: #28a745;
}