/* ==========================================
   OJS 3.3 - Ultimate Professional Theme
   Final Version 7.0 - All in CSS
   ========================================== */

/* ============ FONT IMPORTS ============ */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============ ROOT VARIABLES ============ */
:root {
    /* Professional Colors */
    --primary-dark: #0a1929;
    --primary: #0d2137;
    --primary-medium: #1a3a5c;
    --primary-light: #2e5a88;
    --accent: #3b82f6;
    
    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
}

/* ============ GLOBAL STYLES ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--gray-900);
    background: #ffffff;
}

[dir="ltr"] body {
    font-family: 'Inter', 'Vazirmatn', sans-serif;
    font-size: 16px;
}

/* ============ ALL TEXT JUSTIFY ============ */
p,
article,
section,
.panel-body,
.page-static,
.article-summary,
.article-detail,
.article-full,
.article-abstract,
.article-meta,
.footer-content,
.modal-body,
.alert,
.form-group,
.nav-tabs,
.sidebar,
.pkp_structure_footer,
.abstract-text,
.article-summary .article-abstract {
    text-align: justify !important;
    text-justify: inter-word !important;
}

/* ============ HEADER ============ */
.pkp_structure_head {
    background: #ffffff;
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 9999;
}

.pkp_site_name {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--primary);
    padding: 1.5rem 2rem;
    text-align: center;
}

.pkp_site_name a {
    color: inherit;
    text-decoration: none;
}

/* ============ NAVIGATION ============ */
.pkp_navigation_primary {
    background: var(--primary-dark);
}

.pkp_navigation_primary ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.pkp_navigation_primary li {
    position: relative;
}

.pkp_navigation_primary > ul > li > a {
    display: block;
    padding: 1rem 1.5rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.pkp_navigation_primary > ul > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============ DROPDOWN - LARGE & BEAUTIFUL ============ */
/* Force show dropdown on hover */
.pkp_navigation_primary li:hover > .dropdown-menu,
.pkp_navigation_primary li:focus-within > .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--accent);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow-xl);
    padding: 0.75rem 0;
    min-width: 300px;
    z-index: 9999;
    animation: dropdownFade 0.3s ease;
    list-style: none;
}

[dir="rtl"] .dropdown-menu {
    right: 0;
}

[dir="ltr"] .dropdown-menu {
    left: 0;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu li {
    margin: 0;
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 1rem 1.75rem;
    color: var(--gray-800);
    font-size: 1.125rem !important;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.6;
    border-left: 4px solid transparent;
    white-space: nowrap;
}

[dir="rtl"] .dropdown-menu a {
    border-left: none;
    border-right: 4px solid transparent;
}

.dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
    border-left-color: var(--accent);
    padding-left: 2.25rem;
}

[dir="rtl"] .dropdown-menu a:hover {
    border-right-color: var(--accent);
    padding-right: 2.25rem;
    padding-left: 1.75rem;
}

/* Submenu */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: -3px;
}

[dir="rtl"] .dropdown-submenu > .dropdown-menu {
    right: 100%;
    left: auto;
}

[dir="ltr"] .dropdown-submenu > .dropdown-menu {
    left: 100%;
    right: auto;
}

/* ============ ARTICLE SUMMARY ============ */
.article-summary {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.article-summary:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.article-summary .article-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.article-summary .article-title a {
    color: inherit;
    text-decoration: none;
}

.article-summary .article-title a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.article-summary .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.article-summary .article-author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--gray-800);
    font-size: 1rem;
}

/* LARGE ABSTRACT TEXT */
.article-summary .article-abstract,
.article-abstract,
.abstract-text,
.article-detail .article-abstract,
.article-full .article-abstract {
    color: var(--gray-700);
    font-size: 1.125rem !important;
    line-height: 1.9 !important;
    text-align: justify !important;
    margin-top: 1rem;
}

/* ============ ORCID ICON - ALWAYS VISIBLE ============ */
.orcid-icon,
.orcid-id,
a[href*="orcid.org"],
img[src*="orcid"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px !important;
    height: 20px !important;
    margin: 0 0.375rem !important;
    vertical-align: middle !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
}

.orcid-icon img,
.orcid-id img,
a[href*="orcid.org"] img,
img[src*="orcid"] {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    display: block !important;
}

.orcid-icon:hover,
.orcid-id:hover,
a[href*="orcid.org"]:hover {
    transform: scale(1.2) !important;
    filter: brightness(1.2) !important;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-medium);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ============ FOOTER ============ */
.pkp_structure_footer {
    background: var(--primary-dark);
    color: #e0e0e0;
    margin-top: 4rem;
    position: relative;
}

.pkp_structure_footer::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--primary-light), var(--primary));
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    padding: 3.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pkp_structure_footer h3,
.pkp_structure_footer h4 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.pkp_structure_footer ul {
    list-style: none;
    padding: 0;
}

.pkp_structure_footer ul li {
    margin-bottom: 0.75rem;
}

.pkp_structure_footer a {
    color: #b0bec5;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 1rem;
}

.pkp_structure_footer a:hover {
    color: #ffffff;
    transform: translateX(5px);
}

[dir="rtl"] .pkp_structure_footer a:hover {
    transform: translateX(-5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    text-align: center;
    color: #90a4ae;
    font-size: 1rem;
}

/* ============ SCROLL TO TOP - PURE CSS ============ */
/* Create scroll button using CSS only */
.pkp_structure_footer::after {
    content: '↑ بازگشت به بالا ↑';
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 2rem auto;
    width: fit-content;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    font-family: inherit;
}

[dir="ltr"] .pkp_structure_footer::after {
    content: '↑ Back to Top ↑';
}

.pkp_structure_footer::after:hover {
    background: var(--primary-medium);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* Make entire footer after content clickable for scroll */
.pkp_structure_footer::after {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: var(--shadow-md);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0.1);
    }
}

/* ============ SIDEBAR ============ */
.sidebar {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.75rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--primary);
    text-align: justify;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: justify;
}

.sidebar ul li a:hover {
    background: var(--gray-50);
    color: var(--primary);
    padding-left: 1.5rem;
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2.5rem 0;
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 3rem;
    padding: 0 1rem;
    border-radius: 8px;
    background: #ffffff;
    color: var(--gray-800);
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid var(--gray-300);
    transition: all 0.3s ease;
}

.pagination li a:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination li.active span {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .pkp_navigation_primary ul {
        flex-direction: column;
    }
    
    .pkp_navigation_primary a {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        text-align: center;
    }
    
    .dropdown-menu {
        position: static;
        min-width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--gray-200);
        display: none !important;
    }
    
    .pkp_navigation_primary li:active > .dropdown-menu,
    .pkp_navigation_primary li:focus > .dropdown-menu {
        display: block !important;
    }
    
    .pkp_site_name {
        font-size: 1.5rem;
        padding: 1.25rem;
    }
    
    .article-summary {
        padding: 1.5rem;
    }
    
    .article-summary .article-title {
        font-size: 1.25rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.5rem 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* ============ PRINT ============ */
@media print {
    .pkp_navigation_primary,
    .sidebar,
    .pkp_structure_footer::after {
        display: none !important;
    }
    
    .article-summary {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}