/**
 * Event Comparison & Cross-Source Analysis Styles
 * Phase 3.3: Comparison Views & UI
 */

/* ========================================================================
   EVENT LIST PAGE
   ======================================================================== */

.event-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

/* Filters */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.filter-group label {
    font-weight: bold;
    color: #333;
}

.filter-group select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.event-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.event-header {
    margin-bottom: 15px;
}

.event-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.event-title a {
    color: #2c3e50;
    text-decoration: none;
}

.event-title a:hover {
    color: #667eea;
}

.event-date {
    color: #666;
    font-size: 0.9rem;
}

.event-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
}

.meta-item .icon {
    font-size: 1.1rem;
}

.event-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.event-entities {
    margin-bottom: 15px;
}

.entity-group {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.entity-tag {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    margin-right: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.event-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* ========================================================================
   EVENT DETAIL PAGE
   ======================================================================== */

.event-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb span {
    color: #999;
    margin: 0 8px;
}

.event-detail-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-title {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.event-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
    font-size: 0.95rem;
}

.event-description-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.event-description-box h3 {
    margin-bottom: 10px;
    color: #333;
}

/* Entities Section */
.entities-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.entity-column h4 {
    color: #555;
    margin-bottom: 10px;
    font-size: 1rem;
}

.entity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
}

.entity-tag.people {
    background: #f3e5f5;
    color: #7b1fa2;
}

.entity-tag.org {
    background: #e8f5e9;
    color: #388e3c;
}

.entity-tag.location {
    background: #fff3e0;
    color: #f57c00;
}

/* Diversity Section */
.diversity-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stance-distribution {
    margin-top: 15px;
}

.stance-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.stance-label {
    min-width: 120px;
    font-weight: 500;
    color: #555;
}

.stance-progress {
    flex: 1;
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    height: 30px;
}

.stance-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    transition: width 0.3s;
}

.stance-left { background: #1976d2; }
.stance-center-left { background: #42a5f5; }
.stance-center { background: #9e9e9e; }
.stance-center-right { background: #ff9800; }
.stance-right { background: #f44336; }
.stance-unknown { background: #757575; }

/* View Mode Selector */
.view-mode-selector {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #e0e0e0;
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

/* Narratives Section */
.narratives-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Timeline View */
.timeline-view {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

.timeline-view::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ddd;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -26px;
    top: 8px;
    width: 14px;
    height: 14px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #667eea;
}

.timeline-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

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

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

.source-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.narrative-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.confidence {
    background: #e8f5e9;
    color: #388e3c;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.narrative-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.narrative-title a {
    color: #2c3e50;
    text-decoration: none;
}

.narrative-title a:hover {
    color: #667eea;
}

.narrative-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.narrative-actions {
    text-align: right;
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Grid View */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.narrative-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.narrative-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.source-badge-large {
    background: #667eea;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
}

.confidence-badge {
    background: #e8f5e9;
    color: #388e3c;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.85rem;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-title a {
    color: #2c3e50;
    text-decoration: none;
}

.card-excerpt {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.timestamp {
    color: #999;
    font-size: 0.85rem;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

/* ========================================================================
   SIDE-BY-SIDE COMPARISON
   ======================================================================== */

.comparison-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.comparison-header {
    text-align: center;
    margin-bottom: 30px;
}

.comparison-header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

.comparison-header .subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Narrative Selector */
.narrative-selector {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.narrative-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.narrative-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.narrative-checkbox:hover {
    background: #e9ecef;
}

.narrative-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label {
    flex: 1;
}

.checkbox-label .confidence {
    color: #666;
    font-size: 0.9rem;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.comparison-column {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.source-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.source-name {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.source-meta .meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.meta-row .label {
    opacity: 0.9;
}

.meta-row .value {
    font-weight: 500;
}

.article-section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.article-section:last-child {
    border-bottom: none;
}

.section-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-title a {
    color: #2c3e50;
    text-decoration: none;
}

.article-content {
    color: #555;
    line-height: 1.8;
    font-size: 0.95rem;
}

/* Match Criteria */
.match-criteria {
    font-size: 0.9rem;
}

.criterion-bar {
    margin-bottom: 12px;
}

.criterion-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.criterion-progress {
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 24px;
}

.criterion-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    transition: width 0.3s;
}

.article-actions {
    padding: 20px;
    text-align: center;
}

/* Analysis Section */
.analysis-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

.analysis-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.analysis-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.analysis-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
}

.analysis-content {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.length-bar {
    margin-bottom: 12px;
}

.bar-label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.bar-container {
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    height: 28px;
}

.bar-fill {
    background: #667eea;
    color: white;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: width 0.3s;
}

.timeline-entry {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.timeline-entry:last-child {
    border-bottom: none;
}

.badge-first {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* ========================================================================
   SOURCE DIVERSITY DASHBOARD
   ======================================================================== */

.diversity-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 3rem;
}

.stat-content {
    flex: 1;
}

.stat-box .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-box .stat-label {
    color: #666;
    font-size: 0.95rem;
}

/* Chart Section */
.chart-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-section h2 {
    margin-bottom: 25px;
    color: #2c3e50;
}

.stance-chart {
    max-width: 800px;
    margin: 0 auto;
}

.stance-row {
    display: grid;
    grid-template-columns: 150px 1fr 80px;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.stance-label-wide {
    font-weight: 500;
    color: #333;
}

.stance-bar-container {
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    height: 35px;
}

.stance-bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 15px;
    transition: width 0.4s;
}

.bar-text {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.stance-percentage {
    text-align: right;
    font-weight: bold;
    color: #667eea;
}

/* Events Table */
.events-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-description {
    color: #666;
    margin-bottom: 20px;
}

.diverse-events-table {
    overflow-x: auto;
}

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

.diverse-events-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.diverse-events-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #eee;
}

.event-cell a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.event-cell a:hover {
    color: #667eea;
}

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

.badge-sources {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-narratives {
    background: #f3e5f5;
    color: #7b1fa2;
}

.diversity-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-bar {
    flex: 1;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 20px;
}

.score-fill {
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    height: 100%;
    transition: width 0.3s;
}

.score-text {
    font-weight: bold;
    color: #4caf50;
    min-width: 40px;
}

.btn-link-small {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Insights Section */
.insights-section {
    margin-bottom: 40px;
}

.insights-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.insight-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.insight-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.insight-card h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 12px;
}

.insight-card p {
    color: #666;
    line-height: 1.6;
}

/* ========================================================================
   PAGINATION
   ======================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.page-link {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #667eea;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    background: #667eea;
    color: white;
}

.page-info {
    color: #666;
    font-weight: 500;
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .narrative-checkboxes {
        grid-template-columns: 1fr;
    }

    .stance-row {
        grid-template-columns: 100px 1fr 60px;
        font-size: 0.9rem;
    }
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */

.empty-comparison {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

