/* Papers Section Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
    color: #000;
    background: #F5F5EA;
}

/* Viewer Layout */
.viewer-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Viewer Header */
.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}

.viewer-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

.paper-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.viewer-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.version-select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.version-select option {
    background: #2c3e50;
    color: #fff;
}

.share-btn, .download-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.share-btn:hover, .download-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Version Banner */
.version-banner {
    background: #fff3cd;
    color: #856404;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.version-banner a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
}

.version-banner a:hover {
    text-decoration: underline;
}

.version-banner.hidden {
    display: none;
}

/* PDF Container */
.pdf-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #525659;
}

.pdf-embed {
    flex: 1;
    width: 100%;
    border: none;
}

/* Fallback for mobile/unsupported */
.pdf-fallback {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: #F5F5EA;
}

.pdf-fallback h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.pdf-fallback p {
    margin-bottom: 1.5rem;
    color: #666;
}

.pdf-fallback .download-link {
    display: inline-block;
    background: #2c3e50;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.pdf-fallback .download-link:hover {
    background: #34495e;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2c3e50;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Index Page Styles */
.index-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.index-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ddd;
}

.index-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.index-header .subtitle {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.index-header .byline {
    font-size: 0.9rem;
    color: #888;
}

.index-header .byline a {
    color: inherit;
    text-decoration: none;
}

.index-header .byline a:hover {
    text-decoration: underline;
}

/* Paper List */
.papers-list {
    list-style: none;
}

.paper-item {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.paper-item:last-child {
    border-bottom: none;
}

.paper-item h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.paper-item h2 a {
    color: #333;
    text-decoration: none;
}

.paper-item h2 a:hover {
    text-decoration: underline;
}

.paper-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.paper-meta .version {
    background: #d4edda;
    color: #155724;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}

.paper-meta .date {
    color: #888;
}

.paper-abstract {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1rem;
}

.paper-links {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.paper-links a {
    color: #0066cc;
    text-decoration: none;
}

.paper-links a:hover {
    text-decoration: underline;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem;
}

.error-state h2 {
    color: #dc3545;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .viewer-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .viewer-header-left,
    .viewer-header-right {
        width: 100%;
        justify-content: center;
    }

    .paper-title {
        font-size: 1rem;
        text-align: center;
    }

    .index-container {
        padding: 1rem;
    }

    .index-header h1 {
        font-size: 1.5rem;
    }
}
