/* Results */
.results-header-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: 32px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-xl);
}

.results-title {
    font-size: 2.15rem;
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text-primary);
}

.results-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 500;
}

.db-updated-badge {
    font-size: 0.85em;
    opacity: 0.8;
    font-weight: normal;
    margin-left: var(--space-xs);
    color: var(--text-muted);
}

.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-select {
    padding: var(--space-xs) var(--space-xl) var(--space-xs) var(--space-md);
    border: 1px solid var(--color-ink-12);
    border-radius: var(--radius-sm);
    background: var(--bg-surface) url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23112217' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 16px center;
    outline: none;
    appearance: none;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    box-shadow: 0 1px 3px var(--color-ink-04);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    font-family: var(--font-display);
}

.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--color-accent-wash-2);
}

.filter-select-discipline {
    max-width: 260px;
    text-overflow: ellipsis;
}

.filter-reset-btn {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--color-ink-12);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-reset-btn:hover {
    background: var(--color-accent-wash-2);
    border-color: var(--accent);
}

.filter-reset-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.empty-results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
}

/* CFP Card (Light, Clean Academic) */
@keyframes cfpCardReveal {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cfp-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 1px 4px var(--color-ink-04), 0 4px 12px var(--color-ink-02);
}

.cfp-card.cfp-card--enter {
    opacity: 0;
    will-change: opacity, transform;
    animation: cfpCardReveal 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cfp-card:hover {
    box-shadow: 0 12px 28px var(--color-ink-08);
    border-color: var(--color-accent-border);
}

.cfp-card:active {
    transform: translateY(-1px) scale(0.995);
}

.cfp-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.cfp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    width: 100%;
}

.cfp-relevance {
    font-size: 0.78rem;
    font-weight: 600;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.cfp-relevance.high {
    background: var(--color-accent-wash-2);
    color: var(--color-accent-text);
    border: 1px solid var(--color-mint-pale);
}

.cfp-relevance.medium {
    background: var(--color-warning-wash);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.cfp-relevance.low {
    background: var(--color-paper-2);
    color: var(--color-ink-2);
    border: 1px solid var(--color-rule);
}

.cfp-publisher-tag {
    font-size: 0.74rem;
    letter-spacing: -0.01em;
    font-weight: 600;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    border: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.cfp-publisher-tag.elsevier,
.cfp-publisher-tag.Elsevier,
.cfp-publisher-tag[class*="elsevier" i] {
    background: transparent;
    color: var(--color-pub-elsevier);
    border: none;
}

.cfp-publisher-tag.taylor,
.cfp-publisher-tag.taylorandfrancis,
.cfp-publisher-tag.tandf,
.cfp-publisher-tag.Taylor,
.cfp-publisher-tag[class*="taylor" i],
.cfp-publisher-tag[class*="tandf" i] {
    background: transparent;
    color: var(--color-pub-tandf);
    border: none;
}

.cfp-publisher-tag.emerald,
.cfp-publisher-tag.Emerald,
.cfp-publisher-tag[class*="emerald" i] {
    background: transparent;
    color: var(--color-pub-emerald);
    border: none;
}

.cfp-publisher-tag.sage,
.cfp-publisher-tag.Sage,
.cfp-publisher-tag.SAGE,
.cfp-publisher-tag[class*="sage" i] {
    background: transparent;
    color: var(--color-warning);
    border: none;
}

.cfp-publisher-tag.springer,
.cfp-publisher-tag.nature,
.cfp-publisher-tag[class*="springer" i] {
    background: transparent;
    color: var(--color-pub-springer);
    border: none;
}

.cfp-publisher-tag.wiley,
.cfp-publisher-tag[class*="wiley" i] {
    background: transparent;
    color: var(--color-pub-wiley);
    border: none;
}

.cfp-publisher-tag.ieee,
.cfp-publisher-tag[class*="ieee" i] {
    background: transparent;
    color: var(--color-pub-ieee);
    border: none;
}

.cfp-journal {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.cfp-title {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-lg);
    flex: 1;
    color: var(--text-primary);
    font-family: var(--font-display);
    letter-spacing: -0.015em;
}

.cfp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.cfp-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.deadline-urgent {
    color: var(--color-danger);
    font-weight: 600;
}

.deadline-soon {
    color: var(--color-warning);
    font-weight: 600;
}

.cfp-actions {
    display: flex;
    gap: var(--space-xs);
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-md);
}

.cfp-save-btn,
.cfp-remind-btn {
    flex: 1;
    padding: var(--space-xs);
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    cursor: pointer;
    border: 1px solid var(--border-light);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    transition: background-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
}

.cfp-link-btn {
    flex: 1;
    padding: var(--space-xs);
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    cursor: pointer;
    border: 1px solid var(--color-rule-strong);
    background: var(--color-surface);
    color: var(--color-ink);
    transition: background-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
}

.cfp-save-btn:hover,
.cfp-remind-btn:hover,
.cfp-link-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.cfp-save-btn.saved {
    background: var(--accent);
    color: var(--color-surface);
    border-color: var(--accent);
}

.cfp-remind-btn.active {
    background: var(--color-paper) !important;
    color: var(--accent) !important;
    border-color: color-mix(in oklab, var(--color-accent) 45%, transparent) !important;
}

.cfp-remind-btn.active:hover {
    background: var(--color-paper-2) !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 72px var(--space-lg);
    background: var(--bg-surface);
    border: 1.5px dashed var(--color-ink-18);
    border-radius: var(--radius-xl);
}

.empty-state h2,
.empty-state h3 {
    margin: 0 auto var(--space-xs);
    font-size: 1.45rem;
    font-family: var(--font-display);
    color: var(--text-primary);
    text-align: center;
}

.empty-state p {
    margin: 0 auto var(--space-lg);
    color: var(--text-secondary);
    font-size: 1.02rem;
    max-width: 56ch;
    text-align: center;
}

/* Modal (Airy Light overlay) */
.modal-overlay {
    position: fixed;
    inset: 0;
    padding: var(--space-lg);
    background: color-mix(in oklab, var(--color-ink) 45%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - var(--space-2xl));
    overflow-y: auto;
    position: relative;
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transform: translateY(24px) scale(0.97);
    transition: background-color 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid var(--border-light);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 22px;
    right: 22px;
    background: var(--bg-subtle);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-publisher {
    margin-bottom: var(--space-xs);
}

.modal-journal-name {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    font-weight: 600;
}

.modal-cfp-title {
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 32px;
    color: var(--text-primary);
    font-family: var(--font-display);
    letter-spacing: -0.025em;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: 32px;
    padding: var(--space-lg);
    background: var(--bg-page);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.modal-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-xs);
    font-weight: 600;
}

.modal-detail-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-display);
}

