/* ======================================================
   GHALIB JOURNAL - BOOTSTRAP 3 THEME (FINAL FIX)
   اصلاحات: یک ردیف شدن منوها + باکس سایدبار حرفه‌ای + آیکون ORCID
   ====================================================== */

/* ---------- 1. IMPORT FONTS ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

/* ---------- 2. ROOT VARIABLES ---------- */
:root {
    --navy: #0A2540;
    --navy-dark: #051c2c;
    --gold: #D4AF37;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px -8px rgba(0,0,0,0.12);
    --radius-lg: 20px;
}

/* ---------- 3. BASE & FONTS ---------- */
html, body {
    font-size: 16px !important;
}
body {
    background: #f8fafc !important;
    font-family: 'Vazirmatn', 'Inter', sans-serif !important;
}
body:lang(en) {
    font-family: 'Inter', 'Vazirmatn', sans-serif !important;
}
.abstract, p {
    text-align: justify !important;
}

/* ========== اصلاح 1: لوگو کوچک‌تر ========== */
.navbar-brand img,
.logo img,
.pkp_site_name img,
.site-logo img,
.brand img,
.navbar-header img {
    max-width: 70px !important;
    max-height: 55px !important;
    width: auto !important;
    height: auto !important;
}

/* ========== اصلاح 2: یک ردیف افقی برای منوها، لوگو و جستجو (فارسی و انگلیسی) ========== */
.container-fluid > .navbar-header,
.container-fluid > .navbar-collapse {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.navbar-header {
    float: left !important;
}
body:lang(fa) .navbar-header {
    float: right !important;
}
.navbar-collapse {
    float: left !important;
    width: auto !important;
}
body:lang(fa) .navbar-collapse {
    float: right !important;
}
.navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    margin: 0 !important;
}
.navbar-nav > li {
    float: none !important;
}
.navbar-form {
    width: auto !important;
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

/* جستجو - کم عرض‌تر */
.navbar-form .form-control {
    width: 180px !important;
    max-width: 180px !important;
}
@media (max-width: 992px) {
    .navbar-form .form-control {
        width: 120px !important;
    }
}

/* ========== اصلاح 3: باکس مقالات ========== */
.obj_article_summary,
.article-summary,
.item.article {
    background: var(--white) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid var(--gray-200) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}
.obj_article_summary:hover,
.article-summary:hover {
    transform: translateY(-5px) !important;
    border-color: var(--gold) !important;
    box-shadow: var(--shadow-lg) !important;
}
.obj_article_summary::before,
.article-summary::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, var(--gold), #e8c86a, var(--gold)) !important;
    transform: scaleX(0) !important;
    transform-origin: left !important;
    transition: transform 0.3s ease !important;
}
.obj_article_summary:hover::before,
.article-summary:hover::before {
    transform: scaleX(1) !important;
}
.obj_article_summary .title,
.article-summary .title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
}
.obj_article_summary .title a,
.article-summary .title a {
    color: var(--navy) !important;
    text-decoration: none !important;
}
.obj_article_summary .title a:hover,
.article-summary .title a:hover {
    color: var(--gold) !important;
}
.obj_article_summary .authors,
.article-summary .authors {
    font-size: 0.85rem !important;
    color: var(--gray-600) !important;
    margin: 0.5rem 0 !important;
}
.obj_article_summary .abstract,
.article-summary .abstract {
    font-size: 0.85rem !important;
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid var(--gray-200) !important;
}

/* ========== اصلاح 4: ORCID (نمایش در صفحه اصلی) ========== */
a[href*="orcid.org"], a[href*="orcid"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: var(--gray-100) !important;
    padding: 2px 8px !important;
    border-radius: 40px !important;
    font-size: 0.7rem !important;
    text-decoration: none !important;
    color: var(--gray-600) !important;
    margin-left: 6px !important;
}
body:lang(fa) a[href*="orcid.org"] {
    margin-right: 6px !important;
    margin-left: 0 !important;
}
a[href*="orcid.org"]::before {
    content: "\f1d2" !important;
    font-family: 'Font Awesome 6 Free' !important;
    color: #A6CE39 !important;
    font-size: 0.75rem !important;
}
a[href*="orcid.org"]:hover {
    background: #A6CE39 !important;
    color: white !important;
}

/* ========== اصلاح 5: باکس‌های سایدبار حرفه‌ای با آیکون ========== */
.pkp_block {
    background: var(--white) !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid var(--gray-200) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}
