/* ================================================
   Author & Lab Analysis Page Styles
   ================================================ */

.analysis-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 60vh;
}

.analysis-header {
    text-align: center;
    margin-bottom: 24px;
}

.analysis-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.analysis-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto;
}

/* The display rules below would otherwise override the hidden attribute */
.an-examples[hidden],
.an-results[hidden] {
    display: none;
}

/* Author picker */
.an-picker {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

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

.an-input-wrap {
    position: relative;
    max-width: 520px;
}

.an-input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    padding: 0 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.an-input:focus {
    outline: 2px solid var(--primary-light);
    border-color: var(--primary);
}

.an-input:disabled {
    background: var(--bg-gray);
}

.an-suggestions {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: 46px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.an-suggestion {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}

.an-suggestion:hover,
.an-suggestion.active {
    background: var(--primary-bg);
}

.an-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.an-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 14px;
}

.an-chip-remove {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
    color: var(--text-secondary);
}

.an-chip-remove:hover {
    color: var(--text-primary);
}

.an-status {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.an-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.an-example {
    border: 1px solid var(--primary-light);
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
}

.an-example:hover {
    background: var(--primary);
    color: white;
}

/* Names */
.an-name-tag {
    margin-left: 4px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.an-swatch {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
}

.an-count,
.an-meta {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

/* Result cards */
.an-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.an-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.an-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.an-hint {
    margin: -6px 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.an-chart {
    position: relative;
    height: 300px;
}

.an-details {
    margin-top: 12px;
    font-size: 14px;
}

.an-details summary {
    cursor: pointer;
    color: var(--primary-dark);
}

/* Tables */
.an-table-wrap {
    overflow-x: auto;
}

.an-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.an-table th,
.an-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.an-table thead th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
}

.an-table tbody th {
    font-weight: 500;
    color: var(--text-secondary);
}

.an-table td {
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.an-table td.an-max {
    font-weight: 700;
}

/* Co-authors and papers */
.an-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.an-column-title {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.an-list {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
}

.an-list li {
    margin-bottom: 6px;
}

.an-list li .an-count,
.an-list li .an-meta {
    margin-left: 6px;
}

.an-papers {
    list-style: none;
    padding-left: 0;
}

.an-papers a {
    color: var(--text-primary);
    text-decoration: none;
}

.an-papers a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.an-papers .an-meta {
    display: block;
    margin-left: 0;
}

.an-link-btn {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--primary-dark);
    cursor: pointer;
    text-align: left;
}

.an-link-btn:hover:not(:disabled) {
    text-decoration: underline;
}

.an-link-btn:disabled {
    color: var(--text-primary);
    cursor: default;
}

.an-shared {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
}

.an-shared p {
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .analysis-content {
        padding: 16px;
    }
    .analysis-title {
        font-size: 22px;
    }
    .an-picker,
    .an-card {
        padding: 14px;
    }
    .an-chart {
        height: 240px;
    }
}