.modal-topics-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-family: var(--font-display);
}

.modal-topics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: 32px;
}

.modal-topic-tag {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    background: var(--bg-page);
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid var(--border-light);
}

.modal-topic-tag.modal-matched {
    background: var(--color-accent-wash-2);
    color: var(--color-accent-text);
    font-weight: 600;
    border-color: var(--color-mint-pale);
}

.modal-description {
    margin-bottom: 32px;
    color: var(--text-primary);
}

.modal-description h4 {
    font-size: 1.05rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-display);
}

.modal-description p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    border-top: 1px solid var(--border-light);
    padding-top: 32px;
}

/* AI Match Reason on Cards */
.cfp-ai-reason {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: var(--space-xs) 0 var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-surface-tint);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-accent-wash-2);
    border: 1px solid var(--color-accent-border);
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
}

.cfp-ai-reason svg {
    flex-shrink: 0;
    margin-top: var(--space-3xs);
    color: var(--accent);
}


/* Modal AI Insight Section */
.modal-ai-insight {
    margin-bottom: 32px;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface-tint);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-accent-wash-2);
}

.modal-ai-insight h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-display);
}

.modal-ai-insight p {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

/* Live Loading Progress Banner */
.live-loading-banner {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    background: var(--color-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: 0 4px 16px var(--color-ink-04);
    transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.live-loading-banner.is-finishing {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.progress-status-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-accent) 70%, transparent);
    animation: pulseAccent 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    flex-shrink: 0;
}

@keyframes pulseAccent {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-accent) 70%, transparent);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 7px transparent;
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 transparent;
    }
}

.progress-metrics {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percentage {
    color: var(--accent);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.progress-metric-sep {
    opacity: 0.4;
    font-size: 0.75rem;
}

.progress-timer {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.progress-track-wrapper {
    width: 100%;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--color-ink-08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    will-change: transform;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-mint) 100%);
    border-radius: 999px;
    transition: background-color var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
    box-shadow: 0 0 8px var(--color-accent-border);
}