.pkp_block:hover {
    transform: translateY(-3px) !important;
    border-color: var(--gold) !important;
    box-shadow: var(--shadow-md) !important;
}
.pkp_block::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, var(--gold), #e8c86a, var(--gold)) !important;
    transform: scaleX(0) !important;
    transform-origin: left !important;
    transition: transform 0.3s ease !important;
}
.pkp_block:hover::before {
    transform: scaleX(1) !important;
}
.pkp_block .title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--navy) !important;
    border-bottom: 2px solid var(--gold) !important;
    display: inline-block !important;
    padding-bottom: 0.25rem !important;
    margin-bottom: 1rem !important;
}
.pkp_block .title::before {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    margin-right: 8px !important;
    color: var(--gold) !important;
}
body:lang(fa) .pkp_block .title::before {
    margin-left: 8px !important;
    margin-right: 0 !important;
}
/* آیکون‌های مختلف برای باکس‌های سایدبار */
.pkp_block:nth-child(1) .title::before { content: "\f0c0" !important; }
.pkp_block:nth-child(2) .title::before { content: "\f02d" !important; }
.pkp_block:nth-child(3) .title::before { content: "\f1ea" !important; }
.pkp_block:nth-child(4) .title::before { content: "\f0e0" !important; }
.pkp_block:nth-child(5) .title::before { content: "\f002" !important; }

/* ========== اصلاح 6: دکمه اسکرول به بالا ========== */
.scroll-top {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 45px !important;
    height: 45px !important;
    background: var(--navy) !important;
    color: var(--gold) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-md) !important;
    border: none !important;
    font-size: 1.2rem !important;
}
.scroll-top.show {
    opacity: 1 !important;
    visibility: visible !important;
}
.scroll-top:hover {
    background: var(--gold) !important;
    color: var(--navy) !important;
    transform: translateY(-3px) !important;
}
body:lang(fa) .scroll-top {
    left: 30px !important;
    right: auto !important;
}

/* ========== اصلاح 7: حذف عنوان مجله از هدر (برای هر دو زبان) ========== */
.pkp_site_name,
.pkp_site_name a,
#pkpBrand {
    display: none !important;
}

/* ========== اصلاح 8: ترکیبات رنگی برای همه بخش‌ها ========== */
/* آبی تیره برای هدر و فوتر */
.navbar-default,
footer,
.pkp_structure_footer {
    background: var(--navy) !important;
}
/* طلایی برای هاور و حاشیه‌ها */
a:hover,
.navbar-default .navbar-nav > li > a:hover,
.dropdown-menu > li > a:hover {
    color: var(--gold) !important;
}
/* سفید برای پس‌زمینه باکس‌ها */
.obj_article_summary,
.pkp_block {
    background: var(--white) !important;
}
/* خاکستری برای متن‌های کمکی */
.authors,
.text-muted,
.obj_article_summary .authors {
    color: var(--gray-600) !important;
}

/* ========== اصلاح 9: بنر هدر با پترن گرافیکی (قوی‌تر) ========== */
.pkp_site_name_wrapper {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%) !important;
    position: relative !important;
    overflow: hidden !important;
}
.pkp_site_name_wrapper::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-image: repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.05) 0px, rgba(212, 175, 55, 0.05) 2px, transparent 2px, transparent 8px) !important;
    pointer-events: none !important;
}

/* ========== اصلاح 10: رفع مشکل دکمه‌های ورود و ثبت نام در انگلیسی ========== */
body:lang(en) .navbar-collapse {
    float: left !important;
    width: auto !important;
}
body:lang(en) .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
}
body:lang(en) .navbar-form {
    display: inline-flex !important;
    float: none !important;
    margin-left: 10px !important;
}
body:lang(en) .container-fluid {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
}
body:lang(en) .navbar-header {
    float: left !important;
}
body:lang(en) .navbar-collapse {
    flex: 1 !important;
    display: flex !important;
    justify-content: flex-end !important;
}
/* انتقال دکمه‌های ورود و ثبت نام به کنار */
body:lang(en) .navbar-nav {
    justify-content: flex-end !important;
}
body:lang(en) .navbar-nav > li:last-child {
    margin-right: 0 !important;
}
body:lang(en) .navbar-nav li a {
    white-space: nowrap !important;
}

/* ---------- 7. HEADER (آبی تیره) ---------- */
.navbar-default {
    background: var(--navy) !important;
    border-bottom: 3px solid var(--gold) !important;
}
.navbar-default .navbar-nav > li > a {
    color: white !important;
}
.navbar-default .navbar-nav > li > a:hover {
    color: var(--gold) !important;
}
.dropdown-menu {
    background: var(--navy) !important;
}
.dropdown-menu > li > a {
    color: white !important;
}
.dropdown-menu > li > a:hover {
    background: var(--gold) !important;
    color: var(--navy) !important;
}