/* تنسيقات عامة */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

h2 {
    color: #333;
    margin: 0;
}

.logout-btn {
    background-color: #dc3545;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* تنسيقات شريط التنقل */
.main-nav {
    margin-bottom: 20px;
}

.main-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 15px;
}

.main-nav ul li a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-nav ul li a:hover {
    background-color: #e9ecef;
}

/* تنسيقات حقول الفلترة */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-form label {
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

.filter-form select,
.filter-form input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background-color: #fff;
}

.filter-form button {
    padding: 8px 16px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-form button:hover {
    background-color: #0056b3;
}

.reset-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #6c757d;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.reset-btn:hover {
    background-color: #5a6268;
}

/* تنسيقات الجدول الاحترافية */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.data-table thead th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    font-size: 14px;
}

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

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

.status-cell {
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
}

.status-unprocessed {
    background-color: #dc3545;
}

.status-pending {
    background-color: #ffc107;
    color: #333;
}

.status-answered {
    background-color: #28a745;
}

.status-form select {
    width: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    font-size: 14px;
    cursor: pointer;
}

/* تنسيقات رسالة "لا توجد بيانات" */
.no-data {
    text-align: center;
    color: #777;
    font-size: 1.2em;
    margin-top: 40px;
}

/* تنسيقات التصفح (Pagination) */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination a {
    display: block;
    padding: 10px 16px;
    background-color: #f0f2f5;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.pagination a:hover {
    background-color: #e0e2e6;
    color: #0056b3;
}

.pagination a.active {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.pagination a.nav-btn {
    background-color: #f8f9fa;
    color: #6c757d;
}

.pagination a.nav-btn:hover {
    background-color: #e9ecef;
}

/* تنسيقات صفحة الإحصائيات (stats.php) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin-top: 0;
    color: #555;
    font-size: 1.1em;
}

.stat-card .stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
    color: #007bff;
}

.stat-card.total .stat-number {
    color: #007bff;
}

.stat-card.unprocessed .stat-number {
    color: #dc3545;
}

.stat-card.pending .stat-number {
    color: #ffc107;
}

.stat-card.answered .stat-number {
    color: #28a745;
}

/* تنسيقات الرسوم البيانية (Charts) */
.chart-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.chart-container h3 {
    text-align: center;
    color: #333;
}

/* تنسيقات صفحة المستخدمين (users.php) */
.user-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-form label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

.user-form input[type="text"],
.user-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.user-form .full-width {
    grid-column: 1 / -1;
}

.user-form button {
    grid-column: 1 / -1;
    padding: 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.user-form button:hover {
    background-color: #0056b3;
}

.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* تنسيقات أزرار الإجراءات في الجدول */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-buttons .edit-btn,
.action-buttons .delete-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    color: #fff;
    text-decoration: none;
}

.action-buttons .edit-btn {
    background-color: #ffc107;
}

.action-buttons .edit-btn:hover {
    background-color: #e0a800;
}

.action-buttons .delete-btn {
    background-color: #dc3545;
}

.action-buttons .delete-btn:hover {
    background-color: #c82333;
}


/* تنسيقات عرض عدد السجلات */
.records-count {
    margin: 20px 0 10px;
    font-size: 1.1em;
    color: #555;
    text-align: center;
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 5px;
}

.records-count strong {
    color: #007bff;
}

/* تنسيقات صفحة التحكم بالنظام */
.maintenance-control {
    text-align: center;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f8f9fa;
    margin-top: 30px;
}

.maintenance-control h3 {
    font-size: 1.5em;
    color: #333;
}

.maintenance-control p {
    color: #666;
}

.maintenance-control .status-badge {
    padding: 8px 15px;
    font-size: 1em;
    border-radius: 20px;
}

.action-btn {
    padding: 12px 25px;
    font-size: 1.1em;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.close-btn {
    background-color: #dc3545; /* أحمر */
}

.close-btn:hover {
    background-color: #c82333;
}

.open-btn {
    background-color: #28a745; /* أخضر */
}

.open-btn:hover {
    background-color: #218838;
}


/* تنسيقات صفحة تسجيل الدخول */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #e9ecef; /* لون خلفية خفيف */
    direction: rtl; /* لضمان الاتجاه من اليمين لليسار */
}

.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.login-container .form-group {
    margin-bottom: 20px;
    text-align: right; /* محاذاة التسميات (Labels) لليمين */
}

.login-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
}

.login-container .submit-btn {
    width: 100%;
    background-color: #007bff;
    color: #fff;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-container .submit-btn:hover {
    background-color: #0056b3;
}

.login-container .error-message {
    color: #dc3545; /* لون أحمر للرسائل الخطأ */
    font-size: 1em;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
}
```

/* تنسيقات صفحة الخطأ */
.error-page {
    text-align: center;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: #f8d7da; /* لون خلفية أحمر فاتح */
    border: 1px solid #f5c6cb;
    max-width: 500px;
    margin: 40px auto;
}

.error-page h1 {
    color: #721c24; /* لون نص أحمر غامق */
    font-size: 2em;
    margin-bottom: 20px;
}

.error-page p {
    color: #721c24;
    font-size: 1.1em;
    line-height: 1.6;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.back-link:hover {
    background-color: #0056b3;
}