/* Papers Page Styles */
:root {
    --primary-green: #10B981;
    --primary-blue: #3B82F6;
    --primary-amber: #F59E0B;
    --primary-purple: #8B5CF6;
    --primary-red: #EF4444;
    --primary-gray: #6B7280;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --text-dark: #111827;
    --text-gray: #6B7280;
    --border-light: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

/* Navigation */
.papers-nav {
    background: linear-gradient(135deg, #1E3A5F 0%, #2D5A87 100%);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-stats {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    background: var(--bg-white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 60px;
    z-index: 90;
}

.filters-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-gray);
    font-size: 0.875rem;
}

.filter-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

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

.clear-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.clear-btn:hover {
    background: var(--border-light);
}

/* Papers Main */
.papers-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 300px);
}

.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Paper Card */
.paper-card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.paper-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.paper-card-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.paper-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-authors {
    font-size: 0.875rem;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-card-body {
    padding: 1rem 1.25rem;
    flex: 1;
}

.paper-abstract {
    font-size: 0.875rem;
    color: var(--text-gray);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-card-footer {
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.paper-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.paper-tag {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-pillar {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-green);
}

.tag-domain {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
}

.tag-topic {
    background: rgba(245, 158, 11, 0.1);
    color: var(--primary-amber);
}

.tag-year {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-gray);
}

.paper-links {
    display: flex;
    gap: 0.5rem;
}

.paper-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-gray);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border: 1px solid var(--border-light);
}

.paper-link:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-gray);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Modal Styles */
.paper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.paper-modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.paper-modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    margin: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-gray);
    transition: background-color 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: var(--border-light);
}

#modal-body {
    padding: 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.modal-authors {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.modal-abstract {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.modal-taxonomy {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.taxonomy-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
}

.taxonomy-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.taxonomy-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.modal-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.modal-link-btn.primary {
    background: var(--primary-blue);
    color: white;
}

.modal-link-btn.secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.modal-link-btn.arxiv {
    background: #B31B1B;
    color: white;
}

.modal-link-btn.semantic {
    background: #1857B6;
    color: white;
}

.modal-link-btn.acl {
    background: #005A9C;
    color: white;
}

.modal-citation {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: var(--border-light);
}

/* Footer */
.papers-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 2rem;
    text-align: center;
    color: var(--text-gray);
}

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

.papers-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .papers-nav {
        padding: 1rem;
    }
    
    .nav-title {
        display: none;
    }
    
    .filters-section {
        padding: 1rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        flex: 1;
    }
    
    .papers-grid {
        grid-template-columns: 1fr;
    }
    
    .paper-modal {
        padding: 1rem;
    }
    
    .modal-taxonomy {
        grid-template-columns: 1fr 1fr;
    }
}
