@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0f172a; /* Slate 900 */
    --academic-green: #1b4d3e; /* Deep Forest Green */
    --accent-green: #2d6a4f; /* Forest Green Medium */
    --accent-hover: #40916c; /* Forest Green Light */
    --bg-beige: #f5f4f0; /* Soft warm cream/beige background */
    --bg-card: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-article: 'Times New Roman', Georgia, Times, serif;
}

/* Global Reset */
body {
    font-family: var(--font-ui);
    color: var(--text-dark);
    background-color: var(--bg-beige);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Top Border Highlight */
body::before {
    content: '';
    display: block;
    height: 4px;
    background-color: var(--academic-green);
    width: 100%;
}

/* Base Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary-color);
}

/* Page Animations */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in-delayed {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.15s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sticky Header & Navbar */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1020;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    box-shadow: var(--shadow-md);
}

.journal-title-link {
    font-weight: 700;
    color: var(--academic-green) !important;
    letter-spacing: -0.025em;
    font-size: 1.1rem;
    text-transform: uppercase;
    text-decoration: none;
}

.journal-title-link span {
    font-weight: 400;
    color: var(--text-muted);
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--bg-beige);
    color: var(--academic-green) !important;
}

.nav-link.active {
    color: var(--academic-green) !important;
    background-color: rgba(27, 77, 62, 0.08);
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 260px;
}

.search-input {
    font-size: 0.8rem;
    padding: 0.4rem 1rem 0.4rem 2rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    transition: all 0.2s ease;
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: var(--academic-green);
    box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.15);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.8rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1b4d3e 0%, #0d261e 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 10% 20%, rgba(45, 106, 79, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.badge-academic {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-open-access {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.hero-meta-item {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.hero-btn-primary {
    background-color: var(--academic-green);
    border: 1px solid var(--academic-green);
    font-weight: 500;
    padding: 0.65rem 1.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(27, 77, 62, 0.2);
}

.hero-btn-primary:hover {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    transform: translateY(-1px);
}

.hero-btn-outline {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-weight: 500;
    padding: 0.65rem 1.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hero-btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Journal Containers / Cards */
.journal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.journal-card-header {
    border-bottom: 2px solid var(--bg-beige);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.journal-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--academic-green);
    text-transform: uppercase;
}

/* Left Sidebar Cover & Metrics */
.sidebar-cover-card {
    background-color: var(--academic-green);
    color: #ffffff;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.sidebar-cover-img {
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    margin-bottom: 0.75rem;
}

.metric-sidebar-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--academic-green);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.metric-sidebar-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--academic-green);
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.metric-sidebar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Article Lists */
.article-item {
    padding: 1rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.article-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.article-item:first-child {
    padding-top: 0;
}

.article-item-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.article-item-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

.article-item-title a:hover {
    color: var(--academic-green);
}

.article-item-authors {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.article-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.article-badge {
    background-color: var(--bg-beige);
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* Keywords Tag Cloud */
.keyword-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    background-color: var(--bg-beige);
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    margin-right: 0.25rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.keyword-tag:hover {
    background-color: var(--academic-green);
    color: #ffffff;
    border-color: var(--academic-green);
}

/* Right Sticky Actions Toolbar (Journal Style) */
.sticky-actions-toolbar {
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 4px;
    background-color: #ffffff;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.toolbar-btn:hover {
    background-color: var(--academic-green);
    color: #ffffff;
    border-color: var(--academic-green);
    transform: translateY(-2px);
}

.toolbar-btn.pdf-btn {
    border-top: 3px solid #dc3545;
}

.toolbar-btn.pdf-btn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}

.toolbar-btn.citation-btn {
    border-top: 3px solid var(--academic-green);
}

.toolbar-btn.share-btn {
    border-top: 3px solid var(--accent-green);
}

/* Paper Page Article Body */
.article-text-container {
    font-family: var(--font-article);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #111827; /* Near black */
}

/* Abstract Box: Framed like the screenshot */
.abstract-box {
    background-color: #fcfcf9;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--academic-green);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 2px;
}

.article-text-container h2 {
    font-family: var(--font-ui);
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.2rem;
}

.article-text-container h3 {
    font-family: var(--font-ui);
    color: var(--primary-color);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-text-container p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Embedding Figures */
.article-figure {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin: 2rem auto;
    max-width: 620px;
    text-align: center;
}

.article-figure img {
    max-width: 100%;
    height: auto;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-light);
}

.figure-caption {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
}

.figure-caption strong {
    color: var(--academic-green);
}

/* Custom Citation Block */
.citation-block {
    background-color: var(--bg-beige);
    border-left: 4px solid var(--academic-green);
    padding: 1rem;
    font-size: 0.85rem;
    border-radius: 0 4px 4px 0;
    margin: 1.5rem 0;
    font-family: var(--font-ui);
}

.citation-block code {
    color: var(--text-dark);
}

/* Action Cards */
.action-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--academic-green);
    color: #ffffff;
    font-weight: 600;
    padding: 0.65rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    font-size: 0.9rem;
}

