/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: #333;
    background: #fafafa;
}

/* Arabic Font Support */
[lang="ar"], [dir="rtl"] {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    text-decoration: none;
}

.nav-logo h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: #667eea;
}

/* Research Content */
.research-content {
    margin-top: 100px;
    padding: 2rem 0 4rem;
}

/* Paper Header */
.paper-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.paper-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.paper-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
    line-height: 1.2;
}

.paper-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    opacity: 0.9;
}

.meta-item i {
    font-size: 1.1rem;
}

/* Table of Contents */
.toc {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
    border-left: 4px solid #667eea;
}

.toc h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin-bottom: 0.8rem;
}

.toc a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid transparent;
}

.toc a:hover {
    color: #667eea;
    border-bottom-color: #667eea;
    padding-left: 1rem;
}

/* Paper Body */
.paper-body {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.paper-body section {
    margin-bottom: 3rem;
}

.paper-body h2 {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #667eea;
    position: relative;
}

.paper-body h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.paper-body h3 {
    color: #444;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    position: relative;
    padding-left: 1rem;
}

.paper-body h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.paper-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
    font-size: 1.05rem;
    color: #444;
}

/* Benefits Table */
.benefits-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.benefits-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.benefits-table th,
.benefits-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.benefits-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.benefits-table td {
    font-size: 1rem;
    color: #555;
}

.benefits-table tr:hover {
    background: #f8f9ff;
}

/* References */
.references-list {
    padding-left: 2rem;
}

.references-list li {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #555;
}

.references-list a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.references-list a:hover {
    text-decoration: underline;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* RTL Support */
[dir="rtl"] .toc a:hover {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .paper-body h3 {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .paper-body h3::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .benefits-table th,
[dir="rtl"] .benefits-table td {
    text-align: right;
}

[dir="rtl"] .references-list {
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .paper-header h1 {
        font-size: 2rem;
    }
    
    .paper-meta {
        gap: 1rem;
    }
    
    .paper-body {
        padding: 2rem 1.5rem;
    }
    
    .paper-body h2 {
        font-size: 1.6rem;
    }
    
    .paper-body h3 {
        font-size: 1.2rem;
    }
    
    .toc {
        padding: 1.5rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .paper-header {
        padding: 2rem 1rem;
    }
    
    .paper-header h1 {
        font-size: 1.6rem;
    }
    
    .paper-body {
        padding: 1.5rem 1rem;
    }
    
    .paper-body h2 {
        font-size: 1.4rem;
    }
    
    .paper-body p {
        font-size: 1rem;
    }
    
    .benefits-table th,
    .benefits-table td {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .meta-item {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .back-to-top {
        display: none;
    }
    
    .research-content {
        margin-top: 0;
    }
    
    .paper-header {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
    }
    
    .paper-body {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .paper-body section {
        page-break-inside: avoid;
    }
    
    .paper-body h2 {
        page-break-after: avoid;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.paper-body {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Selection Styles */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #333;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.2);
    color: #333;
}

