/* Sentiment Report Styles */

.sentiment-report {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    font-family: var(--font-family, system-ui, -apple-system, sans-serif);
}

.sentiment-report h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.report-subtitle {
    color: #666;
    margin-bottom: 2rem;
}

/* Controls */
.report-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.control-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 200px;
}

/* Summary Cards */
.report-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 180px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.strength-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Strength coloring */
.strength-negative .stat-value,
td.strength-negative { color: #e53e3e; }
.strength-positive .stat-value,
td.strength-positive { color: #38a169; }
.strength-neutral .stat-value,
td.strength-neutral { color: #d69e2e; }

/* Category bars */
.report-section {
    margin-bottom: 2rem;
}

.report-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.category-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-label {
    width: 120px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bar-fill.cat-complaint { background: #e53e3e; }
.bar-fill.cat-praise { background: #38a169; }
.bar-fill.cat-neutral { background: #d69e2e; }

.cat-complaint { color: #e53e3e; }
.cat-praise { color: #38a169; }
.cat-neutral { color: #d69e2e; }

.bar-count {
    width: 40px;
    text-align: right;
    font-weight: 600;
}

/* Source chips */
.source-chips {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.source-chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.source-web { background: #ebf8ff; color: #2b6cb0; }
.source-human { background: #f0fff4; color: #276749; }
.source-sample { background: #fefcbf; color: #975a16; }

/* Entries table */
.entries-table-wrapper {
    overflow-x: auto;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.entries-table th,
.entries-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.entries-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.entries-table tbody tr:hover {
    background: #f8f9fa;
}

.summary-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.corroboration-badge {
    margin-left: 0.25rem;
    cursor: help;
}

/* States */
.loading, .no-data {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 1.1rem;
}

/* Clickable rows */
.entry-row {
    cursor: pointer;
    transition: background 0.15s;
}
.entry-row:hover {
    background: rgba(49, 130, 206, 0.06);
}

/* Detail popup overlay */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

.detail-dialog {
    background: var(--surface, #fff);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.2s ease;
}

.detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #999;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.detail-close:hover {
    background: #f0f0f0;
    color: #333;
}

.detail-dialog h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    padding-right: 2rem;
}

.detail-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.detail-field {
    margin-bottom: 1.25rem;
}

.detail-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    margin-bottom: 0.3rem;
}

.detail-field p {
    margin: 0;
    line-height: 1.6;
    word-break: break-word;
}

.detail-field a {
    color: var(--primary, #3182ce);
    text-decoration: none;
}
.detail-field a:hover {
    text-decoration: underline;
}

.detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
