/* ===== PAPER DETAIL PAGE – CLEAN WHITE THEME ===== */

/* 1. Background: hero image as subtle watermark */
body {
    background-image: url('/static/images/Home_images/paper_detail_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #f5f7fa;   /* soft light grey fallback */
    position: relative;
}

/* Very light overlay – allows the image to be faintly visible */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0);   /* almost white, lets image peek through */
    z-index: 0;
    pointer-events: none;
}

/* 2. Card container – white, with elevation */
.paper-detail-container {
    position: relative;
    z-index: 1;
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.paper-detail-card {
    background: #ffffff;          /* pure white */
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* 3. Image – top left, no extra spacing */
.paper-detail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.paper-detail-image {
    flex: 0 0 40%;
    max-width: 30%;
    min-height: auto;
    background: #f0f3f8;          /* very light gray for placeholder */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.paper-detail-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Placeholder fallback */
.paper-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 1.2rem;
    text-align: center;
}

.paper-image-placeholder i {
    margin-bottom: 0.5rem;
    color: #ccc;
}

/* 4. Content – dark text */
.paper-detail-content {
    flex: 1;
    padding: 2.5rem 3rem;
    box-sizing: border-box;
}

.paper-detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a1a;            /* near black */
    line-height: 1.2;
}

.paper-detail-authors,
.paper-detail-journal {
    font-size: 1rem;
    color: #3a3a3a;            /* dark grey */
    margin-bottom: 0.25rem;
}

.paper-detail-abstract {
    margin: 1.8rem 0;
}

.paper-detail-abstract h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

.paper-detail-abstract p {
    font-size: 1rem;
    line-height: 1.7;
    color: #333333;            /* readable dark grey */
}

/* 5. Buttons – accent colors */
.paper-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.paper-detail-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #70B5FF, #8670FF);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.paper-detail-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(112, 181, 255, 0.4);
    text-decoration: none;
    color: #fff;
}

.paper-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: transparent;
    color: #555;
    border: 2px solid #ddd;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.paper-detail-back:hover {
    background: #f0f0f0;
    border-color: #bbb;
    color: #1a1a1a;
    text-decoration: none;
}

/* 6. Hide navbar and hero */
body.paper-page .navbar,
body.paper-page .hero {
    display: none !important;
}

/* Optional: adjust top padding after hiding */
body.paper-page .paper-detail-container {
    padding-top: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .paper-detail-row {
        flex-direction: column;
    }
    .paper-detail-image {
        flex: 0 0 auto;
        max-width: 100%;
        padding: 1rem;
    }
    .paper-detail-content {
        padding: 1.8rem;
    }
    .paper-detail-title {
        font-size: 1.5rem;
    }
    .paper-detail-actions {
        flex-direction: column;
    }
    .paper-detail-button,
    .paper-detail-back {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .paper-detail-container {
        padding: 1.5rem 0.8rem;
    }
    .paper-detail-content {
        padding: 1.2rem;
    }
    .paper-detail-title {
        font-size: 1.2rem;
    }
}

/* === Meta panel (right side) === */
.paper-detail-meta {
    flex: 0 0 28%;
    max-width: 28%;
    padding: 2rem 1.5rem;
    background: #f8fafc;
    border-left: 1px solid #eef2f6;
    box-sizing: border-box;
}

.meta-list li {
    padding: 0.3rem 0;
    font-size: 0.9rem;
    word-break: break-all;
    overflow-wrap: break-word;
    color: #333;
}
.meta-list li {
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: #333;
}
.meta-list li i {
    width: 1.2rem;
    color: #70B5FF;
}
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.keyword-tag {
    background: #e9edf2;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #1a1a1a;
}
.cite-button {
    background: #70B5FF;
    color: #fff;
    border: none;
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
}
.bibtex-code {
    background: #f0f0f0;
    padding: 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}
.copy-button {
    margin-top: 0.5rem;
    padding: 0.2rem 1rem;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* === Related papers section === */
.paper-detail-related {
    padding: 2rem 3rem;
    border-top: 1px solid #eef2f6;
}
.paper-detail-related h3 {
    margin-bottom: 1rem;
    color: #1a1a1a;
}
.related-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.related-item {
    flex: 1 1 200px;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}
.related-item h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}
.related-item h4 a {
    color: #1a1a1a;
    text-decoration: none;
}
.related-item h4 a:hover {
    color: #70B5FF;
    text-decoration: underline;
}
.related-item p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .paper-detail-meta {
        flex: 0 0 100%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid #eef2f6;
        padding: 1.5rem;
    }
    .paper-detail-image {
        flex: 0 0 30%;
        max-width: 30%;
    }
    .paper-detail-content {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .paper-detail-image {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .paper-detail-content {
        padding: 1.5rem;
    }
    .paper-detail-related {
        padding: 1.5rem;
    }
}