/* Node Scoring Dashboard CSS - Light Theme with Improved Contrast */

:root {
    /* Light Theme Color Palette - WCAG AA Compliant */
    --primary-color: #0056b3;
    --secondary-color: #495057;
    --success-color: #155724;
    --warning-color: #856404;
    --danger-color: #721c24;
    --info-color: #0c5460;
    --light-color: #ffffff;
    --dark-color: #212529;
    --muted-color: #6c757d;

    /* Light Theme Backgrounds */
    --bg-primary: #cce7ff;
    --bg-success: #d4edda;
    --bg-warning: #fff3cd;
    --bg-danger: #f8d7da;
    --bg-info: #d1ecf1;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;

    /* Light Theme Gradients */
    --gradient-primary: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    --gradient-warning: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    --gradient-info: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    --gradient-light: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);

    /* Enhanced Focus Colors */
    --focus-color: #005cbf;
    --focus-shadow: 0 0 0 3px rgba(0, 92, 191, 0.3);

    /* Light Theme Shadows */
    --shadow-light: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-focus: 0 0 0 3px rgba(0, 92, 191, 0.3);

    /* Border Colors */
    --border-light: #dee2e6;
    --border-medium: #ced4da;
    --border-dark: #adb5bd;

    /* Animations */
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* Focus Indicators for Accessibility */
button:focus,
a:focus,
.btn:focus,
.form-control:focus,
.analysis-card:focus-within {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
    box-shadow: var(--focus-shadow);
}

/* Skip to content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--dark-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Dashboard Container - Light Theme */
.dashboard-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 0;
    max-height: none;
    min-height: auto;
}

/* Dashboard Header */
.dashboard-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-medium);
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.metadata-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.metadata-item i {
    font-size: 0.8rem;
}

/* Quick Navigation */
.quick-nav-section {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-light);
}

.quick-nav-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.nav-tab {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all var(--transition-speed);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-tab:focus,
.nav-tab:focus-visible {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: var(--focus-shadow);
    z-index: 10;
}

.nav-tab:hover:focus,
.nav-tab:hover:focus-visible {
    box-shadow: var(--focus-shadow), var(--shadow-medium);
}

.nav-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.nav-tab i {
    font-size: 0.8rem;
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
    padding: 2rem 0;
    animation: fadeInUp 0.5s ease-out;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--dark-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--muted-color);
    font-size: 1.1rem;
    margin: 0;
}

/* Main Score Card */
.main-score-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    text-align: center;
}

.score-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0deg,
        var(--primary-color) calc(var(--score, 0) * 3.6deg),
        var(--border-light) calc(var(--score, 0) * 3.6deg),
        var(--border-light) 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--bg-white);
}

.score-circle:hover {
    transform: scale(1.05);
}

.score-circle:focus,
.score-circle:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
    box-shadow: var(--focus-shadow);
}

.score-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

/* Smaller font size for 'No comments yet' text */
.no-comments-text {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: var(--muted-color) !important;
    line-height: 1.4 !important;
}

.score-label {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-top: 0.5rem;
}

.score-description {
    margin-top: 1rem;
}

.score-description .badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

/* Score Breakdown Card */
.score-breakdown-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    height: 100%;
}

.score-breakdown-card h4 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.score-breakdown-chart {
    position: relative;
    height: 300px;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-top: 0.25rem;
}

/* Analysis Cards */
.analysis-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 1.5rem;
    transition: transform var(--transition-speed);
    border: 1px solid var(--border-light);
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.analysis-card .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.analysis-card .card-header h4 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-card .card-header i {
    color: var(--primary-color);
}

.analysis-card .card-body {
    padding: 1.5rem;
}

/* Score Components */
.score-component {
    margin-bottom: 1.5rem;
}

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.component-label {
    font-weight: 500;
    color: var(--dark-color);
}

.component-value {
    font-weight: 600;
    color: var(--primary-color);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-light);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-speed);
}

.progress-bar.bg-primary {
    background: var(--primary-color);
}

.progress-bar.bg-info {
    background: var(--info-color);
}

.progress-bar.bg-success {
    background: var(--success-color);
}

