/* ========================================
   Misha Journal Custom Style for OJS
   ======================================== */

/* 1. استيراد خط تجوال للعربية وخط Montserrat للإنجليزية */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&family=Tajawal:wght@400;500;700&display=swap');

/* المتغيرات اللونية لمجلة ميشا (مستوحاة من الشعار بشكل مريح للعين) */
:root {
    --misha-primary: #1B4332;   /* أخضر غابي داكن - رصين ومريح للعين (الأساسي) */
    --misha-accent: #A62828;    /* أحمر قرمزي هادئ - حيوية بدون إزعاج بصري (للأزرار والتمرير) */
    --misha-secondary: #748C7B; /* أخضر مائل للرمادي - ناعم (للحدود والتفاصيل) */
    --misha-bg: #FAF9F6;        /* أبيض عاجي دافئ - لراحة القراءة المطولة */
}

/* 2. فرض الخط على النصوص الأساسية مع دعم اللغتين */
body, h1, h2, h3, h4, h5, h6, p, div, button, input, 
.pkp_site_name, .pkp_navigation_primary a, .pkp_navigation_user a {
    font-family: 'Tajawal', 'Montserrat', sans-serif !important;
}

/* استرجاع أيقونة البحث (العدسة) لمنع ظهور المربع */
.pkp_search_toggle:before,
.fa, .fas {
    font-family: "FontAwesome" !important;
}

body {
    background-color: var(--misha-bg);
}

/* ========================================
   3. منطقة الترويسة (Header) وتلوين روابط المستخدم
   ======================================== */
.pkp_structure_head {
    background-color: #ffffff !important; 
    border-bottom: none !important;
}

.pkp_structure_head .pkp_navigation_user a {
    color: var(--misha-primary) !important;
    font-weight: 500;
}

.pkp_structure_head .pkp_navigation_user a:hover {
    color: var(--misha-accent) !important;
}

/* ========================================
   4. حقن اسم المجلة + رقم ISSN (محدث بنظام Grid)
   ======================================== */
.pkp_structure_head .pkp_site_name,
.pkp_structure_head .pkp_site_name a {
    text-decoration: none !important;
    overflow: visible !important;
}

/* استخدام نظام الشبكة (Grid) لترتيب العناصر باحترافية */
.pkp_structure_head .pkp_site_name a {
    display: grid !important;
    align-items: center !important;
    column-gap: 15px !important;
    row-gap: 2px !important; 
}

/* تحديد مساحة الشعار ليأخذ موضعه الصحيح */
.pkp_structure_head .pkp_site_name img {
    grid-area: logo !important;
    max-height: 85px !important;
    width: auto !important;
    margin: 0 !important;
}

.pkp_structure_head .pkp_site_name .is_text {
    display: none !important;
}

/* --- الواجهة العربية (RTL) --- */
/* الشعار على اليمين والنص على اليسار */
[dir="rtl"] .pkp_structure_head .pkp_site_name a {
    grid-template-areas: 
        "logo name"
        "logo issn" !important;
    justify-content: right !important;
}

[dir="rtl"] .pkp_structure_head .pkp_site_name a::before {
    content: "مجلة ميشا للفيزياء" !important;
    grid-area: name !important;
    color: var(--misha-primary) !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    text-align: right !important;
    align-self: end !important; 
}

[dir="rtl"] .pkp_structure_head .pkp_site_name a::after {
    content: "ISSN: 0000-0000 | e-ISSN: 0000-0000" !important;
    grid-area: issn !important;
    color: var(--misha-secondary) !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-align: right !important;
    align-self: start !important; 
}

/* --- الواجهة الإنجليزية (LTR) --- */
/* الشعار على اليسار والنص على اليمين */
[dir="ltr"] .pkp_structure_head .pkp_site_name a {
    grid-template-areas: 
        "logo name"
        "logo issn" !important;
    justify-content: left !important;
}

[dir="ltr"] .pkp_structure_head .pkp_site_name a::before {
    content: "Misha Journal of Physics" !important;
    grid-area: name !important;
    color: var(--misha-primary) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-align: left !important;
    align-self: end !important;
}

[dir="ltr"] .pkp_structure_head .pkp_site_name a::after {
    content: "ISSN: 0000-0000 | e-ISSN: 0000-0000" !important;
    grid-area: issn !important;
    color: var(--misha-secondary) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-align: left !important;
    align-self: start !important;
}

/* ========================================
   5. الشريط الملاحي (القائمة الرئيسية)
   ======================================== */
.pkp_navigation_primary_row,
.pkp_navigation_primary_wrapper {
    background-color: var(--misha-primary) !important;
}

.pkp_navigation_primary_wrapper {
    border-bottom: 3px solid var(--misha-accent) !important;
}

.pkp_navigation_primary > li > a,
.pkp_navigation_primary_wrapper > ul > li > a {
    color: #ffffff !important;
    font-weight: 700;
}

.pkp_navigation_primary > li > a:hover,
.pkp_navigation_primary_wrapper > ul > li > a:hover {
    color: var(--misha-accent) !important;
}

