/* Modern CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E2725B;
    --primary-hover: #D4624A;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo svg {
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-outline {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

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

.btn-primary,
.btn-outline {
    text-decoration: none;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
    justify-content: center;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Main Content */
.main {
    padding: 48px 0;
}

/* Hero Section */
.hero {
    margin-bottom: 32px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

/* Stats Card */
.stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

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

.stats-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-badge.ready {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.stats-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.card-header {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

.card-dots {
    display: flex;
    gap: 6px;
}

.card-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
}

.card-dots span:nth-child(1) { background: #ef4444; }
.card-dots span:nth-child(2) { background: #f59e0b; }
.card-dots span:nth-child(3) { background: #10b981; }

.card-content {
    padding: 48px 32px;
    text-align: center;
}

.fact-check-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #E88A75);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-md);
}

.card-content p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

.analysis-section,
.upload-section {
    margin-bottom: 64px;
}

/* Cards */
.analysis-card,
.upload-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.textarea-input,
.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.textarea-input:focus,
.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(226, 114, 91, 0.1);
}

.textarea-input {
    resize: vertical;
    min-height: 120px;
}

.date-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Results */
.result-container,
.results-container {
    margin-top: 24px;
}

.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.result-claim {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.5;
}

.verdict-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.verdict-badge.consistent {
    background: #d1fae5;
    color: #065f46;
}

.verdict-badge.inconsistent {
    background: #fee2e2;
    color: #991b1b;
}

.result-explanation {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.explanation-header svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.explanation-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 15px;
}

.explanation-content .source-ref {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.sources-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

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

.sources-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sources-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.source-names-summary {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.source-names-summary strong {
    color: var(--text-primary);
    margin-right: 8px;
}

.source-name-tag {
    display: inline-block;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    margin-right: 4px;
}

.source-name-more {
    color: var(--text-secondary);
    font-style: italic;
}

.source-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.source-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.source-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.source-index {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.source-title-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
}

.source-domain {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 500;
}

.source-badges-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-trust-reliable {
    background: #d1fae5;
    color: #065f46;
}

.badge-trust-unreliable {
    background: #fee2e2;
    color: #991b1b;
}

.badge-trust-mixed {
    background: #fef3c7;
    color: #92400e;
}

.badge-source-list {
    background: #dbeafe;
    color: #1e40af;
}

.badge-source-llm {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-confidence {
    background: #f3f4f6;
    color: #4b5563;
    font-weight: 500;
}

.result-card.compact {
    padding: 20px 20px 18px 20px;
    gap: 16px;
    background: #ffffff;
    border-radius: var(--radius-lg);
}

.result-feedback {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.result-header.compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.verdict-pill {
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 4px 0 10px 0;
}

.metric-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    border: 1px solid var(--border-color);
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 20px;
    font-weight: 600;
}

.result-explanation.compact {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    padding: 16px;
}

.explanation-header.small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.explanation-lede {
    margin: 12px 0 0 0;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.explanation-details summary {
    cursor: pointer;
    color: var(--primary-color);
    font-size: 13px;
    margin-top: 8px;
}

.sources-section.compact {
    border-top: none;
    padding-top: 12px;
}

.sources-header.compact {
    border-bottom: none;
    margin-bottom: 8px;
}

.source-list-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.source-row {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: #fff;
}

.source-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-index-pill {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 32px;
}

.source-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.source-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.badge-compact {
    font-size: 11px;
    text-transform: none;
    padding: 4px 8px;
}

.badge-cited {
    background: #dcfce7;
    color: #166534;
}

.source-open-link {
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary-color);
}

.source-details summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--primary-color);
}

.source-preview-line {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.empty-sources {
    text-align: center;
    padding: 16px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
}

.weight-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.weight-pill.high {
    background: #d1fae5;
    color: #166534;
}

.weight-pill.medium {
    background: #fef3c7;
    color: #92400e;
}

.weight-pill.low {
    background: #fee2e2;
    color: #991b1b;
}

.weight-pill.neutral {
    background: #e5e7eb;
    color: #374151;
}

.badge-effective-weight {
    background: #e0f2fe;
    color: #075985;
    font-weight: 600;
}

.source-reasoning {
    margin: 16px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #e9d5ff;
    border-left: 4px solid #8b5cf6;
    border-radius: var(--radius-md);
}

.reasoning-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b21a8;
}

.reasoning-header svg {
    flex-shrink: 0;
}

.reasoning-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: normal;
}

.source-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 12px 0 8px 0;
    display: flex;
    gap: 6px;
}

.meta-label {
    font-weight: 600;
    color: var(--text-primary);
}

.source-url {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    width: fit-content;
}

.source-url:hover {
    color: var(--primary-hover);
    background: var(--bg-tertiary);
    transform: translateX(2px);
}

.source-url svg {
    flex-shrink: 0;
}

.source-preview {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.7;
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-color);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    margin-bottom: 24px;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.upload-area svg {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.file-format {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Courier New', monospace;
    margin-top: 8px;
}

.file-info {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    border-left: 4px solid var(--error-color);
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 64px 0;
    margin-top: 64px;
}

.footer-content {
    text-align: center;
}

.footer-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.footer-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.footer-feature {
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.footer-feature h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.footer-feature p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .nav {
        display: none;
    }
    
    .stats-body {
        grid-template-columns: 1fr;
    }
    
    .footer-features {
        grid-template-columns: 1fr;
    }
    
    .analysis-card,
    .upload-card {
        padding: 24px;
    }
}

/* Features Section */
.features-section {
    margin: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.feature-icon-large {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

/* How It Works Section */
.how-it-works {
    margin: 0;
    padding: 48px 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.step-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

/* Responsive updates */
@media (max-width: 768px) {
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .how-it-works {
        padding: 48px 24px;
    }
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Referenced source highlighting */
.source-referenced {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(to right, rgba(226, 114, 91, 0.05), var(--bg-primary));
}

.source-referenced:hover {
    border-left-color: var(--primary-hover);
}

.cited-badge {
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}


/* ========================================
   Progress Timeline Styles
   ======================================== */

/* Progress Container */
.progress-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Horizontal Stages Bar */
.stages-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f3f4f6;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
}

/* Stage Badge (Number) */
.stage-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #d1d5db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

/* Stage Label */
.stage-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    line-height: 1.2;
}

/* Arrow Between Stages */
.stage-arrow {
    color: #d1d5db;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Stage States */
.stage-item.completed {
    background: #f0fdf4;
    border: 1px solid #10b981;
}

.stage-item.completed .stage-badge {
    background: #10b981;
    color: transparent; /* Hide the number when showing checkmark */
}

.stage-item.completed .stage-badge::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.stage-item.completed .stage-label {
    color: #059669;
    font-weight: 600;
}

.stage-item.active {
    background: #fef2f0;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(226, 114, 91, 0.1);
}

.stage-item.active .stage-badge {
    background: var(--primary-color);
    animation: pulse-badge 2s infinite;
}

.stage-item.active .stage-label {
    color: var(--primary-color);
    font-weight: 600;
}

@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(226, 114, 91, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(226, 114, 91, 0);
    }
}

/* Activity Feed */
.activity-feed {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    min-height: 120px;
}

.activity-header {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.activity-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.activity-message {
    font-size: 14px;
    color: #6b7280;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .stages-bar {
        flex-direction: column;
    }

    .stage-arrow {
        transform: rotate(90deg);
    }
    
    .stage-item {
        width: 100%;
    }
}