.progress-bar.bg-warning {
    background: var(--warning-color);
}

.progress-bar.bg-danger {
    background: var(--danger-color);
}

/* AI Breakdown Details */
.ai-breakdown-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.ai-breakdown-details h6 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    font-weight: 500;
    color: var(--dark-color);
}

.breakdown-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Method Info */
.method-info {
    margin-bottom: 1.5rem;
}

.method-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--dark-color) !important;
    line-height: 1.5;
}

.method-item:last-child {
    border-bottom: none;
}

.method-item strong {
    color: var(--secondary-color) !important;
    font-weight: 600;
}

/* Ensure text visibility in analysis method section */
.analysis-card .method-item {
    color: var(--dark-color) !important;
    /* Fallback for cases where CSS variables might not work */
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 0.25rem 0;
}

.analysis-card .method-item strong {
    color: var(--primary-color) !important;
    /* Make labels more visible */
    font-weight: 700;
}

/* Light background for better contrast */
.analysis-card .card-body {
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
}

.analysis-card .method-item {
    color: #333333 !important;
    background: rgba(248, 249, 250, 0.8);
}

.analysis-card .method-item strong {
    color: #0056b3 !important;
}

/* Quality Assessment */
.quality-assessment {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.quality-assessment .quality-label {
    color: var(--secondary-color);
    font-weight: 500;
}

.quality-assessment .quality-value {
    color: var(--dark-color);
    font-weight: 600;
}

.quality-assessment h6 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.quality-grid {
    display: grid;
    gap: 1rem;
}

.quality-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.quality-label {
    font-weight: 500;
    color: var(--dark-color);
}

.quality-value {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Ensure proper contrast for muted quality values */
.quality-value.text-muted {
    background: var(--bg-white); /* Use background that contrasts with quality-item */
    color: var(--muted-color); /* Use CSS variable for proper theme support */
    border: 1px solid var(--border-light);
    /* Ensure text is readable */
    text-shadow: none;
}

.quality-strong {
    background: var(--bg-success);
    color: var(--success-color);
}

.quality-moderate {
    background: var(--bg-warning);
    color: var(--warning-color);
}

.quality-weak {
    background: var(--bg-danger);
    color: var(--danger-color);
}

.quality-unknown {
    background: var(--bg-light);
    color: var(--muted-color);
}

/* Trust Score */
.trust-score {
    text-align: center;
}

.trust-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 3px solid var(--primary-color);
}

.trust-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Trust circle inherits the no-comments styling */

/* Fallacy warning with proper contrast */
.fallacy-warning {
    background: #dc3545; /* Red background */
    color: #ffffff; /* White text for maximum contrast */
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.fallacy-warning i {
    color: #ffffff;
}

.block-fallacies {
    margin-top: 0.5rem;
}

.trust-label {
    font-size: 0.8rem;
    color: var(--muted-color);
    margin-top: 0.25rem;
}

.trust-description {
    margin-top: 1rem;
}

/* Comment Stats */
.comment-stats {
    margin-bottom: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.stat-label {
    font-weight: 500;
    color: var(--dark-color);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Stance Distribution */
.stance-distribution {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.stance-distribution h6 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.stance-chart-container {
    height: 200px;
    margin-bottom: 1rem;
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--muted-color);
}

.no-comments i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-comments p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-comments small {
    font-size: 0.9rem;
}

/* Truth Blocks Overview */
.truth-blocks-overview {
    margin-bottom: 2rem;
}

.overview-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: transform var(--transition-speed);
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.overview-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.overview-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.overview-label {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-top: 0.5rem;
}

/* Blocks Grid */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.block-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: transform var(--transition-speed);
}

.block-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.block-header {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.block-header h5 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.block-score {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.block-content {
    padding: 1.5rem;
}

.block-text {
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.block-scores {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.block-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.score-label {
    font-weight: 500;
    color: var(--dark-color);
}

.score-value {
    font-weight: 600;
    color: var(--primary-color);
}

.block-fallacies {
    padding: 0.5rem;
    background: var(--bg-warning);
    border-radius: var(--border-radius);
    border: 1px solid var(--warning-color);
}

/* No Truth Blocks */
.no-truth-blocks {
    text-align: center;
    padding: 3rem 1rem;
}

.no-blocks-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-blocks-content i {
    font-size: 4rem;
    color: var(--muted-color);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.no-blocks-content h4 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.no-blocks-content p {
    color: var(--muted-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Calculation Flow */
.calculation-flow-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    margin-bottom: 1.5rem;
}

.calculation-flow-card h4 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.flow-step {
    flex: 1;
    min-width: 200px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-light);
    transition: all var(--transition-speed);
}

.flow-step:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
}

.flow-step.final-step {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.final-step .step-icon {
    background: var(--success-color);
}

.step-content h5 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.final-step .step-content h5 {
    color: var(--success-color);
}

.step-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.final-step .step-score {
    color: var(--success-color);
}

.step-details {
    font-size: 0.9rem;
    color: var(--muted-color);
}

.final-step .step-details {
    color: var(--success-color);
}

.flow-arrow {
    color: var(--muted-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Calculation Details */
.calculation-details-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-medium);
}

.calculation-details-card h4 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.calculation-info {
    margin-bottom: 2rem;
}

.calc-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--light-color);
}

.calc-item:last-child {
    border-bottom: none;
}

.calc-item strong {
    color: var(--light-color);
}

.weighting-info {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.weighting-info h6 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.weight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.weight-label {
    font-weight: 500;
    color: var(--dark-color);
}

.weight-value {
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Action Panel */
.action-panel {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.action-buttons .btn:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

.action-buttons .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-buttons .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.action-buttons .btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.action-buttons .btn-outline-success:hover {
    background: var(--success-color);
    color: white;
}

.action-buttons .btn-outline-info {
    border-color: var(--info-color);
    color: var(--info-color);
}

.action-buttons .btn-outline-info:hover {
    background: var(--info-color);
    color: white;
}

.last-updated {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.last-updated .text-muted {
    font-size: 0.9rem;
}

/* Animations */
@keyframes scoreRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation delays for cards */
.analysis-card {
    animation: fadeInUp 0.5s ease-out;
}

.analysis-card:nth-child(1) {
    animation-delay: 0.1s;
}

.analysis-card:nth-child(2) {
    animation-delay: 0.2s;
}

.analysis-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 2rem;
    }

    .metadata-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-circle::before {
        width: 120px;
        height: 120px;
    }

    .score-value {
        font-size: 2rem;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .blocks-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .last-updated {
        justify-content: center;
        margin-top: 1rem;
    }

    .quick-nav-tabs {
        justify-content: flex-start;
    }

    .nav-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .dashboard-header {
        padding: 1.5rem 0;
    }

    .dashboard-title {
        font-size: 1.5rem;
    }

    .main-score-section {
        padding: 1rem 0;
    }

    .analysis-grid {
        padding: 1rem 0;
    }

    .calculation-flow-section {
        padding: 1rem 0;
    }

    .truth-blocks-section {
        padding: 1rem 0;
    }

    .action-panel {
        padding: 1rem 0;
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .flow-step {
        min-width: auto;
    }

    .step-score {
        font-size: 1.2rem;
    }
}

/* Print Styles */
@media print {
    .dashboard-container {
        background: white;
    }

    .dashboard-header {
        background: var(--primary-color) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .action-panel {
        display: none;
    }

    .analysis-card:hover {
        transform: none;
    }

    .flow-step:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-white: #1a1a1a;
        --bg-light: #2d2d2d;
        --dark-color: #ffffff;
        --muted-color: #b0b0b0;
        --border-light: #404040;
        --border-medium: #505050;
    }

    /* Dark mode specific styling for muted quality values */
    .quality-value.text-muted {
        background: var(--bg-white); /* Consistent with light mode approach */
        color: var(--muted-color); /* Ensures proper contrast in dark mode */
        border: 1px solid var(--border-light);
    }

    /* Dark mode specific overrides for analysis card */
    .analysis-card .card-body {
        background: rgba(26, 26, 26, 0.95) !important;
        color: #ffffff !important;
    }

    .analysis-card .method-item {
        color: #ffffff !important;
        background: rgba(176, 176, 176, 0.1) !important;
    }

    .analysis-card .method-item strong {
        color: #cce7ff !important; /* Light blue for visibility */
    }

    .dashboard-container {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .analysis-card,
    .main-score-card,
    .score-breakdown-card,
    .stat-card,
    .overview-card,
    .block-card,
    .calculation-flow-card,
    .calculation-details-card {
        background: var(--bg-white);
        border-color: var(--border-light);
    }

    .score-circle::before {
        background: var(--bg-white);
    }

    .reasoning-type,
    .fallacy-item {
        background: var(--bg-light);
    }

    .calculation-accordion {
        background: var(--bg-white);
    }

    .calculation-row {
        background: var(--bg-light);
    }

    .calculation-row h6 {
        color: var(--dark-color);
    }

    .calculation-row code {
        background: var(--bg-white);
        color: var(--dark-color);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-light: #000000;
        --border-medium: #000000;
        --shadow-light: 0 2px 4px rgba(0,0,0,0.5);
        --shadow-medium: 0 4px 12px rgba(0,0,0,0.5);
    }

    .analysis-card,
    .main-score-card,
    .score-breakdown-card,
    .stat-card,
    .overview-card,
    .block-card {
        border: 2px solid var(--border-light);
    }

    .flow-step {
        border: 2px solid var(--border-light);
    }

    .block-card {
        border: 2px solid var(--border-light);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .score-circle {
        animation: none;
    }

    .flow-arrow {
        animation: none;
    }

    .analysis-card:hover,
    .flow-step:hover {
        transform: none;
    }
}

/* Focus Management */
.dashboard-container:focus-within {
    outline: none;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--dark-color);
    color: white;
    border-radius: 4px;
    z-index: 1000;
}

/* Score Grouping Styles */
.ai-scores-group {
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08), rgba(0, 123, 255, 0.04));
    border: 1px solid rgba(0, 123, 255, 0.15);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
    transition: all 0.3s ease;
}

.ai-scores-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
}

.user-scores-group {
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.08), rgba(23, 162, 184, 0.04));
    border: 1px solid rgba(23, 162, 184, 0.15);
    border-left: 4px solid var(--info-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.1);
    transition: all 0.3s ease;
}

.user-scores-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.15);
}

.ai-scores-group .badge,
.user-scores-group .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Group Labels */
.ai-scores-group > .badge.bg-light,
.user-scores-group > .badge.bg-light {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #495057 !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Score Badge Improvements */
.ai-scores-group .badge.bg-primary {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    border: none;
}

.ai-scores-group .badge.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.ai-scores-group .badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #212529 !important;
}

.ai-scores-group .badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.user-scores-group .badge.bg-info {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    border: none;
}

/* Enhanced score badge styling for lists */
.score-badge {
    font-weight: 600;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

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

/* Responsive adjustments for score groups */
@media (max-width: 768px) {
    .ai-scores-group,
    .user-scores-group {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .ai-scores-group .badge,
    .user-scores-group .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        margin-right: 0.3rem;
        margin-bottom: 0.3rem;
    }
}

/* Special styling for fallacy badges */
.fallacy-highlights .badge {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    margin: 0.2rem;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    transition: all 0.2s ease;
}

.fallacy-highlights .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(220, 53, 69, 0.4);
}

/* Truth score styling improvements */
.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    font-weight: 500;
    opacity: 0.8;
}

/* Score display improvements for small screens */
@media (max-width: 576px) {
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .ai-scores-group,
    .user-scores-group {
        padding: 0.5rem;
    }
}

/* Enhanced Focus Styles */
.btn:focus,
.nav-tab:focus,
.analysis-card:focus-within {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* High Contrast Focus */
@media (prefers-contrast: high) {
    .analysis-card {
        border: 2px solid var(--border-light);
    }

    .flow-step {
        border: 2px solid var(--border-light);
    }

    .block-card {
        border: 2px solid var(--border-light);
    }
}

/* Reduced Motion Focus */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .analysis-card:hover,
    .flow-step:hover {
        transform: none;
    }
}