.pkp_navigation_primary_wrapper .pkp_search_toggle,
.pkp_search a {
    color: #ffffff !important;
}

.pkp_navigation_primary_wrapper .pkp_search_toggle:hover,
.pkp_search a:hover {
    color: var(--misha-accent) !important;
}

/* ========================================
   6. الأزرار والكتل الجانبية (Sidebar)
   ======================================== */
button, .pkp_button, .cmp_button {
    background-color: var(--misha-accent) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

button:hover, .pkp_button:hover, .cmp_button:hover {
    background-color: var(--misha-primary) !important;
}

.pkp_block {
    border: 1px solid var(--misha-secondary) !important;
    border-radius: 6px !important;
    overflow: hidden !important; 
    margin-bottom: 20px !important;
    background-color: #ffffff !important;
    padding: 0 !important; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

.pkp_block .title {
    background-color: var(--misha-primary) !important;
    color: #ffffff !important;
    padding: 12px !important;
    margin: 0 !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 16px !important;
}

.pkp_block .content {
    padding: 15px !important;
}

.block_language ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.block_language ul li {
    margin-bottom: 8px !important;
}

.block_language ul li:last-child {
    margin-bottom: 0 !important;
}

.block_language ul li a,
.pkp_block .content ul li a {
    display: block !important;
    padding: 8px 12px !important;
    background-color: var(--misha-bg) !important;
    color: var(--misha-primary) !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    text-align: center !important;
    border: 1px solid #e0e0e0 !important;
    transition: all 0.3s ease !important;
}

.block_language ul li a:hover,
.pkp_block .content ul li a:hover {
    background-color: var(--misha-primary) !important;
    color: #ffffff !important;
    border-color: var(--misha-primary) !important;
    transform: scale(1.02) !important;
}

/* ========================================
   7. ملخصات المقالات (Article Summary)
   ======================================== */
.obj_article_summary {
    border: 1px solid #e0e0e0;
    border-left: 5px solid var(--misha-secondary);
    background-color: #ffffff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    transition: box-shadow 0.3s ease;
}

.obj_article_summary:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.obj_article_summary:dir(rtl) {
    border-left: none;
    border-right: 5px solid var(--misha-secondary);
}

.obj_article_summary .title a {
    color: var(--misha-primary) !important;
    font-weight: bold;
}

.obj_article_summary .title a:hover {
    color: var(--misha-accent) !important;
}

/* ========================================
   8. تذييل الصفحة (Footer)
   ======================================== */
.pkp_structure_footer_wrapper {
    background-color: var(--misha-primary) !important;
    border-top: 4px solid var(--misha-accent) !important;
    color: var(--misha-bg) !important;
    padding-top: 30px !important;
    padding-bottom: 30px !important;
}

.pkp_structure_footer_wrapper p,
.pkp_structure_footer_wrapper span {
    color: var(--misha-bg) !important;
}

.pkp_structure_footer_wrapper a {
    color: var(--misha-secondary) !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.pkp_structure_footer_wrapper a:hover {
    color: var(--misha-bg) !important;
}

.pkp_brand_footer img {
    filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 0.8)) !important;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.pkp_brand_footer img:hover {
    filter: drop-shadow(0px 0px 12px rgba(255, 255, 255, 1)) !important;
    transform: scale(1.02);
    opacity: 1;
}

.pkp_structure_footer_wrapper .pkp_footer_content img {
    filter: brightness(0) invert(1) !important;
    opacity: 0.85; 
    transition: all 0.3s ease !important;
    max-height: 80px; 
}

.pkp_structure_footer_wrapper .pkp_footer_content img:hover {
    opacity: 1;
    transform: scale(1.05) !important;
}

/* ========================================
   9. القوائم المنسدلة (Dropdown Menus)
   ======================================== */
.pkp_navigation_primary ul,
.pkp_navigation_primary li ul {
    background-color: #ffffff !important; 
    border: 1px solid var(--misha-secondary) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.pkp_navigation_primary ul li a,
.pkp_navigation_primary li ul li a {
    color: var(--misha-primary) !important; 
    font-weight: 500 !important;
    background-color: transparent !important;
}

.pkp_navigation_primary ul li a:hover,
.pkp_navigation_primary li ul li a:hover {
    color: var(--misha-accent) !important; 
    background-color: var(--misha-bg) !important;
}

.misha-btn {
    transition: all 0.3s ease !important;
}
.misha-btn:hover {
    background-color: #A62828 !important; 
    transform: scale(1.03) !important; 
}

.misha-link-hover {
    transition: color 0.3s ease !important;
}
.misha-link-hover:hover, 
.misha-link-hover:hover i {
    color: #A62828 !important; 
}

/* ========================================
   10. تصميم كتلة البحث
   ======================================== */
.journal-search-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    width: 100%;
    margin-bottom: 20px;
    transition: box-shadow 0.2s;
    font-family: 'Montserrat', Tahoma, Arial, sans-serif;
}

.journal-search-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
}

.search-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid #eef1f5;
    padding-bottom: 0.9rem;
}

