/* Trust Score Color System */
/* 4-Stage color coding for trust scores based on total_score (0-100) */

/* High Trust (70-100) - Green */
.trust-high, .bg-trust-high {
    background-color: #28a745 !important;
    color: white !important;
}

.text-trust-high {
    color: #28a745 !important;
}

.border-trust-high {
    border-color: #28a745 !important;
}

/* Medium Trust (50-69) - Yellow/Orange */
.trust-medium, .bg-trust-medium {
    background-color: #ffc107 !important;
    color: #212529 !important; /* Dark text for better contrast */
}

.text-trust-medium {
    color: #ffc107 !important;
}

.border-trust-medium {
    border-color: #ffc107 !important;
}

/* Low Trust (25-49) - Orange */
.trust-low, .bg-trust-low {
    background-color: #fd7e14 !important;
    color: white !important;
}

.text-trust-low {
    color: #fd7e14 !important;
}

.border-trust-low {
    border-color: #fd7e14 !important;
}

/* Very Low Trust (0-24) - Red */
.trust-very-low, .bg-trust-very-low {
    background-color: #dc3545 !important;
    color: white !important;
}

.text-trust-very-low {
    color: #dc3545 !important;
}

.border-trust-very-low {
    border-color: #dc3545 !important;
}

/* Trust Score Badge Styling */
.trust-score-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.trust-score-badge i {
    margin-right: 4px;
    font-size: 0.9em;
}

.trust-score-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Trust Score Card Styling */
.trust-score-card {
    border-left: 4px solid;
    transition: all 0.2s ease-in-out;
}

.trust-score-card.trust-high {
    border-left-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

.trust-score-card.trust-medium {
    border-left-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.05);
}

.trust-score-card.trust-low {
    border-left-color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.05);
}

.trust-score-card.trust-very-low {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Trust Score Progress Bar - Full Width for Posts */
.trust-score-progress {
    height: 6px;
    border-radius: 0;
    overflow: hidden;
    background-color: #e9ecef;
    position: relative;
    margin: 0;
}

.trust-score-progress-bar {
    height: 100%;
    transition: width 0.8s ease-in-out;
    position: relative;
    overflow: hidden;
}

.trust-score-progress-bar.trust-high {
    background: linear-gradient(90deg, #20c997, #28a745);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.trust-score-progress-bar.trust-medium {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.trust-score-progress-bar.trust-low {
    background: linear-gradient(90deg, #fd7e14, #dc3545);
    box-shadow: 0 0 10px rgba(253, 126, 20, 0.3);
}

.trust-score-progress-bar.trust-very-low {
    background: linear-gradient(90deg, #dc3545, #bd2130);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

/* Mini Progress Bar for Truth Block Headers */
.trust-score-progress-mini {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background-color: #e9ecef;
    position: relative;
    display: inline-block;
}

.trust-score-progress-mini .trust-score-progress-bar {
    height: 100%;
    transition: width 0.6s ease-in-out;
}

.trust-score-progress-mini .trust-score-progress-bar.trust-high {
    background: #28a745;
}

.trust-score-progress-mini .trust-score-progress-bar.trust-medium {
    background: #ffc107;
}

.trust-score-progress-mini .trust-score-progress-bar.trust-low {
    background: #fd7e14;
}

.trust-score-progress-mini .trust-score-progress-bar.trust-very-low {
    background: #dc3545;
}

/* No Comments Yet Styling */
.trust-score-progress.no-comments {
    background-color: #f8f9fa;
}

.trust-score-progress-bar.no-comments-bar {
    background: repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #e9ecef 10px, #e9ecef 20px) !important;
    border: 1px solid #dee2e6;
}

.trust-score-progress-mini.no-comments {
    background-color: #f8f9fa;
}

.trust-score-progress-mini .trust-score-progress-bar.no-comments-bar {
    background: repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #e9ecef 10px, #e9ecef 20px) !important;
    border: 1px solid #dee2e6;
}

/* Card with bottom progress bar */
.trust-score-card-with-bar {
    border-radius: 0.375rem 0.375rem 0 0;
    overflow: hidden;
    position: relative;
}

.trust-score-card-with-bar .trust-score-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
}

/* Hover effects for progress bars */
.trust-score-progress:hover .trust-score-progress-bar,
.trust-score-progress-mini:hover .trust-score-progress-bar {
    transform: scaleY(1.2);
    transition: transform 0.2s ease-in-out, width 0.8s ease-in-out;
}

/* Progress bar with percentage indicator */
.trust-score-progress-with-label {
    position: relative;
}

.trust-score-progress-with-label:hover::after {
    content: attr(data-score) '%';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Animation for progress bar loading */
@keyframes trust-progress-fill {
    from { width: 0%; }
    to { width: var(--target-width); }
}

.trust-score-progress-bar.animate-fill {
    animation: trust-progress-fill 1s ease-out;
}

/* Pulse effect for very low trust scores */
.trust-score-progress-bar.trust-very-low {
    animation: trust-warning-pulse 2s infinite;
}

@keyframes trust-warning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Trust Score Legend */
.trust-score-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.trust-score-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trust-score-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .trust-score-badge {
        font-size: 0.7em;
        padding: 0.25em 0.5em;
    }

    .trust-score-legend {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Animation for score changes */
@keyframes trust-score-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.trust-score-updated {
    animation: trust-score-pulse 0.3s ease-in-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .trust-score-card.trust-high {
        background-color: rgba(40, 167, 69, 0.15);
    }

    .trust-score-card.trust-medium {
        background-color: rgba(255, 193, 7, 0.15);
    }

    .trust-score-card.trust-low {
        background-color: rgba(253, 126, 20, 0.15);
    }

    .trust-score-card.trust-very-low {
        background-color: rgba(220, 53, 69, 0.15);
    }
}
