/* ==========================================================================
   JALIN RISTEK - Modern Theme Styling for Desktop & Laptop Views
   ========================================================================== */

:root {
    --primary-color: #0f2942;
    --primary-dark: #0a192f;
    --accent-blue: #0284c7;
    --accent-hover: #0369a1;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --sidebar-block-bg: #ffffff;
    --sidebar-block-border: #e9ecef;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    background-color: #f8fafc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Container Width for Desktop/Laptop --- */
.container {
    max-width: 1240px;
}

/* --- Top Utility Bar --- */
.top-utility-bar {
    background: #0f172a;
    color: #94a3b8;
    font-size: 0.82rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-utility-bar a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-utility-bar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.top-utility-bar .issn-badge {
    background: #1e293b;
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #334155;
    font-size: 0.78rem;
}

/* ==========================================================================
   HEADER & NAVBAR — Single Row, Compact
   ========================================================================== */

/* --- Main Header: 150px height layout --- */
header.main-header {
    background: url('/public/journals/1/header.png') center/cover no-repeat !important;
    min-height: 150px !important;
    height: 150px !important;
    padding: 0 !important;
    border-bottom: 3px solid var(--accent-blue);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    isolation: isolate;
}

header.main-header .container {
    height: 150px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Dark overlay — lighter so the background image shows through */
header.main-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        105deg,
        rgba(6, 24, 43, 0.62) 0%,
        rgba(6, 24, 43, 0.45) 60%,
        rgba(6, 24, 43, 0.58) 100%
    );
}

/* Bring all children above the overlay */
header.main-header > * {
    position: relative;
    z-index: 1;
}

/* Journal branding — side-by-side logo & text */
.journal-header-brand {
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    height: 150px !important;
    float: none !important;
}

.brand-logo-wrapper img {
    max-height: 105px !important;
    width: auto !important;
    object-fit: contain !important;
}

.journal-title-text {
    color: #ffffff !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7) !important;
    line-height: 1.1 !important;
    display: block !important;
}

.journal-header-brand .journal-sub-title {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
    margin-top: 4px !important;
    line-height: 1.25 !important;
    display: block !important;
}

/* --- Navbar: right-aligned, same row as brand --- */
.main-header nav.navbar {
    padding: 0 !important;
    float: none !important;
    height: 150px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.main-header .navbar-toggler {
    display: none !important;
}

.main-header .collapse.navbar-collapse,
.main-header .collapse.show {
    display: flex !important;
    flex-basis: auto !important;
    align-items: center;
}

@media (min-width: 992px) {
    .main-header .collapse {
        display: flex !important;
        visibility: visible !important;
        height: auto !important;
    }
}

@media (max-width: 991.98px) {
    .main-header nav.navbar {
        float: none;
        height: auto;
        flex-wrap: wrap;
    }

    .main-header nav.navbar .collapse {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(6, 24, 43, 0.97);
        z-index: 1000;
        padding: 0.75rem;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        flex-direction: column;
        width: 100%;
    }

    .main-header nav.navbar .collapse.show,
    .main-header nav.navbar .collapse.showing {
        display: flex !important;
    }

    .main-header nav.navbar .navbar-nav {
        flex-direction: column !important;
        gap: 3px;
    }

    .main-header .navbar-toggler {
        display: block !important;
    }
}

.main-header nav.navbar .navbar-collapse {
    justify-content: flex-end !important;
}

.main-header nav.navbar .navbar-nav {
    margin: 0 !important;
    gap: 3px;
    align-items: center;
    flex-direction: row !important;
}

/* Nav links — tiny pill style */
.main-header .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 500;
    font-size: 0.75rem !important;
    padding: 4px 9px !important;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1.4;
}

.main-header .navbar-nav .nav-link:hover,
.main-header .navbar-nav .nav-item.active .nav-link {
    color: #ffffff !important;
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

.main-header .dropdown-menu {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 6px;
    min-width: 200px;
}

.main-header .dropdown-item {
    color: #cbd5e1 !important;
    border-radius: 5px;
    padding: 7px 13px;
    font-weight: 500;
    font-size: 0.82rem;
}

.main-header .dropdown-item:hover {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
}

/* Login / Register — blue accent pill */
.main-header .navbar-nav .nav-item.nmi_type_user_register .nav-link,
.main-header .navbar-nav .nav-item.nmi_type_user_login .nav-link {
    background: rgba(2, 132, 199, 0.30) !important;
    border-color: rgba(2, 132, 199, 0.65) !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

.main-header .navbar-nav .nav-item.nmi_type_user_register .nav-link:hover,
.main-header .navbar-nav .nav-item.nmi_type_user_login .nav-link:hover {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
}

/* --- Remove Homepage Image Display --- */
.homepage-image {
    display: none !important;
}

/* ==========================================================================
   MAIN LAYOUT: Content + Sidebar
   ========================================================================== */

/* Main + Sidebar: flex row */
.pkp_page_index .row,
.page-wrapper .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
}

/* Sidebar column: fixed width, fills available height */
.col-lg-4.pkp_structure_sidebar {
    flex: 0 0 320px !important;
    max-width: 320px !important;
    width: 320px !important;
}

/* Sidebar inner wrapper: full width of parent */
.sidebar-custom-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Ensure pkp_structure_sidebar class on wrapper doesn't add constraints */
.pkp_structure_sidebar.sidebar-custom-wrapper {
    display: block !important;
    float: none !important;
    margin: 0 !important;
}

/* ==========================================================================
   PAGE CONTENT
   ========================================================================== */

.container-homepage-issue.page-content,
.page-content {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-top: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    flex: 1 1 auto;
}

/* ==========================================================================
   ARTICLE CARDS
   ========================================================================== */

.article-summary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.article-summary:hover {
    border-left-color: var(--accent-blue) !important;
    border-color: #bfdbfe !important;
    box-shadow: var(--card-shadow-hover) !important;
    transform: translateY(-2px);
}

.article-summary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.45rem;
    line-height: 1.35;
}

.article-summary-title a {
    color: var(--primary-color) !important;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-summary-title a:hover {
    color: var(--accent-blue) !important;
}

.article-summary-stats .stat-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    background: #f8fafc;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.article-summary-stats .stat-badge:hover {
    transform: translateY(-1px);
    color: var(--accent-blue);
}

.article-summary .meta {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* --- Badges & Headings --- */
.current_issue_badge,
.obj_issue_summary .badge {
    background: var(--accent-blue) !important;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    border-radius: 4px;
    padding: 3px 8px;
}

.pkp_page_title, h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.3px;
    margin-bottom: 0.75rem;
}

h2, h3 {
    color: var(--primary-color);
    font-weight: 700;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   SIDEBAR BLOCKS — The core fix
   ========================================================================== */

/* Sidebar container: full width, no float */
.pkp_structure_sidebar .pkp_block {
    background: var(--sidebar-block-bg);
    border: 1px solid var(--sidebar-block-border);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    border-left: 3px solid var(--accent-blue);

    /* Force full width — this is the key fix */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.pkp_structure_sidebar .pkp_block:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #d1d9e0;
    border-left-color: var(--accent-blue);
}

/* Block titles: compact uppercase */
.pkp_structure_sidebar .pkp_block .block-title,
.pkp_structure_sidebar .pkp_block .title,
.pkp_structure_sidebar .pkp_block h2 {
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 0.38rem;
    margin-bottom: 0.75rem;
}

.pkp_structure_sidebar .pkp_block .title {
    border-bottom: none;
    margin-bottom: 0.4rem;
}

.pkp_structure_sidebar .pkp_block > :last-child {
    margin-bottom: 0;
}

/* Block list items */
.pkp_structure_sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pkp_structure_sidebar ul li {
    padding: 0.28rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.pkp_structure_sidebar ul li:last-child {
    border-bottom: none;
}

.pkp_structure_sidebar ul li a {
    color: #475569;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.15s ease, padding-left 0.15s ease;
    display: block;
}

.pkp_structure_sidebar ul li a:hover {
    color: var(--accent-blue);
    padding-left: 4px;
}

/* Block paragraphs */
.pkp_structure_sidebar .pkp_block p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.pkp_structure_sidebar .pkp_block p:last-child {
    margin-bottom: 0;
}

/* --- Sidebar Login Form --- */
.form-sidebar-login {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-sidebar-login input[type="text"],
.form-sidebar-login input[type="password"] {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--text-dark);
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-sidebar-login input[type="text"]:focus,
.form-sidebar-login input[type="password"]:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
    outline: none;
    background: #fff;
}

.form-sidebar-login label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0;
}

.form-sidebar-login .btn {
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}

/* --- Sidebar Search Form --- */
.form-search-sidebar input[type="text"] {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-search-sidebar input[type="text"]:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
    outline: none;
}

/* --- Manuscript Template Button --- */
.btn-journal-template {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.82rem;
    box-shadow: 0 3px 6px rgba(16, 185, 129, 0.2);
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.btn-journal-template:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 5px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* --- Sidebar Menu List --- */
.sidebar-menu-list .list-group-item {
    padding: 0.4rem 0;
    border-color: #f1f5f9;
    font-size: 0.82rem;
    border-left: none;
    border-right: none;
    border-top: none;
    background: transparent;
}

.sidebar-menu-list .list-group-item:first-child {
    border-top: 1px solid #f1f5f9;
}

.sidebar-menu-list .list-group-item a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease, padding-left 0.15s ease;
    display: block;
}

.sidebar-menu-list .list-group-item a:hover {
    color: var(--accent-blue);
    padding-left: 4px;
}

/* --- Tools Grid --- */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.tools-grid .tool-card {
    background: #f8fafc;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 7px 4px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.tools-grid .tool-card:hover {
    background: #ffffff;
    border-color: var(--accent-blue) !important;
    color: var(--accent-blue);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* --- Citation Analysis --- */
.citation-analysis-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.citation-analysis-list a {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.15s ease;
}

.citation-analysis-list a:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

/* --- Keywords Tags --- */
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.keyword-tags a {
    display: inline-block;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #c7d2fe;
    transition: all 0.15s ease;
}

.keyword-tags a:hover {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}

/* --- Visitor Stats Block --- */
.stat-counter-block {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.stat-counter-block .counter-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-blue);
    display: block;
    line-height: 1;
}

.stat-counter-block .counter-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 3px;
    display: block;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer.site-footer {
    background: #0f172a !important;
    color: #cbd5e1;
    padding: 2rem 0 1.5rem 0;
    margin-top: 2.5rem;
    border-top: 3px solid var(--accent-blue);
}

footer.site-footer h3,
footer.site-footer h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

footer.site-footer a {
    color: #38bdf8;
    text-decoration: none;
}

footer.site-footer a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 991.98px) {
    header.main-header {
        min-height: 60px !important;
    }

    .journal-header-brand {
        height: 60px;
    }

    .journal-header-brand .navbar-logo-text {
        font-size: 1.1rem;
    }

    .main-header nav.navbar {
        height: auto;
        padding: 0.4rem 0 !important;
    }

    .main-header nav.navbar .navbar-nav .nav-link {
        font-size: 0.78rem;
        padding: 5px 9px !important;
    }

    /* Mobile layout: stack content and sidebar */
    .pkp_page_index .row,
    .page-wrapper .row {
        flex-wrap: wrap !important;
    }

    .col-lg-4.pkp_structure_sidebar {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .container-homepage-issue.page-content,
    .page-content {
        padding: 1rem 1.1rem;
        margin-top: 1rem;
        margin-bottom: 1.25rem;
        border-radius: 6px;
    }

    .pkp_structure_sidebar .pkp_block {
        padding: 0.85rem 1rem;
        margin-bottom: 0.75rem;
        border-radius: 6px;
    }

    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    h1, .pkp_page_title {
        font-size: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    header.main-header {
        min-height: 55px !important;
    }

    .journal-header-brand {
        height: 55px;
    }

    .journal-header-brand .navbar-logo-text {
        font-size: 1rem;
    }

    .top-utility-bar {
        font-size: 0.72rem;
    }

    .tools-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Hide Custom & Standard Blocks --- */
.pkp_block.block_custom,
.pkp_block.block_information,
#customblock-quick_links {
    display: none !important;
}

/* --- Fix Homepage Issue Description Overflow & Shadow --- */
.homepage-issue-description-wrapper {
    box-shadow: none !important;
}

.homepage-issue-description {
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
}

.homepage-issue-description::after {
    display: none !important;
    content: none !important;
}