.search-heading i {
    font-size: 1.6rem;
    color: #1B4332;
}

.search-heading h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a2a4a;
    margin: 0;
}

.fake-input-link {
    display: flex;
    align-items: center;
    background: #f8faff;
    border: 1px solid #d9e0eb;
    border-radius: 4px;
    padding: 0 12px;
    min-height: 45px;
    text-decoration: none !important;
    transition: border-color 0.2s, background 0.2s;
    gap: 10px;
    margin-bottom: 12px;
}

.fake-input-link:hover {
    border-color: #1B4332;
    background: #ffffff;
}

.fake-input-link span {
    color: #a0b0c9;
    font-size: 0.95rem;
}

.btn-search-safe {
    width: 100%;
    min-height: 45px;
    background: #1B4332;
    border: none;
    border-radius: 4px;
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    text-decoration: none !important;
}

.btn-search-safe:hover {
    background: #143326 !important;
}

/* ========================================
   11. تنسيق كتلة الكشافات وقواعد البيانات
   ======================================== */
.mjp-indexing-vertical {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 25px; 
    padding: 25px 15px;
    background-color: #ffffff;
}

.mjp-indexing-vertical a {
    display: flex;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mjp-indexing-vertical img {
    max-width: 75%; 
    height: auto;
    max-height: 45px; 
    object-fit: contain;
    transition: all 0.3s ease;
}

.mjp-indexing-vertical a:hover img {
    transform: scale(1.06);
    filter: drop-shadow(0px 5px 8px rgba(0,0,0,0.15));
}

/* ========================================
   12. تصميم أزرار الأدوات (الموحدة والمطورة)
   ======================================== */
.mjp-tool-btn {
    display: flex !important;
    align-items: center !important;
    background-color: #1B4332 !important; 
    color: #ffffff !important;            
    padding: 12px 15px !important;
    text-decoration: none !important;
    border-radius: 6px !important;        
    font-weight: bold !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important; 
    border: none !important;
    width: 100% !important;               
    box-sizing: border-box !important;
    margin-bottom: 8px !important;        
}

.mjp-tool-btn:last-child {
    margin-bottom: 0 !important;
}

.mjp-tool-btn:hover {
    background-color: #A62828 !important; 
    transform: translateX(calc(var(--dir, 1) * 3px)) !important; 
    color: #ffffff !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.12) !important;
}

[dir="rtl"] .mjp-tool-btn:hover { --dir: -1; }
[dir="ltr"] .mjp-tool-btn:hover { --dir: 1; }

.mjp-tool-btn i {
    font-size: 1.15rem !important;
    margin-left: 12px !important;  
}

[dir="rtl"] .mjp-tool-btn i {
    margin-left: 0 !important;
    margin-right: 12px !important; 
}

/* ========================================
   13. حاوية الأزرار العمودية متساوية العرض
   ======================================== */
.mjp-dashboard-grid {
    display: inline-flex !important;      /* جعل الحاوية تنكمش على حجم محتواها فقط */
    flex-direction: column !important;    
    margin-top: 15px !important;
    width: fit-content !important;        /* حساب العرض تلقائياً اعتماداً على أطول نص */
    min-width: 260px !important;          /* حد أدنى للعرض لضمان مظهر رصين */
}

/* ========================================
   14. تصميم صفحة هيئة التحرير (إصلاح العزل وحماية الشريط الجانبي)
   ======================================== */
body.pkp_op_editorialMasthead .pkp_structure_main h2,
body.pkp_op_editorialMasthead .pkp_structure_main h3,
body.pkp_op_editorialMasthead .pkp_structure_main h4 {
    color: #1B4332 !important;
    font-weight: bold !important;
    border-bottom: 2px solid #748C7B !important;
    padding-bottom: 10px !important;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
}

body.pkp_op_editorialMasthead .pkp_structure_main ul {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin-bottom: 40px !important;
}

body.pkp_op_editorialMasthead .pkp_structure_main ul li {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-right: 4px solid #1B4332 !important;
    border-radius: 6px !important;
    padding: 20px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin-bottom: 0 !important;
}

body.pkp_op_editorialMasthead .pkp_structure_main ul li:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important;
    border-right-color: #A62828 !important;
    transform: translateY(-3px) !important;
}

body.pkp_op_editorialMasthead .pkp_structure_main ul li .name {
    font-size: 1.15rem !important;
    font-weight: bold !important;
    color: #1B4332 !important;
    margin-bottom: 8px !important;
    display: block !important;
}

body.pkp_op_editorialMasthead .pkp_structure_main ul li .affiliation {
    font-size: 0.95rem !important;
    color: #555555 !important;
    line-height: 1.5 !important;
    display: block !important;
}

[dir="ltr"] body.pkp_op_editorialMasthead .pkp_structure_main ul li {
    border-right: 1px solid #e0e0e0 !important;
    border-left: 4px solid #1B4332 !important;
}

[dir="ltr"] body.pkp_op_editorialMasthead .pkp_structure_main ul li:hover {
    border-left-color: #A62828 !important;
}