/**
 * References Component Styles
 * External articles, news, and media that cite Epstein documents
 */

/* References View Container */
.references-view {
    padding: var(--space-4);
}

.references-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.references-header__info {
    font-size: var(--text-lg);
    color: var(--text-secondary);
}

.references-header__actions {
    display: flex;
    gap: var(--space-2);
}

/* References Table Columns */
.references-table .col-platform {
    width: 100px;
    white-space: nowrap;
}

.references-table .col-title {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.references-table .col-publisher {
    width: 150px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.references-table .col-date {
    width: 100px;
    white-space: nowrap;
}

.references-table .col-files,
.references-table .col-events {
    width: 60px;
    text-align: center;
}

.references-table .col-actions {
    width: 50px;
    text-align: center;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* References Grid (legacy, kept for cards if needed) */
.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
}

/* Reference Card */
.reference-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reference-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.reference-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.reference-card__platform {
    font-size: 1.25rem;
}

.reference-card__platform-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reference-card__title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-1);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reference-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.reference-card__publisher::after {
    content: '·';
    margin-left: var(--space-1);
}

.reference-card__stats {
    display: flex;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--accent);
    font-weight: 500;
}

/* Reference Detail View */
.reference-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-4);
}

.reference-detail__header {
    margin-bottom: var(--space-3);
}

.reference-detail__main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.reference-detail__platform {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
    color: var(--text-muted);
}

.reference-detail__icon {
    font-size: 1.25rem;
}

.reference-detail__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-2);
    line-height: 1.3;
}

.reference-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.reference-detail__meta > span::after {
    content: '·';
    margin-left: var(--space-2);
}

.reference-detail__meta > span:last-child::after {
    content: '';
}

.reference-detail__summary {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 var(--space-3);
}

.reference-detail__links {
    display: flex;
    gap: var(--space-2);
}

.reference-detail__files,
.reference-detail__events {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
}

.reference-detail__section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 var(--space-4);
    color: var(--text-primary);
}

/* Reference Files List */
.reference-files-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.reference-file-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

.reference-file-item:hover {
    background: var(--bg-hover);
}

.reference-file-item__thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.reference-file-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.reference-file-item__info {
    flex: 1;
    min-width: 0;
}

.reference-file-item__bates {
    font-weight: 600;
    color: var(--text-primary);
}

.reference-file-item__filename {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reference-file-item__meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.reference-file-item__relationship {
    flex-shrink: 0;
}

/* Reference Events List */
.reference-events-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.reference-event-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

.reference-event-item:hover {
    background: var(--bg-hover);
}

.reference-event-item__info {
    flex: 1;
    min-width: 0;
}

.reference-event-item__date {
    font-weight: 600;
    color: var(--accent);
    font-size: var(--text-sm);
}

.reference-event-item__title {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.reference-event-item__meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* File Detail References Section */
.file-references-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.file-reference-item {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.file-reference-item:hover {
    background: var(--bg-hover);
}

.file-reference-item__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.file-reference-item__content {
    flex: 1;
    min-width: 0;
}

.file-reference-item__title {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-reference-item__meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.file-reference-item__relationship {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--accent);
    margin-top: 4px;
}

.file-references-empty {
    color: var(--text-muted);
    font-style: italic;
    padding: var(--space-2) 0;
}

/* Pagination for References */
.references-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .references-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .references-header__actions {
        width: 100%;
    }

    .references-header__actions select {
        flex: 1;
    }

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

    /* Hide less important columns on mobile */
    .references-table .col-publisher,
    .references-table .col-events {
        display: none;
    }

    .references-table .col-title {
        max-width: 200px;
    }

    .reference-detail__links {
        flex-direction: column;
    }

    .reference-detail__links .btn {
        width: 100%;
        text-align: center;
    }

    .reference-file-item {
        flex-wrap: wrap;
    }

    .reference-file-item__relationship {
        width: 100%;
        margin-top: var(--space-1);
    }
}
