/**
 * Accuracy Tracking Component Styles
 * Design: Modern, clean, with clear visual hierarchy
 */

/* ==================== */
/* Accuracy Badge       */
/* ==================== */

.accuracy-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.accuracy-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.accuracy-badge.compact {
    padding: 4px 8px;
}

.accuracy-badge .badge-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.accuracy-badge .badge-indicator.success {
    color: #10b981;
}

.accuracy-badge .badge-indicator.warning {
    color: #f59e0b;
}

.accuracy-badge .badge-indicator.danger {
    color: #ef4444;
}

.accuracy-badge .badge-indicator.secondary {
    color: #6b7280;
}

.accuracy-badge.full {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
}

.accuracy-badge .badge-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 8px;
}

.accuracy-badge .provider-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.accuracy-badge .badge-label {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.accuracy-badge .badge-label.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.accuracy-badge .badge-label.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.accuracy-badge .badge-label.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.accuracy-badge .badge-label.gray {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.accuracy-badge .badge-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.accuracy-badge .accuracy-value {
    font-size: 1rem;
    font-weight: 700;
}

.accuracy-badge .predictions-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.accuracy-badge.insufficient,
.accuracy-badge.error {
    opacity: 0.7;
}

/* ==================== */
/* Leaderboard          */
/* ==================== */

.leaderboard-filters {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.leaderboard-table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.leaderboard-table th {
    padding: 16px;
    text-align: start;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-table tbody tr.top-performer {
    background: rgba(59, 130, 246, 0.05);
}

.leaderboard-table td {
    padding: 16px;
    font-size: 0.9375rem;
}

.rank-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.medal {
    font-size: 1.5rem;
}

.rank-number {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.provider-name {
    font-weight: 500;
}

.accuracy-bar-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.accuracy-bar {
    height: 8px;
    border-radius: 4px;
    background: currentColor;
    min-width: 20px;
    transition: width 0.3s ease;
}

.accuracy-bar.success {
    color: #10b981;
}

.accuracy-bar.warning {
    color: #f59e0b;
}

.accuracy-bar.danger {
    color: #ef4444;
}

.accuracy-value {
    font-weight: 600;
    min-width: 50px;
}

.badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge.secondary {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.leaderboard-loading,
.leaderboard-empty,
.leaderboard-error {
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.retry-btn {
    margin-top: 16px;
    padding: 8px 24px;
    border-radius: 6px;
    border: none;
    background: #3b82f6;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retry-btn:hover {
    background: #2563eb;
}

/* ==================== */
/* Accuracy Panel       */
/* ==================== */

.accuracy-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.accuracy-panel .panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
}

.accuracy-panel .panel-title svg {
    color: #10b981;
}

.track-record-section {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 24px;
}

.track-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.track-record-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.predictions-section {
    margin-top: 24px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.predictions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prediction-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    border-inline-start: 4px solid transparent;
}

.prediction-item.evaluated.correct {
    border-inline-start-color: #10b981;
}

.prediction-item.evaluated.incorrect {
    border-inline-start-color: #ef4444;
}

.prediction-item.pending {
    border-inline-start-color: #f59e0b;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.symbol-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.symbol {
    font-size: 1.125rem;
    font-weight: 700;
}

.asset-class {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.status-icon {
    font-size: 1.5rem;
}

.status-icon.correct {
    color: #10b981;
}

.status-icon.incorrect {
    color: #ef4444;
}

.status-icon.pending {
    color: #f59e0b;
}

.prediction-details,
.outcome-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prediction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prediction-row:last-child {
    border-bottom: none;
}

.prediction-row .label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.prediction-row .value {
    font-weight: 600;
}

.sentiment.bullish {
    color: #10b981;
}

.sentiment.bearish {
    color: #ef4444;
}

.sentiment.neutral {
    color: #6b7280;
}

.value.positive {
    color: #10b981;
}

.value.negative {
    color: #ef4444;
}

.value.correct {
    color: #10b981;
}

.value.incorrect {
    color: #ef4444;
}

.outcome-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.outcome-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.pending-section {
    margin-top: 12px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
}

.pending-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f59e0b;
    font-size: 0.875rem;
}

.accuracy-panel.loading,
.accuracy-panel.empty,
.accuracy-panel.error {
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== */
/* Responsive Design    */
/* ==================== */

@media (max-width: 768px) {
    .leaderboard-filters {
        flex-direction: column;
        gap: 16px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
    }
    
    .leaderboard-table {
        font-size: 0.875rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 8px;
    }
    
    .track-record-stats {
        grid-template-columns: 1fr;
    }
    
    .prediction-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] .accuracy-badge {
    background: var(--bg-surface);
    border-color: var(--border);
}

[data-theme="light"] .accuracy-badge .provider-name {
    color: var(--text-muted);
}

[data-theme="light"] .accuracy-badge .predictions-count {
    color: var(--text-muted);
}

[data-theme="light"] .leaderboard-filters {
    background: var(--bg-surface);
}

[data-theme="light"] .filter-group label {
    color: var(--text-muted);
}

[data-theme="light"] .filter-select,
[data-theme="light"] .filter-input {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .leaderboard-table-container {
    background: var(--bg-card);
}

[data-theme="light"] .leaderboard-table thead {
    background: var(--bg-surface);
}

[data-theme="light"] .leaderboard-table th {
    color: var(--text-muted);
    border-bottom-color: var(--border);
}

[data-theme="light"] .leaderboard-table tbody tr {
    border-bottom-color: var(--border);
}

[data-theme="light"] .leaderboard-table tbody tr:hover {
    background: var(--bg-surface);
}

[data-theme="light"] .rank-number {
    color: var(--text-muted);
}

[data-theme="light"] .accuracy-panel {
    background: var(--bg-surface);
}

[data-theme="light"] .accuracy-panel .panel-title {
    color: var(--text);
}

[data-theme="light"] .track-record-section {
    background: var(--bg-card);
}

[data-theme="light"] .stat-label {
    color: var(--text-muted);
}

[data-theme="light"] .section-title {
    color: var(--text);
}

[data-theme="light"] .prediction-item {
    background: var(--bg-card);
}

[data-theme="light"] .prediction-row {
    border-bottom-color: var(--border);
}

[data-theme="light"] .prediction-row .label {
    color: var(--text-muted);
}

[data-theme="light"] .outcome-header {
    color: var(--text-muted);
}

[data-theme="light"] .outcome-section {
    border-top-color: var(--border);
}

[data-theme="light"] .asset-class {
    background: var(--bg-surface);
}

[data-theme="light"] .leaderboard-loading,
[data-theme="light"] .leaderboard-empty,
[data-theme="light"] .leaderboard-error,
[data-theme="light"] .accuracy-panel.loading,
[data-theme="light"] .accuracy-panel.empty,
[data-theme="light"] .accuracy-panel.error {
    color: var(--text-muted);
}

[data-theme="light"] .spinner {
    border-color: var(--border);
    border-top-color: #3b82f6;
}