.download-btn:hover {
    background-color: var(--accent-green);
    color: #ffffff;
}

.action-secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #ffffff;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    width: 100%;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.action-secondary-btn:hover {
    background-color: var(--bg-beige);
}

/* Table Style for Academic Papers */
.academic-table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.academic-table th {
    border-top: 2px solid var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
    padding: 0.4rem;
    font-weight: 600;
    text-align: left;
}

.academic-table td {
    padding: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}

.academic-table tr:last-child td {
    border-bottom: 2px solid var(--primary-color);
}

/* Reference List */
.references-list {
    padding-left: 1.5rem;
    text-indent: -1.5rem;
    list-style-type: none;
    font-size: 0.9rem;
    line-height: 1.6;
}

.references-list li {
    margin-bottom: 0.75rem;
    text-align: justify;
}

/* Toast styling for UI feedback */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1100;
}

/* Editor List styling */
.editor-list-item {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-light);
}

.editor-list-item:last-child {
    border-bottom: none;
}

.editor-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.editor-affiliation {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Footer Section */
.journal-footer {
    background-color: #1e293b;
    color: #cbd5e1;
    font-size: 0.85rem;
    border-top: 4px solid var(--academic-green);
}

.journal-footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.journal-footer a:hover {
    color: #ffffff;
}

.journal-footer h5 {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.4rem;
}

.journal-footer h5::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1.5rem;
    height: 2px;
    background-color: var(--academic-green);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
}

/* Layout modifications for structural sidebars */
@media (max-width: 991.98px) {
    .sticky-actions-toolbar {
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        flex-direction: row;
        background-color: rgba(255,255,255,0.9);
        padding: 0.4rem;
        border-radius: 4px;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-color);
        z-index: 1000;
    }
    
    .toolbar-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Unbold inline elements in the research paper text */
.article-text-container strong,
.article-text-container b {
    font-weight: normal;
}



/* ==========================================================================
   Mobile Responsiveness and Performance Adjustments
   ========================================================================== */

/* Universal touch targets for touch-screen mobile devices */
@media (max-width: 767.98px) {
    .btn, 
    .toolbar-btn, 
    .download-btn, 
    .action-primary-btn, 
    .action-secondary-btn,
    .form-select,
    .form-control,
    .search-input {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-container {
        max-width: 100%;
        width: 100%;
    }
    
    .search-input {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Base structural scaling for mobile viewports (320px - 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.65rem !important;
        line-height: 1.25;
        letter-spacing: -0.01em;
    }
    
    .journal-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .abstract-box {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .article-text-container {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    
    .article-text-container h2 {
        font-size: 1.25rem;
        margin-top: 1.75rem;
    }
    
    .article-text-container h3 {
        font-size: 1.1rem;
        margin-top: 1.25rem;
    }
    
    .article-figure {
        padding: 0.5rem;
        margin: 1.25rem auto;
    }
    
    .references-list {
        padding-left: 1rem;
        text-indent: -1rem;
        font-size: 0.85rem;
    }
    
    /* Ensure any tables inside article body that didn't get wrapper classes scroll */
    .article-text-container table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Tablet refinements (768px - 1024px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 2.15rem !important;
    }
    
    .article-text-container {
        font-size: 1.1rem;
    }
}

/* Eliminate horizontal scroll page-wide */
html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}
