/* General Styles */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #495057;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
}

/* Page Title */
.page-title {
    font-size: 28px;
    color: #343a40;
    margin-bottom: 30px;
    text-align: center;
}

/* Form Styles */
.form-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

label.required:after {
    content: " *";
    color: #dc3545;
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Search Styles */
.search-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

.search-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-btn:hover {
    background-color: #0069d9;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Search Results */
.search-results {
    margin-top: 30px;
}

.results-container {
    margin-top: 30px;
}

.results-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    position: relative;
    padding-right: 15px;
}

.results-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    bottom: 5px;
    width: 5px;
    background: linear-gradient(to bottom, #3498db, #2980b9);
    border-radius: 2px;
}

.result-item {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-right: 5px solid #3498db;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.result-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.result-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.result-title a:hover {
    color: #3498db;
}

.result-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.result-source {
    font-weight: 500;
    color: #34495e;
}

.result-contexts {
    margin-bottom: 15px;
}

.result-context {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}

.result-context::before {
    content: '"';
    position: absolute;
    right: 5px;
    top: 0;
    font-size: 2rem;
    color: rgba(52, 152, 219, 0.1);
    font-family: Arial, sans-serif;
}

.context-before, .context-after {
    color: #34495e;
}

.context-highlight {
    background-color: rgba(241, 196, 15, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
    color: #000;
}

.result-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3498db;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.result-link:hover {
    background-color: #2980b9;
}

/* Article View */
.article-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #343a40;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-label {
    font-weight: 500;
    color: #495057;
}

.meta-value {
    color: #6c757d;
}

.article-content {
    line-height: 1.8;
    margin-bottom: 30px;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content .highlight {
    background-color: #ff8787;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* Statistics Styles */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
    line-height: 1.2;
}

.stat-label {
    font-size: 16px;
    color: #495057;
    font-weight: 500;
}

.chart-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    height: 400px;
}

.chart-container canvas {
    max-height: 350px;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #28a745, #5cc82a);
}

.chart-title {
    font-size: 20px;
    color: #343a40;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Data Table Styles */
.data-table-container {
    margin: 30px 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.data-table th {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
    text-align: right;
    padding: 12px 15px;
    border-bottom: 2px solid #ddd;
}

.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Form Title for Statistics Page */
.form-title {
    font-size: 28px;
    color: #343a40;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    border-radius: 3px;
}

/* Header Container for Statistics Page */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

/* Main Navigation for Statistics Page */
.main-nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav a {
    color: #495057;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.main-nav a:hover {
    background-color: #007bff;
    color: #fff;
}

/* Upload options styling */
.upload-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.upload-option {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-option::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #2980b9);
}

.upload-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.upload-option h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    position: relative;
}

.upload-option p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.upload-info {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    border-right: 5px solid #3498db;
}

.upload-info h3 {
    margin-top: 0;
    color: #2c3e50;
}

.upload-info ul {
    padding-right: 20px;
}

.upload-info li {
    margin-bottom: 10px;
    color: #34495e;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

/* File results styling */
.file-results {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.file-results h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.file-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.file-result {
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-result.success {
    background-color: rgba(46, 204, 113, 0.1);
    border-right: 3px solid #2ecc71;
}

.file-result.failed {
    background-color: rgba(231, 76, 60, 0.1);
    border-right: 3px solid #e74c3c;
}

.file-result span.success {
    color: #27ae60;
    font-weight: 500;
}

.file-result span.failed {
    color: #c0392b;
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
}

/* Responsive Styles for Statistics Page */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-options {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    direction: rtl;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
h1, h2, h3 {
    color: #333;
}
.search-form {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
.search-form input[type="text"] {
    padding: 10px;
    width: 70%;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}
.search-form button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
.search-form button:hover {
    background-color: #45a049;
}
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.filter-group {
    flex: 1;
    min-width: 200px;
}
.filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.results {
    margin-top: 20px;
}
.article {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.article h3 {
    margin-top: 0;
}
.article-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}
.article-content {
    line-height: 1.6;
}
.stats {
    margin-top: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
.stats ul {
    list-style-type: none;
    padding: 0;
}
.stats li {
    margin-bottom: 10px;
}
.no-results {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: center;
    color: #666;
}
.highlight {
    background-color: #ffff99;
    padding: 2px;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}
.logo {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    text-decoration: none;
}
.nav-menu {
    display: flex;
    gap: 15px;
}
.nav-link {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
}
.nav-link:hover, .nav-link.active {
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
}

