/* --- Analysis View --- */
.view--analysis {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.analysis-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--bg-1);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.analysis-tabs::-webkit-scrollbar {
    display: none;
}

.analysis-tab {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
    position: relative;
}

.analysis-tab:hover {
    color: var(--text-primary);
    background: var(--bg-2);
}

.analysis-tab.active {
    color: var(--text-primary);
    background: var(--bg-2);
    border-color: var(--accent);
}

.analysis-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-lg);
}

/* --- Analysis Panels --- */
.analysis-panel {
    max-width: 900px;
    margin: 0 auto;
}

.analysis-section {
    margin-bottom: var(--space-2xl);
}

.analysis-section__title {
    font-family: var(--font-headline);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.analysis-section__subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* Stats row */
.stats-row {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

.stat-card {
    flex: 1;
    min-width: 120px;
    padding: var(--space-lg);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-card__value {
    font-family: var(--font-headline);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card__label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* Topic bar */
.topic-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.topic-bar__name {
    font-weight: 600;
    font-size: 14px;
    min-width: 100px;
}

.topic-bar__bar {
    flex: 1;
    height: 24px;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
}

.topic-bar__segment {
    height: 100%;
    transition: width var(--transition-normal);
}

.topic-bar__count {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: right;
}

/* Absence table */
.absence-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.absence-item.significance-high {
    border-left: 4px solid var(--alert);
    background: var(--alert-bg);
}

.absence-item.significance-medium {
    border-left: 4px solid var(--warning);
    background: var(--warning-bg);
}

.absence-item.significance-low {
    border-left: 4px solid var(--text-tertiary);
}

.absence-item__source {
    font-weight: 600;
    font-size: 14px;
    min-width: 120px;
}

.absence-item__topic {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.absence-item__level {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

/* Topic timeline */
.topic-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.topic-timeline__row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.topic-timeline__source {
    font-size: 13px;
    font-weight: 500;
    min-width: 100px;
}

.topic-timeline__bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-2);
    border-radius: 4px;
    position: relative;
}

.topic-timeline__bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 4px;
}

.topic-timeline__dot {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--bg-0);
}

.topic-timeline__time {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: right;
}

/* Trend arrows */
.trend-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.trend-item__name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.trend-item__arrow {
    font-size: 18px;
    font-weight: 700;
}

.trend-item__arrow.up {
    color: var(--success);
}

.trend-item__arrow.down {
    color: var(--alert);
}

.trend-item__arrow.stable {
    color: var(--text-tertiary);
}

.trend-item__change {
    font-size: 13px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.trend-item__label {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.trend-item__label.new {
    background: var(--success-bg);
    color: var(--success);
}

.trend-item__label.gone {
    background: var(--alert-bg);
    color: var(--alert);
}

/* Empty state */
.analysis-empty {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-secondary);
}

.analysis-empty i {
    font-size: 48px;
    margin-bottom: var(--space-lg);
    color: var(--text-tertiary);
    display: block;
}
