/* MSCA Digital Finance Network - Publications Page Styles */
/* Consistent with main portal styles */

:root {
    --mlpurple: #3333B2;
    --mlblue: #0066CC;
    --mllavender: #ADADE0;
    --mllavender2: #D6D6EF;
    --mllavender3: #E8E8F7;
    --mlorange: #FF7F0E;
    --mlgreen: #2CA02C;
    --mlred: #D62728;
    --mlgray: #666666;
    --text-dark: #1a1a1a;
    --text-light: #555555;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--mlpurple) 0%, var(--mlblue) 100%);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

.header-nav {
    margin-top: 0.75rem;
}

.header-nav a {
    color: white;
    opacity: 0.85;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: opacity 0.2s, background 0.2s;
}

.header-nav a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Stats Summary Bar */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 0.85rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card.highlight {
    background: var(--mllavender3);
    border-color: var(--mllavender);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mlpurple);
}

.stat-card.highlight .stat-value {
    color: var(--mlgreen);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Controls Section */
.controls-section {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group.search-group {
    flex: 1;
    min-width: 200px;
}

.control-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.search-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--mlblue);
}

.filter-select {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-width: 100px;
}

.filter-select:focus {
    border-color: var(--mlblue);
    outline: none;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-count {
    font-weight: 500;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: var(--mlblue);
    background: var(--mllavender3);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.download-btn:hover {
    background: var(--mllavender2);
}

/* Publications Table */
.publications-table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.publications-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.publications-table th {
    background: var(--mllavender3);
    padding: 0.7rem 0.6rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--mllavender);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.publications-table th:hover {
    background: var(--mllavender2);
}

.publications-table th.sortable::after {
    content: ' \2195';
    opacity: 0.4;
}

.publications-table th.sort-asc::after {
    content: ' \2191';
    opacity: 1;
}

.publications-table th.sort-desc::after {
    content: ' \2193';
    opacity: 1;
}

.publications-table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--mllavender3);
    vertical-align: top;
}

.publications-table tbody tr:hover {
    background: #fafbfc;
}

/* Column widths */
.col-title { min-width: 300px; max-width: 400px; }
.col-authors { min-width: 150px; max-width: 200px; }
.col-venue { min-width: 150px; max-width: 200px; }
.col-year { width: 60px; text-align: center; }
.col-citations { width: 70px; text-align: center; }
.col-access { width: 80px; text-align: center; }

/* Title cell */
.pub-title {
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.4;
}

.pub-title-link {
    color: var(--mlpurple);
    text-decoration: none;
}

.pub-title-link:hover {
    text-decoration: underline;
}

/* Authors */
.msca-authors {
    color: var(--text-light);
    font-size: 0.8rem;
}

.msca-author {
    color: var(--mlpurple);
    font-weight: 500;
}

.msca-count-badge {
    display: inline-block;
    background: var(--mllavender3);
    color: var(--mlpurple);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

/* Venue */
.pub-venue {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Type badge */
.pub-type {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    background: var(--mllavender3);
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Year */
.pub-year {
    font-weight: 600;
    color: var(--mlpurple);
}

/* Citations */
.pub-citations {
    font-weight: 600;
    color: var(--mlorange);
}

/* Open Access */
.oa-badge {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

.oa-badge.oa-yes {
    background: #e8f5e9;
    color: var(--mlgreen);
}

.oa-badge.oa-no {
    background: #fafafa;
    color: var(--mlgray);
}

.oa-badge a {
    color: inherit;
    text-decoration: none;
}

.oa-badge a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--mllavender3);
    border-color: var(--mllavender);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--mlpurple);
    color: white;
    border-color: var(--mlpurple);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0.5rem;
}

.per-page-select {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.25rem;
    margin-top: 1.5rem;
    background: var(--mllavender3);
    color: var(--text-light);
    font-size: 0.8rem;
}

.footer-note {
    margin-top: 0.4rem;
    font-size: 0.7rem;
}

.footer a {
    color: var(--mlblue);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--mlgray);
}

/* No results */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--mlgray);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
    }

    .publications-table {
        font-size: 0.8rem;
    }

    .col-title { min-width: 200px; }
    .col-authors { min-width: 120px; }
    .col-venue { min-width: 120px; }

    .pagination {
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }

    .stat-card {
        padding: 0.6rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .publications-table th,
    .publications-table td {
        padding: 0.4rem;
    }
}
