/**
 * Browse and Archive Styles
 */

/* Archive Header */
.aphrc-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #2271b1;
}

.archive-header h1 {
    font-size: 42px;
    margin-bottom: 15px;
    color: #1d2327;
}

.archive-stats {
    font-size: 18px;
    color: #646970;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #2271b1;
    display: inline-block;
    margin-right: 5px;
}

/* Filters */
.archive-filters {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 14px;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus,
.filter-select:focus {
    border-color: #2271b1;
    outline: none;
}

.search-input {
    width: 100%;
}

.search-group {
    grid-column: 1 / -1;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Active Filters */
.active-filters {
    background: #fff3cd;
    padding: 15px 20px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
    border-radius: 4px;
}

.filter-tag {
    display: inline-block;
    background: white;
    padding: 5px 12px;
    margin: 0 5px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid #ddd;
}

/* Results Count */
.results-count {
    padding: 15px 0;
    color: #646970;
    font-size: 16px;
    border-bottom: 2px solid #f0f0f1;
    margin-bottom: 30px;
}

/* Publications List */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.publication-item {
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    padding: 25px;
    transition: box-shadow 0.3s, transform 0.3s;
}

.publication-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.pub-title {
    margin: 0 0 15px 0;
    font-size: 20px;
}

.pub-title a {
    color: #2271b1;
    text-decoration: none;
}

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

.pub-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pub-meta span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.pub-type {
    background: #2271b1;
    color: white;
}

.pub-year {
    background: #f0f0f1;
    color: #1d2327;
}

.pub-authors {
    color: #646970;
    margin: 10px 0;
    font-size: 15px;
}

.pub-authors a {
    color: #2271b1;
    text-decoration: none;
}

.pub-authors a:hover {
    text-decoration: underline;
}

.pub-citation {
    color: #646970;
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0;
}

.pub-doi {
    font-size: 13px;
    margin-top: 10px;
}

.pub-doi a {
    color: #2271b1;
}

/* Authors Grid */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.authors-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.author-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: box-shadow 0.3s;
}

.authors-grid .author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.author-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.author-photo {
    flex-shrink: 0;
}

.author-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.authors-grid .author-photo img {
    width: 120px;
    height: 120px;
}

.author-info {
    flex: 1;
}

.author-name {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.author-name a {
    color: #1d2327;
    text-decoration: none;
}

.author-name a:hover {
    color: #2271b1;
}

.author-orcid {
    margin: 5px 0;
    font-size: 13px;
}

.author-orcid a {
    color: #2271b1;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.author-orcid img {
    vertical-align: middle;
}

.author-affiliations {
    color: #646970;
    font-size: 14px;
    margin: 8px 0;
}

.author-pubs-count {
    color: #646970;
    font-size: 13px;
    margin-top: 8px;
}

/* Alphabet Filter */
.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 30px;
    justify-content: center;
}

.letter-link {
    display: inline-block;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
    font-weight: 600;
    transition: all 0.3s;
}

.letter-link:hover,
.letter-link.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* Institutions List */
.institutions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.institution-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.institution-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.institution-name {
    margin: 0 0 12px 0;
    font-size: 18px;
}

.institution-name a {
    color: #1d2327;
    text-decoration: none;
}

.institution-name a:hover {
    color: #2271b1;
}

.institution-location,
.institution-ror,
.institution-excerpt {
    color: #646970;
    font-size: 14px;
    margin: 8px 0;
}

.institution-ror a {
    color: #2271b1;
}

/* Pagination */
.aphrc-pagination {
    margin-top: 40px;
    text-align: center;
}

.aphrc-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 5px;
}

.aphrc-pagination li {
    display: inline-block;
}

.aphrc-pagination a,
.aphrc-pagination span {
    display: inline-block;
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
    transition: all 0.3s;
}

.aphrc-pagination a:hover {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.aphrc-pagination .current {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
    font-weight: 600;
}

/* Search Page */
.aphrc-search-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-header {
    text-align: center;
    margin-bottom: 40px;
}

.search-form-main {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input-large {
    flex: 1;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.search-input-large:focus {
    border-color: #2271b1;
    outline: none;
}

.search-type-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.search-type-tabs label {
    padding: 10px 20px;
    background: #f0f0f1;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-type-tabs label:hover {
    background: #e0e0e1;
}

.search-type-tabs label.active {
    background: #2271b1;
    color: white;
}

.search-type-tabs input[type="radio"] {
    display: none;
}

.search-results {
    margin-top: 40px;
}

.search-results h2 {
    color: #2271b1;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
    margin: 30px 0 20px;
}

.search-results-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.search-result-item {
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: box-shadow 0.3s;
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-result-item h4 {
    margin: 0 0 8px 0;
}

.search-result-item h4 a {
    color: #2271b1;
    text-decoration: none;
}

.search-result-item h4 a:hover {
    text-decoration: underline;
}

.result-meta {
    color: #646970;
    font-size: 14px;
}

.view-all-link {
    text-align: right;
    margin-top: 15px;
}

.view-all-link a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-results p {
    font-size: 18px;
    color: #646970;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        justify-content: stretch;
    }
    
    .filter-actions button,
    .filter-actions a {
        flex: 1;
    }
    
    .authors-grid {
        grid-template-columns: 1fr;
    }
    
    .institutions-list {
        grid-template-columns: 1fr;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .alphabet-filter {
        gap: 5px;
    }
    
    .letter-link {
        padding: 6px 10px;
        font-size: 14px;
    }
}
