/* ----------------------------------------------------
 1. الأزرار الموحدة
---------------------------------------------------- */
.btn,
.btn-danger,
.btn-success,
.btn-sm,
.remove-option-btn,
.auto-analyzer-btn,
.btn-analyze,
.add-btn,
.btn-edit,
.btn-delete,
.btn-move,
.btn-action,
.btn-primary,
.btn-secondary {
  border: none;
  color: white;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.btn-danger,
.remove-option-btn,
.btn-delete {
  background-color: #dc3545;
}

.btn-success,
.add-btn {
  background-color: #28a745;
}

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

.auto-analyzer-btn,
.btn-analyze {
  background-color: #17a2b8;
}

.btn-sm,
.btn-action {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-secondary,
.btn-move {
  background-color: #6c757d;
}

.close {
  background: none;
  color: #888;
  font-size: 20px;
  padding: 4px 8px;
}

/* تأثير hover للأزرار */
.btn:hover,
.btn-danger:hover,
.btn-success:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* دعم أيقونات داخل الأزرار */
.btn i,
.btn svg {
  margin-inline-end: 6px;
  vertical-align: middle;
}

/* تأثير focus */
.btn:focus,
.btn:active {
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.4);
}

/* ----------------------------------------------------
 2. البطاقات (Cards)
---------------------------------------------------- */
.card,
.form-card,
.stat-card {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 12px;
}

/* ----------------------------------------------------
 3. التنبيهات (Alerts)
---------------------------------------------------- */
.alert,
.alert-success,
.alert-danger {
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: bold;
  color: white;
}

.alert-success {
  background-color: #28a745;
}

.alert-danger {
  background-color: #dc3545;
}

.alert .close {
  float: right;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  color: white;
  opacity: 0.6;
  border: none;
  background: none;
  cursor: pointer;
}

.alert .close:hover {
  opacity: 1;
}

/* ----------------------------------------------------
 4. الجداول (Tables)
---------------------------------------------------- */
.table,
.table-striped {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px;
  border: 1px solid #dee2e6;
}

.table-striped tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* ----------------------------------------------------
 5. العناصر المساعدة
---------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 12px;
  background-color: #007bff;
  color: white;
}

.pagination {
  display: flex;
  gap: 6px;
  margin-top: 20px;
}

.pagination .page-item {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
}

.form-control,
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.form-control:focus,
.form-select:focus {
  border-color: #4ecdc4;
  box-shadow: 0 0 4px rgba(78, 205, 196, 0.3);
  outline: none;
}

/* ----------------------------------------------------
 ✅ الكلاسات الإضافية من الملف الأصلي للحفاظ على كافة الميزات
---------------------------------------------------- */
/* styles.css */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #9b59b6;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
    --text-color: #333;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Particles Animation */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite linear;
}

.p1, .p6 { background-color: rgba(52, 152, 219, 0.3); width: 30px; height: 30px; }
.p2, .p7 { background-color: rgba(46, 204, 113, 0.3); width: 20px; height: 20px; }
.p3, .p8 { background-color: rgba(155, 89, 182, 0.3); width: 25px; height: 25px; }
.p4, .p9 { background-color: rgba(241, 196, 15, 0.3); width: 15px; height: 15px; }
.p5, .p10 { background-color: rgba(231, 76, 60, 0.3); width: 18px; height: 18px; }

.p1 { top: 10%; left: 10%; animation-duration: 25s; }
.p2 { top: 20%; left: 80%; animation-duration: 30s; }
.p3 { top: 80%; left: 15%; animation-duration: 28s; }
.p4 { top: 40%; left: 40%; animation-duration: 22s; }
.p5 { top: 65%; left: 70%; animation-duration: 24s; }
.p6 { top: 75%; left: 85%; animation-duration: 26s; }
.p7 { top: 35%; left: 50%; animation-duration: 29s; }
.p8 { top: 50%; left: 25%; animation-duration: 27s; }
.p9 { top: 85%; left: 35%; animation-duration: 23s; }
.p10 { top: 30%; left: 90%; animation-duration: 21s; }

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(90deg);
    }
    50% {
        transform: translateY(0) translateX(20px) rotate(180deg);
    }
    75% {
        transform: translateY(20px) translateX(10px) rotate(270deg);
    }
    100% {
        transform: translateY(0) translateX(0) rotate(360deg);
    }
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--dark-color), #1a2a3a);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.atom {
    position: relative;
    width: 50px;
    height: 50px;
}

.nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
    z-index: 2;
}

.electron {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--secondary-color);
    animation: orbit 3s infinite linear;
}

.e1 {
    animation-delay: -1s;
}

.e2 {
    animation-delay: -2s;
}

.e3 {
    animation-delay: 0s;
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(25px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(25px) rotate(-360deg);
    }
}

h1 {
    font-size: 1.8rem;
    margin: 0;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    margin: 0.5rem 2rem;
}

nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 0;
}

nav ul li {
    flex: 1;
    text-align: center;
}

nav ul li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1rem;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

nav ul li a:hover, nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid var(--secondary-color);
}

nav ul li a i {
    margin-left: 0.5rem;
}

.logout {
    color: var(--danger-color);
}

/* Main Content Styles */
main {
    padding: 1rem;
    max-width: none;
    margin: 0;
    width: 100%;
}

.dashboard h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.dashboard h2 i {
    margin-left: 0.5rem;
    color: var(--primary-color);
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.stat-card:nth-child(1) {
    border-top: 4px solid var(--primary-color);
}

.stat-card:nth-child(2) {
    border-top: 4px solid var(--secondary-color);
}

.stat-card:nth-child(3) {
    border-top: 4px solid var(--accent-color);
}

.stat-card:nth-child(4) {
    border-top: 4px solid var(--warning-color);
}

.stat-icon {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(46, 204, 113, 0.2));
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(52, 152, 219, 0.4));
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.4));
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(155, 89, 182, 0.4));
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(241, 196, 15, 0.4));
}

.stat-icon i {
    font-size: 1.8rem;
    color: var(--dark-color);
}

.stat-card:nth-child(1) .stat-icon i {
    color: var(--primary-color);
}

.stat-card:nth-child(2) .stat-icon i {
    color: var(--secondary-color);
}

.stat-card:nth-child(3) .stat-icon i {
    color: var(--accent-color);
}

.stat-card:nth-child(4) .stat-icon i {
    color: var(--warning-color);
}

.stat-info h3 {
    font-size: 1rem;
    color: #777;
    margin-bottom: 0.3rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.section-header h3 {
    color: var(--dark-color);
}

.section-header h3 i {
    margin-left: 0.5rem;
    color: var(--primary-color);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.view-all:hover {
    text-decoration: underline;
}

.activity-list {
    display: grid;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-radius: var(--border-radius);
    background-color: #f9f9f9;
    transition: var(--transition);
}

.activity-item:hover {
    background-color: #f0f0f0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.activity-icon i {
    color: var(--primary-color);
}

.activity-details p {
    margin: 0;
    font-size: 0.95rem;
}

.activity-time {
    font-size: 0.8rem;
    color: #777;
}

/* Content Sections */
.content-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

/* Questions Table */
.questions-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background-color: #f5f7fa;
}

th, td {
    padding: 0.8rem;
    text-align: right;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    color: var(--dark-color);
}

tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.15);
}

.btn {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.btn-edit {
    background-color: var(--primary-color);
    color: white;
}

.btn-delete {
    background-color: var(--danger-color);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
    text-align: center;
}

.quick-action-card:hover {
    background-color: #f0f0f0;
    transform: translateY(-3px);
}

.quick-action-card i {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.quick-action-card:nth-child(2) i {
    color: var(--secondary-color);
}

.quick-action-card:nth-child(3) i {
    color: var(--accent-color);
}

.quick-action-card:nth-child(4) i {
    color: var(--warning-color);
}

.quick-action-card:nth-child(5) i {
    color: var(--success-color);
}

.quick-action-card:nth-child(6) i {
    color: var(--danger-color);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color), #1a2a3a);
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    nav ul li a {
        padding: 0.6rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* تنسيقات إضافية من base.html للتوافق مع الصفحات المعقدة */

/* تنسيق المحتوى الرئيسي المحسن */
main {
    flex: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 1rem !important;
    position: relative !important;
    z-index: 1 !important;
    background-color: transparent !important;
}

/* تنسيق خاص لصفحة الإشعارات */
body.notifications-page {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%) !important;
}

body.notifications-page main {
    padding: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
}

/* تنسيق الجداول المحسن - متوافق مع الصفحات المعقدة */
.table-container {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 1rem auto !important;
    overflow-x: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    background: white !important;
    display: block !important;
}

table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
    background: white !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: table !important;
}

table th {
    padding: 1rem 0.75rem !important;
    text-align: right !important;
    font-weight: 600 !important;
    border: none !important;
    white-space: nowrap !important;
}

table td {
    padding: 0.75rem !important;
    text-align: right !important;
    border-bottom: 1px solid #f0f0f0 !important;
    vertical-align: middle !important;
}

table tbody tr {
    transition: background-color 0.2s ease !important;
}

table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.15) !important;
}
table tbody tr:nth-child(even) {
    background-color: rgba(52, 152, 219, 0.1) !important;
}

table tbody tr:nth-child(even):hover {
    background-color: rgba(52, 152, 219, 0.2) !important;
}(52, 152, 219, 0.2) !important;
}

/* تنسيق البطاقات المحسن */
.card {
    background: white !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin: 1rem 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e9ecef !important;
    transition: all 0.3s ease !important;
}

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

.card-header {
    border-bottom: 2px solid #f0f0f0 !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1rem !important;
}

.card-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 !important;
}

.card-body {
    line-height: 1.6 !important;
}

/* تنسيق النماذج المحسن */
.form-card {
    background: white !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    margin: 1rem auto !important;
    max-width: 600px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e9ecef !important;
}

.form-header {
    text-align: center !important;
    margin-bottom: 2rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 2px solid #f0f0f0 !important;
}

.form-header h2 {
    color: #2c3e50 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.form-group {
    margin-bottom: 1.5rem !important;
}

.form-group label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 500 !important;
    color: #2c3e50 !important;
}

.form-control {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background-color: #fff !important;
}

.form-control:focus {
    outline: none !important;
    border-color: #4ecdc4 !important;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1) !important;
}

.form-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 1rem !important;
    margin-top: 2rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #f0f0f0 !important;
}

/* تنسيق الأزرار المحسن */
.btn {
    display: inline-block !important;
    padding: 0.75rem 1.5rem !important;
    background-color: #4ecdc4 !important;
    color: white !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
}

.btn:hover {
    background-color: #45b7aa !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.btn-primary {
    background-color: #007bff !important;
}

.btn-primary:hover {
    background-color: #0056b3 !important;
}

.btn-success {
    background-color: #28a745 !important;
}

.btn-success:hover {
    background-color: #1e7e34 !important;
}

.btn-danger {
    background-color: #dc3545 !important;
}

.btn-danger:hover {
    background-color: #bd2130 !important;
}

.btn-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.btn-warning:hover {
    background-color: #e0a800 !important;
}

.btn-info {
    background-color: #17a2b8 !important;
}

.btn-info:hover {
    background-color: #117a8b !important;
}

.btn-secondary {
    background-color: #6c757d !important;
}

.btn-secondary:hover {
    background-color: #545b62 !important;
}

/* تنسيق القوائم المحسن */
.list-group {
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
}

.list-group-item {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background-color 0.2s ease !important;
}

.list-group-item:hover {
    background-color: #f8f9fa !important;
}

.list-group-item:last-child {
    border-bottom: none !important;
}

.list-group-item.active {
    background-color: #4ecdc4 !important;
    color: white !important;
    border-color: #4ecdc4 !important;
}

/* تنسيق التنبيهات المحسن */
.alert {
    padding: 1rem 1.25rem !important;
    margin: 1rem 0 !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    font-weight: 500 !important;
}

.alert-success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

.alert-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

.alert-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffeaa7 !important;
}

.alert-info {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border-color: #bee5eb !important;
}

/* تنسيق المحتوى الكثيف */
.content-container {
    background: white !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    margin: 1rem 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e9ecef !important;
}

.content-header {
    margin-bottom: 2rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 2px solid #f0f0f0 !important;
}

.content-header h1,
.content-header h2,
.content-header h3 {
    color: #2c3e50 !important;
    margin: 0 !important;
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
    .table-container {
        margin: 0.5rem 0 !important;
        border-radius: 4px !important;
    }

    table {
        font-size: 0.8rem !important;
    }

    table th,
    table td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.75rem !important;
    }

    table th {
        padding: 0.75rem 0.5rem !important;
    }

    .form-card {
        padding: 1rem !important;
        margin: 0.5rem !important;
    }

    .form-actions {
        flex-direction: column !important;
    }

    .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }

    .content-container {
        padding: 1rem !important;
        margin: 0.5rem 0 !important;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.5rem 0.25rem !important;
    }

    .form-card {
        padding: 0.75rem !important;
    }

    .content-container {
        padding: 0.75rem !important;
    }
}


/* إصلاحات محددة فقط للمشاكل المذكورة */

/* إصلاح تنسيق النماذج في الصفحات التي تحتاج بطاقات */
.container form {
    background: white !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    margin: 2rem auto !important;
    max-width: 600px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e9ecef !important;
}

/* إصلاح تنسيق عناوين النماذج */
.container form h1,
.container form h2 {
    color: #2c3e50 !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
    padding-bottom: 1rem !important;
    border-bottom: 2px solid #f0f0f0 !important;
}

/* إصلاح تنسيق الحقول في النماذج */
.container .form-group {
    margin-bottom: 1.5rem !important;
}

.container .form-group label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

.container .form-control {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.container .form-control:focus {
    outline: none !important;
    border-color: #4ecdc4 !important;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1) !important;
}

/* إصلاح أزرار النماذج */
.container .btn {
    display: inline-block !important;
    padding: 0.75rem 1.5rem !important;
    margin: 0.5rem !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.container .btn-primary {
    background-color: #007bff !important;
    color: white !important;
}

.container .btn-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

.container .btn:hover {
    opacity: 0.9 !important;
    transform: translateY(-2px) !important;
}



/* ===== تنسيقات صفحة إدارة المنهج ===== */

/* تنسيقات خاصة بصفحة إدارة المنهج */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.8rem;
    color: #1e2a38;
    margin: 0;
    display: flex;
    align-items: center;
}

.page-title i {
    margin-left: 0.5rem;
    color: #4ecdc4;
}

.add-btn {
    background-color: #4ecdc4;
    color: #1e2a38;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.add-btn i {
    margin-left: 0.5rem;
}

.add-btn:hover {
    background-color: #3dbdb4;
    transform: translateY(-2px);
}

/* تنسيقات المناهج */
.curriculum-container {
    margin-bottom: 2rem;
}

.course-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: visible;
}

.course-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.course-header:hover {
    background-color: #e9ecef;
}

.course-indicator {
    width: 5px;
    height: 30px;
    background-color: #4ecdc4;
    margin-left: 1rem;
    border-radius: 3px;
}

.course-title {
    flex-grow: 1;
}

.course-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e2a38;
}

.course-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-badge {
    background-color: #4ecdc4;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.btn-action {
    background: none;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.btn-action i {
    margin-left: 0.25rem;
}

.btn-edit {
    color: #4ecdc4;
    border-color: #4ecdc4;
}

.btn-edit:hover {
    background-color: #4ecdc4;
    color: white;
}

.btn-delete {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.btn-delete:hover {
    background-color: #ff6b6b;
    color: white;
}

.btn-move {
    color: #6c757d;
    border-color: #ced4da;
}

.btn-move:hover {
    background-color: #6c757d;
    color: white;
}

.course-content {
    padding: 1rem;
    display: none;
}

.course-content.active {
    display: block;
}

/* تنسيقات الوحدات */
.units-container {
    margin-top: 1rem;
}

.units-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.units-header h4 {
    margin: 0;
    color: #1e2a38;
    font-size: 1.1rem;
}

.unit-item {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    overflow: hidden;
}

.unit-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s;
}

.unit-header:hover {
    background-color: #e9ecef;
}

.unit-indicator {
    width: 4px;
    height: 24px;
    background-color: #ffbe0b;
    margin-left: 0.75rem;
    border-radius: 2px;
}

.unit-title {
    flex-grow: 1;
}

.unit-title h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e2a38;
}

.unit-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unit-content {
    padding: 0.75rem;
    display: none;
}

.unit-content.active {
    display: block;
}

/* تنسيقات الدروس */
.lessons-container {
    margin-top: 0.75rem;
}

.lessons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.lessons-header h5 {
    margin: 0;
    color: #1e2a38;
    font-size: 1rem;
}

.lesson-item {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.lesson-header {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    transition: background-color 0.3s;
}

.lesson-header:hover {
    background-color: #f8f9fa;
}

.lesson-indicator {
    width: 3px;
    height: 20px;
    background-color: #8a6baf;
    margin-left: 0.5rem;
    border-radius: 2px;
}

.lesson-title {
    flex-grow: 1;
}

.lesson-title h6 {
    margin: 0;
    font-size: 1rem;
    color: #1e2a38;
}

.lesson-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* تنسيقات الرسائل الفارغة */
.empty-message {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 1rem 0;
}

/* تنسيقات السحب والإفلات */
.ui-sortable-helper {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #e9ecef;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ===== تنسيقات صفحة الإشعارات ===== */

/* تحسينات بصرية للإشعارات - متناسقة مع ألوان الهيدر الداكنة */
.notifications-container {
    background: rgba(44, 62, 80, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    color: #ecf0f1;
    min-height: 80vh;
    backdrop-filter: blur(10px);
}

.notifications-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(52, 73, 94, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(44, 62, 80, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(52, 152, 219, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.notifications-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
}

.notifications-header h1 {
    color: #ecf0f1;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.notifications-header h1 i {
    color: #3498db;
    margin-left: 15px;
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.notifications-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.notifications-page .notifications-stats .stat-item {
    background: rgba(52, 73, 94, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 25px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.notifications-page .notifications-stats .stat-item:hover {
    transform: translateY(-5px);
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.notifications-page .notifications-stats .stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.notifications-page .notifications-stats .stat-label {
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* أدوات التحكم */
.notifications-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    background: rgba(52, 73, 94, 0.8);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    color: #ecf0f1;
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.notifications-page .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.notifications-page .btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.notifications-page .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 16px rgba(52, 152, 219, 0.4),
        0 0 20px rgba(52, 152, 219, 0.3);
}

.notifications-page .btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.notifications-page .btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 16px rgba(39, 174, 96, 0.4),
        0 0 20px rgba(39, 174, 96, 0.3);
}

.notifications-page .btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.notifications-page .btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 16px rgba(231, 76, 60, 0.4),
        0 0 20px rgba(231, 76, 60, 0.3);
}

/* قائمة الإشعارات */
.notifications-list {
    position: relative;
    z-index: 1;
}

.notification-item {
    background: rgba(52, 73, 94, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s;
}

.notification-item:hover::before {
    left: 100%;
}

.notification-item:hover {
    transform: translateX(10px);
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.3),
        0 0 20px rgba(52, 152, 219, 0.2);
}

.notification-item.unread {
    border-left: 4px solid #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.notification-item.read {
    opacity: 0.8;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.notification-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    margin-left: 15px;
    flex-shrink: 0;
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ecf0f1;
    margin-bottom: 8px;
    line-height: 1.4;
}

.notification-message {
    font-size: 0.95rem;
    color: #bdc3c7;
    line-height: 1.5;
    margin-bottom: 10px;
    min-height: 20px;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #95a5a6;
}

.notification-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-actions {
    display: flex;
    gap: 10px;
}

.notification-actions .btn {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* حالات التحميل والرسائل */
.no-notifications {
    text-align: center;
    padding: 60px 20px;
    color: #bdc3c7;
}

.no-notifications i {
    font-size: 4rem;
    color: #95a5a6;
    margin-bottom: 20px;
}

/* تأثيرات الانيميشن */
.notification-item {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.notification-item:nth-child(1) { animation-delay: 0.1s; }
.notification-item:nth-child(2) { animation-delay: 0.2s; }
.notification-item:nth-child(3) { animation-delay: 0.3s; }
.notification-item:nth-child(4) { animation-delay: 0.4s; }
.notification-item:nth-child(5) { animation-delay: 0.5s; }

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

/* تحسينات للأجهزة المحمولة - إدارة المنهج */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .add-btn {
        margin-top: 1rem;
    }
    
    .course-header, .unit-header, .lesson-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .course-actions, .unit-actions, .lesson-actions {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .course-indicator, .unit-indicator, .lesson-indicator {
        width: 100%;
        height: 3px;
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    
    /* تحسينات للأجهزة المحمولة - الإشعارات */
    .notifications-container {
        margin: 10px;
        padding: 20px;
    }
    
    .notifications-header h1 {
        font-size: 2rem;
    }
    
    .notifications-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .notifications-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .notification-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .notification-icon {
        margin: 0 auto 10px auto;
    }
    
    .notification-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .notification-actions {
        width: 100%;
        justify-content: center;
    }
}


/* تحسينات أحجام البطاقات والأزرار */

/* تقليل حجم بطاقات الإحصائيات في لوحة التحكم */
.dashboard .stat-card {
    padding: 15px !important;
    border-radius: 12px !important;
}

.dashboard .stat-icon {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.3rem !important;
    margin-bottom: 12px !important;
}

.dashboard .stat-info h3 {
    font-size: 1rem !important;
    margin-bottom: 8px !important;
}

.dashboard .stat-number {
    font-size: 2rem !important;
}

/* تقليل حجم أزرار الجداول */
.questions-table .btn,
.btn-edit,
.btn-delete {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
}

.questions-table .btn i {
    font-size: 0.75rem !important;
}

/* تقليل حجم بطاقات المهام السريعة */
.quick-action-card {
    padding: 18px !important;
    border-radius: 12px !important;
}

.quick-action-card i {
    font-size: 2rem !important;
    margin-bottom: 12px !important;
}

.quick-action-card span {
    font-size: 0.9rem !important;
}

/* تحسين تنسيق الجداول */
.questions-table th {
    padding: 12px 10px !important;
    font-size: 0.95rem !important;
}

.questions-table td {
    padding: 10px 8px !important;
    font-size: 0.85rem !important;
}

/* تحسين أحجام الأقسام */
.section {
    padding: 20px !important;
    border-radius: 15px !important;
}

.section-header h3 {
    font-size: 1.2rem !important;
}

/* تحسين النشاط الأخير */
.activity-item {
    padding: 12px !important;
    margin-bottom: 8px !important;
}

.activity-icon {
    width: 35px !important;
    height: 35px !important;
    font-size: 0.9rem !important;
    margin-left: 12px !important;
}

.activity-title {
    font-size: 0.9rem !important;
}

.activity-time {
    font-size: 0.8rem !important;
}

/* تحسين المساحات العامة */
.dashboard {
    padding: 25px !important;
    margin: 15px !important;
}

.stats-container {
    gap: 20px !important;
    margin-bottom: 30px !important;
}

.content-sections {
    gap: 25px !important;
}


/* تنسيقات شاملة لجميع الأزرار */

/* أزرار عامة */
.btn,
button,
input[type="submit"],
input[type="button"],
.button {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
}

/* أزرار اختيار الملف */
input[type="file"],
.file-input,
.custom-file-upload {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
}

/* أزرار الإزالة */
.remove-btn,
.delete-btn,
.btn-remove,
.btn[onclick*="remove"],
button[onclick*="remove"],
.btn:contains("إزالة"),
.btn:contains("×") {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    min-width: auto !important;
    border-radius: 4px !important;
}

/* أزرار الإضافة */
.add-btn,
.btn-add,
.btn-success,
.btn:contains("إضافة"),
.btn:contains("+") {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
}

/* أزرار التصفية */
.filter-btn,
.btn-filter,
.btn:contains("تطبيق"),
.btn:contains("إعادة"),
.btn:contains("تصفية") {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
}

/* أزرار النماذج */
form .btn,
form button,
form input[type="submit"] {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
}

/* أزرار صغيرة */
.btn-sm,
.btn-small,
.small-btn {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
}

/* أزرار كبيرة */
.btn-lg,
.btn-large,
.large-btn {
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
}

/* أزرار الجداول المحددة */
table .btn,
.table .btn,
.questions-table .btn,
.data-table .btn {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
    margin: 1px !important;
}

/* أزرار الأيقونات فقط */
.btn-icon,
.icon-btn,
.btn i:only-child {
    padding: 6px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 0.8rem !important;
    border-radius: 4px !important;
}

/* تحسين المسافات بين الأزرار */
.btn + .btn,
button + button,
.btn-group .btn {
    margin-right: 5px !important;
}

/* أزرار في الكروت */
.card .btn,
.stat-card .btn,
.notification-item .btn {
    padding: 5px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
}

/* أزرار التنقل */
.nav-btn,
.pagination .btn,
.page-btn {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
}

/* أزرار القوائم المنسدلة */
.dropdown-toggle,
.select-btn {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
}

/* تحسين أزرار الإشعارات */
.notifications-page .btn {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
}

/* تحسين أزرار إدارة المنهج */
.curriculum-container .btn,
.course-item .btn,
.unit-item .btn {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
}

/* تحسين الحقول والمدخلات */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 5px !important;
}

/* تحسين القوائم المنسدلة */
select {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
}

/* تحسين مربعات الاختيار */
input[type="checkbox"],
input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    margin: 2px !important;
}

/* تحسين التسميات */
label {
    font-size: 0.85rem !important;
    margin-bottom: 4px !important;
}

/* تحسين العناوين في النماذج */
.form-group label,
.form-label {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    margin-bottom: 6px !important;
}


/* تحسينات شاملة للعناصر المتبقية */

/* الرسائل والتنبيهات */
.alert,
.message,
.notification,
.toast,
.flash-message {
    padding: 10px 15px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
}

.alert-success,
.message-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
    border: 1px solid rgba(40, 167, 69, 0.3) !important;
    color: #155724 !important;
}

.alert-danger,
.message-error {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
    color: #721c24 !important;
}

.alert-warning,
.message-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    color: #856404 !important;
}

.alert-info,
.message-info {
    background-color: rgba(23, 162, 184, 0.1) !important;
    border: 1px solid rgba(23, 162, 184, 0.3) !important;
    color: #0c5460 !important;
}

/* النوافذ المنبثقة */
.modal,
.popup,
.dialog {
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

.modal-header,
.popup-header {
    padding: 12px 20px !important;
    border-bottom: 1px solid #dee2e6 !important;
    border-radius: 8px 8px 0 0 !important;
}

.modal-title,
.popup-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.modal-body,
.popup-body {
    padding: 15px 20px !important;
    font-size: 0.9rem !important;
}

.modal-footer,
.popup-footer {
    padding: 10px 20px !important;
    border-top: 1px solid #dee2e6 !important;
    border-radius: 0 0 8px 8px !important;
}

/* أزرار الإغلاق */
.close,
.btn-close,
.close-btn {
    padding: 4px 8px !important;
    font-size: 1.2rem !important;
    border: none !important;
    background: none !important;
    opacity: 0.7 !important;
    cursor: pointer !important;
}

.close:hover,
.btn-close:hover {
    opacity: 1 !important;
}

/* مربعات البحث */
.search-box,
.search-input,
input[type="search"] {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
    border: 1px solid #ced4da !important;
    background-color: #f8f9fa !important;
}

.search-box:focus,
.search-input:focus {
    outline: none !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25) !important;
}

/* أزرار التبديل */
.toggle,
.switch,
.checkbox-toggle {
    width: 40px !important;
    height: 20px !important;
    border-radius: 10px !important;
    position: relative !important;
    background-color: #ced4da !important;
    transition: all 0.3s ease !important;
}

.toggle.active,
.switch.active {
    background-color: #007bff !important;
}

/* مؤشرات التحميل */
.spinner,
.loading,
.loader {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #f3f3f3 !important;
    border-top: 2px solid #007bff !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

.spinner-large,
.loading-large {
    width: 40px !important;
    height: 40px !important;
    border-width: 4px !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* التبويبات */
.nav-tabs,
.tabs {
    border-bottom: 1px solid #dee2e6 !important;
    margin-bottom: 15px !important;
}

.nav-tabs .nav-link,
.tabs .tab {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 4px 4px 0 0 !important;
    border: 1px solid transparent !important;
    color: #495057 !important;
}

.nav-tabs .nav-link.active,
.tabs .tab.active {
    background-color: #fff !important;
    border-color: #dee2e6 #dee2e6 #fff !important;
    color: #007bff !important;
}

/* الأكورديون */
.accordion,
.collapse-container {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.accordion-header,
.collapse-header {
    padding: 10px 15px !important;
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

.accordion-body,
.collapse-body {
    padding: 15px !important;
    font-size: 0.85rem !important;
}

/* الشارات والعلامات */
.badge,
.tag,
.label {
    padding: 3px 8px !important;
    font-size: 0.7rem !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
    display: inline-block !important;
}

.badge-primary { background-color: #007bff !important; color: white !important; }
.badge-success { background-color: #28a745 !important; color: white !important; }
.badge-danger { background-color: #dc3545 !important; color: white !important; }
.badge-warning { background-color: #ffc107 !important; color: #212529 !important; }
.badge-info { background-color: #17a2b8 !important; color: white !important; }

/* التنقل والصفحات */
.pagination {
    margin: 15px 0 !important;
}

.pagination .page-link {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 4px !important;
    margin: 0 2px !important;
    border: 1px solid #dee2e6 !important;
}

.pagination .page-link:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
}

.pagination .page-item.active .page-link {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

/* القوائم المنسدلة */
.dropdown-menu {
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    padding: 5px 0 !important;
}

.dropdown-item {
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
    color: #212529 !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #007bff !important;
}

/* الفواصل */
.divider,
.separator,
hr {
    margin: 15px 0 !important;
    border: none !important;
    height: 1px !important;
    background-color: #dee2e6 !important;
}

/* النصوص المساعدة */
.help-text,
.form-text,
.small-text {
    font-size: 0.75rem !important;
    color: #6c757d !important;
    margin-top: 4px !important;
}

/* الأيقونات */
.icon,
.fa,
.fas,
.far {
    font-size: 0.9rem !important;
}

.icon-large,
.fa-lg {
    font-size: 1.2rem !important;
}

.icon-small,
.fa-sm {
    font-size: 0.75rem !important;
}

/* تحسين الجداول المتقدمة */
.table-responsive {
    border-radius: 6px !important;
    overflow: hidden !important;
}

.table thead th {
    padding: 10px 8px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

.table tbody td {
    padding: 8px !important;
    font-size: 0.8rem !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02) !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.05) !important;
}

/* تحسين النماذج المتقدمة */
.form-group {
    margin-bottom: 15px !important;
}

.form-control {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 5px !important;
    border: 1px solid #ced4da !important;
}

.form-control:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25) !important;
}

.form-control-sm {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
}

.form-control-lg {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
}

/* تحسين الكروت */
.card {
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.card-header {
    padding: 12px 16px !important;
    background-color: #f8f9fa !important;
    border-bottom: 1px solid rgba(0,0,0,0.1) !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

.card-body {
    padding: 16px !important;
    font-size: 0.85rem !important;
}

.card-footer {
    padding: 10px 16px !important;
    background-color: #f8f9fa !important;
    border-top: 1px solid rgba(0,0,0,0.1) !important;
    font-size: 0.8rem !important;
}

/* تحسين التجاوب العام */
@media (max-width: 768px) {
    .btn,
    button {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
    }
    
    .modal-dialog {
        margin: 10px !important;
    }
    
    .table {
        font-size: 0.75rem !important;
    }
    
    .card {
        margin-bottom: 10px !important;
    }
}


/* إصلاح تنسيق الجداول المحسن */
.questions-table,
.data-table,
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    background-color: transparent !important;
}

.questions-table th,
.data-table th,
table th {
    padding: 15px 20px !important;
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border: none !important;
    vertical-align: middle !important;
}

.questions-table td,
.data-table td,
table td {
    padding: 15px 20px !important;
    text-align: center !important;
    font-size: 0.95rem !important;
    border: none !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

.questions-table tbody tr,
.data-table tbody tr,
table tbody tr {
    transition: all 0.3s ease !important;
    background-color: rgba(52, 73, 94, 0.8) !important;
}

.questions-table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
    background-color: rgba(44, 62, 80, 0.9) !important;
}

.questions-table tbody tr:hover,
.data-table tbody tr:hover,
table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.3) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2) !important;
}

/* تحسين الأزرار في الجداول */
.questions-table .btn,
.data-table .btn,
table .btn {
    padding: 8px 16px !important;
    margin: 2px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 80px !important;
    text-decoration: none !important;
}

.questions-table .btn i,
.data-table .btn i,
table .btn i {
    margin-left: 6px !important;
    font-size: 0.9rem !important;
}

.questions-table .btn-primary,
.data-table .btn-primary,
table .btn-primary {
    background-color: #3498db !important;
    color: white !important;
}

.questions-table .btn-primary:hover,
.data-table .btn-primary:hover,
table .btn-primary:hover {
    background-color: #2980b9 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3) !important;
}

.questions-table .btn-danger,
.data-table .btn-danger,
table .btn-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

.questions-table .btn-danger:hover,
.data-table .btn-danger:hover,
table .btn-danger:hover {
    background-color: #c0392b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3) !important;
}

/* تحسين توزيع الأعمدة */
.questions-table th:first-child,
.data-table th:first-child,
table th:first-child {
    width: 60px !important;
    text-align: center !important;
}

.questions-table th:last-child,
.data-table th:last-child,
table th:last-child {
    width: 150px !important;
    text-align: center !important;
}

.questions-table td:first-child,
.data-table td:first-child,
table td:first-child {
    width: 60px !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: #3498db !important;
}

.questions-table td:last-child,
.data-table td:last-child,
table td:last-child {
    width: 150px !important;
    text-align: center !important;
}

/* تحسين النصوص */
.questions-table td:nth-child(2),
.data-table td:nth-child(2),
table td:nth-child(2) {
    text-align: right !important;
    padding-right: 25px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

.questions-table td:nth-child(3),
.data-table td:nth-child(3),
table td:nth-child(3) {
    text-align: center !important;
    font-weight: 500 !important;
    color: #bdc3c7 !important;
}


/* تنسيقات متجاوبة للأجهزة المحمولة */

/* الأجهزة اللوحية والشاشات المتوسطة */
@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }
    
    .stat-number {
        font-size: 1.8rem !important;
    }
}

/* الهواتف المحمولة */
@media (max-width: 768px) {
    /* بطاقات الإحصائيات */
    .stats-container {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }
    
    .stat-card {
        padding: 0.8rem !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.9rem !important;
    }
    
    /* الجداول المتجاوبة */
    .questions-table,
    .data-table,
    table {
        font-size: 0.8rem !important;
        overflow-x: auto !important;
        display: block !important;
        white-space: nowrap !important;
    }
    
    .questions-table thead,
    .data-table thead,
    table thead {
        display: block !important;
    }
    
    .questions-table tbody,
    .data-table tbody,
    table tbody {
        display: block !important;
        max-height: 400px !important;
        overflow-y: auto !important;
    }
    
    .questions-table tr,
    .data-table tr,
    table tr {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
    }
    
    .questions-table th,
    .data-table th,
    table th {
        padding: 8px 6px !important;
        font-size: 0.75rem !important;
    }
    
    .questions-table td,
    .data-table td,
    table td {
        padding: 8px 6px !important;
        font-size: 0.75rem !important;
    }
    
    /* الأزرار في الجداول */
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        min-width: 60px !important;
        margin: 1px !important;
    }
    
    .questions-table .btn i,
    .data-table .btn i,
    table .btn i {
        font-size: 0.7rem !important;
        margin-left: 3px !important;
    }
    
    /* تحسين عرض الأعمدة */
    .questions-table th:first-child,
    .data-table th:first-child,
    table th:first-child {
        width: 40px !important;
    }
    
    .questions-table th:last-child,
    .data-table th:last-child,
    table th:last-child {
        width: 120px !important;
    }
    
    .questions-table td:first-child,
    .data-table td:first-child,
    table td:first-child {
        width: 40px !important;
        font-size: 0.7rem !important;
    }
    
    .questions-table td:last-child,
    .data-table td:last-child,
    table td:last-child {
        width: 120px !important;
    }
    
    /* المهام السريعة */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem !important;
    }
    
    .action-card {
        padding: 1rem !important;
    }
    
    .action-icon {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .action-title {
        font-size: 0.9rem !important;
    }
    
    /* النشاط الأخير */
    .recent-activity {
        padding: 1rem !important;
    }
    
    .activity-item {
        padding: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .activity-text {
        font-size: 0.8rem !important;
    }
    
    .activity-time {
        font-size: 0.7rem !important;
    }
    
    /* أداء المناهج */
    .performance-section {
        padding: 1rem !important;
    }
    
    .performance-item {
        margin-bottom: 1rem !important;
    }
    
    .performance-label {
        font-size: 0.9rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .performance-stats {
        font-size: 0.8rem !important;
    }
    
    .progress-bar {
        height: 6px !important;
    }
}

/* الهواتف الصغيرة جداً */
@media (max-width: 480px) {
    /* تحسينات إضافية للشاشات الصغيرة جداً */
    .questions-table,
    .data-table,
    table {
        font-size: 0.7rem !important;
    }
    
    .questions-table th,
    .data-table th,
    table th {
        padding: 6px 4px !important;
        font-size: 0.7rem !important;
    }
    
    .questions-table td,
    .data-table td,
    table td {
        padding: 6px 4px !important;
        font-size: 0.7rem !important;
    }
    
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
        min-width: 50px !important;
    }
    
    .quick-actions {
        grid-template-columns: 1fr !important;
    }
    
    .stat-card {
        padding: 0.6rem !important;
    }
    
    .stat-number {
        font-size: 1.3rem !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
    }
}

/* تحسينات عامة للمس */
@media (hover: none) and (pointer: coarse) {
    /* تحسينات للأجهزة التي تعتمد على اللمس */
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 8px 12px !important;
    }
    
    .action-card {
        min-height: 80px !important;
    }
    
    .stat-card {
        min-height: 60px !important;
    }
    
    /* إزالة تأثيرات hover للأجهزة اللمسية */
    .questions-table tbody tr:hover,
    .data-table tbody tr:hover,
    table tbody tr:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .questions-table .btn:hover,
    .data-table .btn:hover,
    table .btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}


/* تحسينات متجاوبة شاملة للأجهزة المحمولة */

/* الشاشات الصغيرة جداً (أقل من 480px) */
@media (max-width: 480px) {
    /* تحسين الجداول للشاشات الصغيرة جداً */
    .questions-table,
    .data-table,
    table {
        font-size: 0.7rem !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    .questions-table th,
    .data-table th,
    table th {
        padding: 8px 6px !important;
        font-size: 0.75rem !important;
        min-width: 80px !important;
    }
    
    .questions-table td,
    .data-table td,
    table td {
        padding: 8px 6px !important;
        font-size: 0.7rem !important;
        min-width: 80px !important;
    }
    
    /* أزرار أصغر للشاشات الصغيرة */
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        min-width: 60px !important;
        margin: 1px !important;
    }
    
    /* بطاقات الإحصائيات مكدسة */
    .stat-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 0.6rem !important;
    }
    
    .stat-icon {
        margin-bottom: 0.5rem !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
    
    .stat-number {
        font-size: 1.3rem !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
    }
}

/* تحسينات عامة للمس */
@media (hover: none) and (pointer: coarse) {
    /* تحسينات للأجهزة التي تعتمد على اللمس */
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 8px 12px !important;
    }
    
    .action-card {
        min-height: 80px !important;
    }
    
    .stat-card {
        min-height: 60px !important;
    }
    
    /* إزالة تأثيرات hover للأجهزة اللمسية */
    .questions-table tbody tr:hover,
    .data-table tbody tr:hover,
    table tbody tr:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .questions-table .btn:hover,
    .data-table .btn:hover,
    table .btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* تحسين التنقل والقوائم للأجهزة المحمولة */
@media (max-width: 768px) {
    /* القائمة الجانبية */
    .sidebar {
        width: 100% !important;
        position: static !important;
        height: auto !important;
    }
    
    /* المحتوى الرئيسي */
    .main-content {
        margin-right: 0 !important;
        padding: 1rem !important;
    }
    
    /* العناوين */
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    /* النماذج */
    .form-group {
        margin-bottom: 1rem !important;
    }
    
    .form-control {
        padding: 10px !important;
        font-size: 16px !important; /* منع التكبير التلقائي في iOS */
    }
    
    /* الأزرار العامة */
    .btn {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* أزرار في نفس السطر */
    .btn-group .btn {
        width: auto !important;
        flex: 1 !important;
        margin-bottom: 0 !important;
        margin-left: 0.25rem !important;
    }
    
    .btn-group .btn:first-child {
        margin-left: 0 !important;
    }
    
    /* الكروت */
    .card {
        margin-bottom: 1rem !important;
        border-radius: 8px !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* الرسائل والتنبيهات */
    .alert {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* النوافذ المنبثقة */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100vw - 1rem) !important;
    }
    
    .modal-content {
        border-radius: 8px !important;
    }
    
    /* التبويبات */
    .nav-tabs {
        flex-wrap: wrap !important;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* التنقل بين الصفحات */
    .pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        margin: 0.1rem !important;
    }
}

/* تحسينات للشاشات العريضة */
@media (min-width: 1200px) {
    .stats-container {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .questions-table th,
    .data-table th,
    table th {
        padding: 18px 25px !important;
        font-size: 1.1rem !important;
    }
    
    .questions-table td,
    .data-table td,
    table td {
        padding: 18px 25px !important;
        font-size: 1rem !important;
    }
    
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        min-width: 100px !important;
    }
}

/* تحسين الطباعة */
@media print {
    .btn,
    .sidebar,
    .nav-tabs,
    .pagination {
        display: none !important;
    }
    
    .questions-table,
    .data-table,
    table {
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    .questions-table th,
    .questions-table td,
    .data-table th,
    .data-table td,
    table th,
    table td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        font-size: 0.8rem !important;
    }
    
    .stat-card {
        border: 1px solid #000 !important;
        margin-bottom: 1rem !important;
        page-break-inside: avoid !important;
    }
}

/* تحسين إمكانية الوصول */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تحسين للوضع الداكن */
@media (prefers-color-scheme: dark) {
    .questions-table tbody tr {
        background-color: rgba(30, 30, 30, 0.9) !important;
    }
    
    .questions-table tbody tr:nth-child(even) {
        background-color: rgba(40, 40, 40, 0.9) !important;
    }
    
    .questions-table tbody tr:hover {
        background-color: rgba(52, 152, 219, 0.2) !important;
    }
    
    .stat-card {
        background-color: rgba(30, 30, 30, 0.9) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    .card {
        background-color: rgba(30, 30, 30, 0.9) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
}

/* تحسين للشاشات عالية الكثافة */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .questions-table .btn,
    .data-table .btn,
    table .btn {
        border: none !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    }
    
    .stat-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
}

/* تحسين التمرير الأفقي للجداول */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
}

@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-bottom: 1rem !important;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 8px !important;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 4px !important;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(52, 152, 219, 0.6) !important;
        border-radius: 4px !important;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: rgba(52, 152, 219, 0.8) !important;
    }
}

/* تحسين الأداء للأجهزة المحمولة */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    input,
    textarea,
    select {
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
    
    .questions-table,
    .data-table,
    table {
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        will-change: scroll-position !important;
    }
}



/* تحسينات التخطيط للشاشات الصغيرة */

/* نظام شبكة مرن للأجهزة المحمولة */
@media (max-width: 768px) {
    
    /* تخطيط الحاوية الرئيسية */
    .container,
    .main-container {
        padding: 0.5rem !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    /* تخطيط الصفوف والأعمدة */
    .row {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .col,
    .column,
    [class*="col-"] {
        padding: 0.25rem !important;
        margin-bottom: 0.5rem !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* تخطيط مرن للمحتوى */
    .content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* تحسين المسافات */
    .section,
    .content-section {
        margin-bottom: 1rem !important;
        padding: 0.75rem !important;
    }
    
    /* تحسين العناوين والنصوص */
    .page-title,
    .section-title {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem !important;
        text-align: center !important;
    }
    
    .page-subtitle,
    .section-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
        text-align: center !important;
    }
    
    /* تحسين القوائم */
    .nav,
    .navigation {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .nav-item,
    .nav-link {
        width: 100% !important;
        text-align: center !important;
        padding: 0.75rem !important;
        margin-bottom: 0.25rem !important;
        border-radius: 6px !important;
    }
    
    /* تحسين الشريط الجانبي */
    .sidebar {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 1rem !important;
        order: -1 !important;
    }
    
    .sidebar-content {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: center !important;
    }
    
    .sidebar-item {
        flex: 1 1 auto !important;
        min-width: 120px !important;
        text-align: center !important;
    }
    
    /* تحسين المحتوى الرئيسي */
    .main-content {
        margin: 0 !important;
        padding: 0.5rem !important;
        width: 100% !important;
    }
    
    /* تحسين الهيدر والفوتر */
    .header {
        padding: 0.5rem !important;
        text-align: center !important;
    }
    
    .header-content {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .header-title {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }
    
    .header-actions {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    
    .footer {
        padding: 1rem 0.5rem !important;
        text-align: center !important;
    }
    
    .footer-content {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

/* تحسينات خاصة للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    
    /* تقليل المسافات أكثر */
    .container,
    .main-container {
        padding: 0.25rem !important;
    }
    
    .section,
    .content-section {
        padding: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* تحسين النصوص */
    .page-title {
        font-size: 1.1rem !important;
    }
    
    .section-title {
        font-size: 1rem !important;
    }
    
    /* تحسين الأزرار */
    .btn-group {
        flex-direction: column !important;
        gap: 0.25rem !important;
    }
    
    .btn-group .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* تحسين النماذج */
    .form-row {
        flex-direction: column !important;
    }
    
    .form-group {
        margin-bottom: 0.75rem !important;
    }
    
    .form-control {
        font-size: 16px !important; /* منع التكبير في iOS */
    }
    
    /* تحسين الجداول للشاشات الصغيرة جداً */
    .table-responsive {
        font-size: 0.65rem !important;
    }
    
    .questions-table th,
    .data-table th,
    table th {
        padding: 6px 4px !important;
        font-size: 0.7rem !important;
    }
    
    .questions-table td,
    .data-table td,
    table td {
        padding: 6px 4px !important;
        font-size: 0.65rem !important;
    }
}

/* تحسين التخطيط للاتجاه الأفقي على الأجهزة المحمولة */
@media (max-width: 768px) and (orientation: landscape) {
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .stat-card {
        padding: 0.5rem !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .stat-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.9rem !important;
    }
    
    .stat-number {
        font-size: 1.2rem !important;
    }
    
    .sidebar {
        display: flex !important;
        flex-direction: row !important;
        height: auto !important;
        overflow-x: auto !important;
    }
    
    .sidebar-item {
        flex: 0 0 auto !important;
        min-width: 100px !important;
        margin-left: 0.25rem !important;
    }
}

/* تحسين التخطيط المرن */
.flex-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
}

@media (max-width: 768px) {
    .flex-container {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .flex-item {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }
}

/* تحسين الشبكة التلقائية */
.auto-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1rem !important;
}

@media (max-width: 768px) {
    .auto-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .auto-grid {
        gap: 0.25rem !important;
    }
}

/* تحسين التخطيط للكروت */
.card-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .card-grid {
        gap: 0.75rem !important;
    }
}

/* تحسين التخطيط للنماذج */
.form-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1rem !important;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* تحسين التخطيط للأزرار */
.button-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .button-group .btn {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* تحسين التخطيط للمحتوى المختلط */
.mixed-content {
    display: grid !important;
    grid-template-columns: 1fr 300px !important;
    gap: 2rem !important;
}

@media (max-width: 1024px) {
    .mixed-content {
        grid-template-columns: 1fr 250px !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .mixed-content {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* تحسين التخطيط للقوائم */
.list-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.list-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.75rem !important;
    border-radius: 6px !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

@media (max-width: 768px) {
    .list-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    .list-item-content {
        width: 100% !important;
    }
    
    .list-item-actions {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        gap: 0.25rem !important;
    }
}

/* تحسين التخطيط للإحصائيات */
.stats-layout {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
}

@media (max-width: 1024px) {
    .stats-layout {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .stats-layout {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* تحسين التخطيط للمحتوى الجانبي */
.sidebar-layout {
    display: grid !important;
    grid-template-columns: 250px 1fr !important;
    gap: 2rem !important;
    min-height: 100vh !important;
}

@media (max-width: 1024px) {
    .sidebar-layout {
        grid-template-columns: 200px 1fr !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .sidebar-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        min-height: auto !important;
    }
}

/* تحسين التخطيط للتبويبات */
.tabs-layout {
    display: flex !important;
    flex-direction: column !important;
}

.tabs-nav {
    display: flex !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 1rem !important;
}

@media (max-width: 768px) {
    .tabs-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.25rem !important;
        border-bottom: none !important;
        margin-bottom: 0.5rem !important;
    }
    
    .tabs-nav .nav-link {
        flex: 1 1 auto !important;
        min-width: 80px !important;
        text-align: center !important;
        border-radius: 6px !important;
        margin-bottom: 0.25rem !important;
    }
}

/* تحسين التخطيط للمحتوى المتدفق */
.flow-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

@media (max-width: 768px) {
    .flow-content {
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .flow-content {
        gap: 0.75rem !important;
    }
}

/* تحسين التخطيط للعناصر الثابتة */
.sticky-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background-color: rgba(44, 62, 80, 0.95) !important;
    backdrop-filter: blur(10px) !important;
}

@media (max-width: 768px) {
    .sticky-header {
        position: static !important;
        backdrop-filter: none !important;
    }
}

/* تحسين التخطيط للمحتوى المتمركز */
.centered-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 50vh !important;
    padding: 2rem !important;
}

@media (max-width: 768px) {
    .centered-content {
        min-height: 40vh !important;
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .centered-content {
        min-height: 30vh !important;
        padding: 0.5rem !important;
    }
}






/* CSS شارة الإشعارات الحمراء - للجميع الصفحات */
.notifications-nav-link {
    white-space: nowrap;
}

.notification-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.notification-icon-wrapper i {
    animation: bellRing 2s infinite;
}

.nav-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c !important;
    color: white !important;
    border-radius: 50%;
    padding: 4px 7px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 3px 8px rgba(231, 76, 60, 0.6);
    animation: pulse 2s infinite;
    line-height: 1;
    text-align: center;
    z-index: 999;
}

@keyframes bellRing {
    0%, 50%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 
            0 3px 8px rgba(231, 76, 60, 0.6);
    }
    50% { 
        transform: scale(1.15); 
        box-shadow: 
            0 4px 12px rgba(231, 76, 60, 0.8),
            0 0 20px rgba(231, 76, 60, 0.4);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 
            0 3px 8px rgba(231, 76, 60, 0.6);
    }
}

/* تحسين تنسيق شريط التنقل للإشعارات */
nav ul li a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==== Imported from form.html inline <style> ==== */

        
        /* تنسيق الرسائل المؤقتة */
        .flash {
            padding: 0.75rem 1.25rem;
            margin-bottom: 1rem;
            border-radius: 0.25rem;
        }
        
        .alert-success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .alert-danger {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        .alert-warning {
            background-color: #fff3cd;
            color: #856404;
            border: 1px solid #ffeeba;
        }
        
        .alert-info {
            background-color: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
         
        /* تنسيق الجزيئات في الخلفية */
        .particles-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            overflow: hidden;
        }
        
        .particle {
            position: absolute;
            border-radius: 50%;
            opacity: 0.3;
        }
        
        .p1 { background-color: #4ecdc4; width: 10px; height: 10px; top: 20%; left: 10%; }
        .p2 { background-color: #ff6b6b; width: 15px; height: 15px; top: 30%; left: 20%; }
        .p3 { background-color: #ffbe0b; width: 12px; height: 12px; top: 40%; left: 30%; }
        .p4 { background-color: #8a6baf; width: 8px; height: 8px; top: 50%; left: 40%; }
        .p5 { background-color: #4ecdc4; width: 10px; height: 10px; top: 60%; left: 50%; }
        .p6 { background-color: #ff6b6b; width: 14px; height: 14px; top: 70%; left: 60%; }
        .p7 { background-color: #ffbe0b; width: 9px; height: 9px; top: 80%; left: 70%; }
        .p8 { background-color: #8a6baf; width: 11px; height: 11px; top: 90%; left: 80%; }
        .p9 { background-color: #4ecdc4; width: 13px; height: 13px; top: 25%; left: 85%; }
        .p10 { background-color: #ff6b6b; width: 7px; height: 7px; top: 75%; left: 15%; }
        
        /* تنسيق للشاشات الصغيرة */
        @media (max-width: 768px) {
            nav ul {
                flex-direction: column;
            }
            
            nav a {
                text-align: center;
            }
            
            .logo h1 {
                font-size: 1.4rem;
            }
            
            .footer-content {
                text-align: center;
            }
            
            .footer-links {
                flex-direction: column;
                align-items: center;
                gap: 0.5rem;
            }
        }

        /* تنسيقات النموذج المخصصة */
        .form-container {
            margin-top: 20px;
        }

        .page-title {
            text-align: right;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #dee2e6;
            color: #333;
            font-size: 1.8rem;
        }

        .card {
            border: 1px solid #dee2e6;
            border-radius: 4px;
            margin-bottom: 20px;
            background-color: #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }

        .card-header {
            background-color: #f8f9fa;
            padding: 10px 15px;
            border-bottom: 1px solid #dee2e6;
            font-weight: bold;
        }

        .card-body {
            padding: 15px;
        }

        .form-label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
        }

        .form-control {
            display: block;
            width: 100%;
            padding: 8px 12px;
            font-size: 1rem;
            line-height: 1.5;
            color: #495057;
            background-color: #fff;
            background-clip: padding-box;
            border: 1px solid #ced4da;
            border-radius: 4px;
            transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
        }

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

        textarea.form-control {
            min-height: 120px;
            resize: vertical;
        }

        .form-select {
            display: block;
            width: 100%;
            padding: 8px 12px;
            font-size: 1rem;
            font-weight: 400;
            line-height: 1.5;
            color: #495057;
            background-color: #fff;
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: left 0.75rem center;
            background-size: 16px 12px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            appearance: none;
        }

        .form-select:focus {
            border-color: #80bdff;
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }

        .form-text {
            margin-top: 5px;
            font-size: 0.875rem;
            color: #6c757d;
        }

        .btn {
            display: inline-block;
            font-weight: 400;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            user-select: none;
            border: 1px solid transparent;
            padding: 8px 12px;
            font-size: 1rem;
            line-height: 1.5;
            border-radius: 4px;
            transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
            cursor: pointer;
        }

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

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

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

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

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

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

        .btn-danger {
            color: #fff;
            background-color: #dc3545;
            border-color: #dc3545;
        }

        .btn-danger:hover {
            color: #fff;
            background-color: #c82333;
            border-color: #bd2130;
        }

        .btn-sm {
            padding: 4px 8px;
            font-size: 0.875rem;
            line-height: 1.5;
            border-radius: 3px;
        }

        .text-danger {
            color: #dc3545;
        }

        .mb-3 {
            margin-bottom: 1rem;
        }

        .mt-2 {
            margin-top: 0.5rem;
        }

        .mt-1 {
            margin-top: 0.25rem;
        }

        .d-block {
            display: block;
        }

        .d-flex {
            display: flex;
        }

        .justify-content-between {
            justify-content: space-between;
        }

        .align-items-center {
            align-items: center;
        }

        .w-100 {
            width: 100%;
        }

        .img-thumbnail {
            padding: 0.25rem;
            background-color: #fff;
            border: 1px solid #dee2e6;
            border-radius: 0.25rem;
            max-width: 100%;
            height: auto;
        }

        .border {
            border: 1px solid #dee2e6;
        }

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

        .rounded {
            border-radius: 4px;
        }

        .p-2 {
            padding: 0.5rem;
        }

        .p-3 {
            padding: 1rem;
        }

        .bg-light {
            background-color: #f8f9fa;
        }

        .option-group {
            position: relative;
        }

        .remove-option-btn {
            position: absolute;
            top: 10px;
            right: 10px;
        }

        /* تنسيق خاص بتخطيط العمودين */
        .row {
            display: flex;
            flex-wrap: wrap;
            margin-right: -15px;
            margin-left: -15px;
        }

        .col-md-6 {
            flex: 0 0 50%;
            max-width: 50%;
            padding-right: 15px;
            padding-left: 15px;
            box-sizing: border-box;
        }
        
        .col-md-4 {
            flex: 0 0 33.333333%;
            max-width: 33.333333%;
            padding-right: 15px;
            padding-left: 15px;
            box-sizing: border-box;
        }

        @media (max-width: 768px) {
            .col-md-6, .col-md-4 {
                flex: 0 0 100%;
                max-width: 100%;
            }
        }

        /* تنسيقات النافذة المنبثقة للتحليل التلقائي */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
        }

        .modal-content {
            background-color: #fefefe;
            margin: 5% auto;
            padding: 20px;
            border: none;
            border-radius: 8px;
            width: 80%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #dee2e6;
        }

        .modal-title {
            margin: 0;
            font-size: 1.5rem;
            color: #333;
        }

        .close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #999;
        }

        .close:hover {
            color: #333;
        }

        .auto-analyzer-btn {
            background: linear-gradient(45deg, #007bff, #0056b3);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            font-size: 1rem;
            cursor: pointer;
            margin-bottom: 20px;
            transition: all 0.3s ease;
        }

        .auto-analyzer-btn:hover {
            background: linear-gradient(45deg, #0056b3, #004085);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .analyze-textarea {
            width: 100%;
            min-height: 200px;
            padding: 15px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-size: 14px;
            line-height: 1.5;
            resize: vertical;
        }

        .analyze-textarea:focus {
            border-color: #80bdff;
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }

        .btn-analyze {
            background-color: #28a745;
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 4px;
            font-size: 1rem;
            cursor: pointer;
            margin-top: 15px;
        }

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

        .analysis-status {
            margin-top: 10px;
            padding: 10px;
            border-radius: 4px;
            display: none;
        }

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

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

/* 🎯 ضبط أدق لتباعد أزرار الترقيم */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem; /* تقليل المسافة بين الأزرار */
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.pagination .page-item {
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
}

.pagination .page-link {
  display: inline-block;
  padding: 6px 10px;  /* تقليل الهوامش الداخلية */
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #007bff;
  font-size: 13.5px;
  text-decoration: none;
  min-width: 36px;
  text-align: center;
  transition: background-color 0.2s ease-in-out;
}

.pagination .page-link:hover {
  background-color: #f0f0f0;
}

.pagination .page-item.active .page-link {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
  font-weight: bold;
}

/* === جدول محسن === */
table.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
}

table.table thead {
  background-color: #007bff;
  color: white;
  text-align: right;
}

table.table th,
table.table td {
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: #f9f9f9;
}

.table-striped tbody tr:nth-of-type(even) {
  background-color: #ffffff;
}

.table-bordered {
  border: 1px solid #dee2e6;
}

/* ----------------------------------------------------
 تنسيقات عرض البطاقات للأسئلة
---------------------------------------------------- */

/* أزرار التبديل بين العرضين */
.view-toggle {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle .btn {
    border-radius: 0;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.view-toggle .btn:first-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.view-toggle .btn:last-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.view-toggle .btn.active {
    background-color: var(--primary-color, #3498db);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.view-toggle .btn:not(.active) {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.view-toggle .btn:not(.active):hover {
    background-color: #e9ecef;
    color: #495057;
}

/* حاوي العرض */
.view-container {
    transition: opacity 0.3s ease;
}

/* تنسيقات البطاقات */
.question-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #3498db);
}

/* رأس البطاقة */
.question-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color, #2c3e50);
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-card-title i {
    color: var(--primary-color, #3498db);
    font-size: 18px;
}

.question-card-badge .badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* جسم البطاقة */
. {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-text-container {
    flex: 1;
}

.question-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin: 0;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-right: 4px solid var(--primary-color, #3498db);
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* تفاصيل السؤال */
.question-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 0;
}

.detail-item i {
    color: var(--secondary-color, #2ecc71);
    width: 16px;
    text-align: center;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 50px;
}

.detail-value {
    color: #495057;
    font-weight: 500;
}

/* ذيل البطاقة */
.question-card-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.card-actions .btn {
    flex: 1;
    max-width: 100px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.card-actions .btn i {
    font-size: 11px;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .view-toggle {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .view-toggle .btn {
        flex: 1;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .question-card-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .question-card-body {
        padding: 15px;
    }
    
    .question-card-footer {
        padding: 12px 15px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        max-width: none;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1200px) {
    .row-cols-xl-3 > * {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}

/* تأثيرات إضافية للبطاقات */
.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent var(--primary-color, #3498db) transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.question-card:hover::before {
    opacity: 0.1;
}

/* تنسيق خاص للبطاقات الفارغة */
.question-card .question-text:empty::before {
    content: 'لا يوجد نص للسؤال';
    color: #6c757d;
    font-style: italic;
}

/* تحسين عرض الأرقام في البطاقات */
.question-card-title {
    position: relative;
}

.question-card-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(to left, var(--primary-color, #3498db), transparent);
}

/* تأثير التحميل للبطاقات */
.question-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.question-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}



/* ----------------------------------------------------
 تنسيقات عرض البطاقات للأسئلة
---------------------------------------------------- */

/* أزرار التبديل بين العرضين */
.view-toggle {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle .btn {
    border-radius: 0;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.view-toggle .btn:first-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.view-toggle .btn:last-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.view-toggle .btn.active {
    background-color: var(--primary-color, #3498db);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.view-toggle .btn:not(.active) {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.view-toggle .btn:not(.active):hover {
    background-color: #e9ecef;
    color: #495057;
}

/* حاوي العرض */
.view-container {
    transition: opacity 0.3s ease;
}

/* تنسيقات البطاقات */
.question-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #3498db);
}

/* رأس البطاقة */
.question-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color, #2c3e50);
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-card-title i {
    color: var(--primary-color, #3498db);
    font-size: 18px;
}

.question-card-badge .badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* جسم البطاقة */
.question-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-text-container {
    flex: 1;
}

.question-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin: 0;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-right: 4px solid var(--primary-color, #3498db);
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* تفاصيل السؤال */
.question-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 0;
}

.detail-item i {
    color: var(--secondary-color, #2ecc71);
    width: 16px;
    text-align: center;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 50px;
}

.detail-value {
    color: #495057;
    font-weight: 500;
}

/* ذيل البطاقة */
.question-card-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.card-actions .btn {
    flex: 1;
    max-width: 100px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.card-actions .btn i {
    font-size: 11px;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .view-toggle {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .view-toggle .btn {
        flex: 1;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .question-card-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .question-card-body {
        padding: 15px;
    }
    
    .question-card-footer {
        padding: 12px 15px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        max-width: none;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1200px) {
    .row-cols-xl-3 > * {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}

/* تأثيرات إضافية للبطاقات */
.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent var(--primary-color, #3498db) transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.question-card:hover::before {
    opacity: 0.1;
}

/* تنسيق خاص للبطاقات الفارغة */
.question-card .question-text:empty::before {
    content: 'لا يوجد نص للسؤال';
    color: #6c757d;
    font-style: italic;
}

/* تحسين عرض الأرقام في البطاقات */
.question-card-title {
    position: relative;
}

.question-card-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(to left, var(--primary-color, #3498db), transparent);
}

/* تأثير التحميل للبطاقات */
.question-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.question-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


/* إضافة تنسيقات لضمان عمل التبديل بشكل صحيح */
.view-container {
    width: 100%;
}

/* التأكد من أن العرضين لا يظهران معاً */
#tableView {
    display: block;
}

#cardView {
    display: none;
}


/* تحسينات بصرية إضافية للكروت */

.question-card {
    background: linear-gradient(135deg, #ffffff, #f9f9f9);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.question-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(52, 152, 219, 0.2);
}

.question-card-header {
    border-bottom: 2px solid #dee2e6;
    position: relative;
    background: linear-gradient(to left, #e3f2fd, #ffffff);
}

.question-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(to left, #3498db, transparent);
}

.question-card-title {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.question-card-badge .badge {
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* أيقونات مميزة داخل التفاصيل */
.detail-item i {
    color: #8e44ad;
}

/* تحسين للجوال */
@media (max-width: 768px) {
    .question-card {
        margin-bottom: 15px;
    }

    .question-text {
        font-size: 13px;
        padding: 10px;
    }

    .question-card-title {
        font-size: 15px;
    }

    .card-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
    }
}


/* تحسين حجم شارة المنهج */
.question-card-badge .badge {
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 14px;
    font-weight: 600;
}

/* === إضافات محدثة === */

/* ==============================
   ملف CSS محدث لعرض الأسئلة بنمط البطاقات + الجدول
   يشمل تحسينات بصرية وتنسيق للجوال
============================== */

/* الألوان الأساسية */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --soft-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* التبديل بين العرضين */
.view-toggle {
    box-shadow: var(--soft-shadow);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.view-toggle .btn {
    border-radius: 0;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-toggle .btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* عرض البطاقات */
#cardView {
    display: none;
}

.question-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--soft-shadow);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

/* زخرفة عليا */
.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* رأس البطاقة */
.question-card-header {
    padding: 1rem;
    background-color: var(--light-bg);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-card-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--dark-text);
}

.question-card-badge .badge {
    font-size: 14px;
    background-color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 20px;
    color: white;
}

/* جسم البطاقة */
.question-card-body {
    padding: 1rem;
    flex: 1;
}

.question-text {
    background-color: #f0f2f5;
    padding: 10px 12px;
    border-radius: 6px;
    border-right: 4px solid var(--primary-color);
    font-size: 14px;
}

.question-details {
    margin-top: 0.75rem;
    font-size: 13px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.detail-item i {
    color: var(--secondary-color);
}

/* أزرار الإجراءات */
.question-card-footer {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.card-actions .btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    min-width: 80px;
}

/* الجدول */
#tableView {
    display: block;
}

/* دعم الشاشات الصغيرة */
@media (max-width: 768px) {
    .question-card {
        margin-bottom: 1rem;
    }
    .view-toggle .btn {
        font-size: 14px;
        padding: 8px 10px;
        flex: 1;
    }
}

/* ============================================
   ✨ التحسينات الجديدة للنقاط 1 و 3 و 4
   (تم إضافتها مع الحفاظ على جميع الأكواد الأصلية)
============================================ */

/* النقطة 1: تحسين هوية السؤال ومحتواه الأساسي */
.enhanced-card {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #9b59b6);
    border-radius: 12px 12px 0 0;
}

.enhanced-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    padding: 1.25rem;
}

.question-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.question-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}

.question-id-badge {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #6c757d;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.question-type-indicator {
    margin-top: 0.5rem;
}

.type-badge {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.course-badge {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    font-weight: 500;
}

/* تحسين عرض النص */
.enhanced-text {
    position: relative;
}

.question-image-indicator {
    margin-bottom: 0.75rem;
}

.image-badge {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.text-truncated-indicator {
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
}

/* تحسين الميتا-بيانات */
.enhanced-metadata {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 1rem 0;
    border-left: 4px solid #3498db;
}

.metadata-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.metadata-row:last-child {
    margin-bottom: 0;
}

.metadata-label {
    font-weight: 600;
    color: #495057;
}

.metadata-value {
    color: #6c757d;
    font-weight: 500;
}

.enhanced-details {
    background: rgba(52, 152, 219, 0.05);
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

/* النقطة 3: تحسين قسم الإجراءات */
.enhanced-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 2px solid #e9ecef;
    padding: 1rem;
}

.enhanced-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.preview-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.preview-btn:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
    color: white;
}

.edit-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    text-decoration: none;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.delete-form {
    margin: 0;
}

/* النقطة 4: التحسينات البصرية والتفاعلية العامة */

/* تأثيرات الحركة المحسّنة */
.enhanced-card {
    animation: fadeInUp 0.6s ease-out;
}

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

/* تحسين نافذة المعاينة */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-weight: 700;
    color: #2c3e50;
}

.question-preview-content {
    padding: 1rem 0;
}

.preview-section-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.question-text-full {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.question-image-section {
    margin: 1.5rem 0;
}

.question-preview-image {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    object-fit: contain;
}

.options-preview {
    display: grid;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    transform: translateX(5px);
}

.option-item.correct-option {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    border-width: 2px;
}

.option-letter {
    font-weight: 700;
    color: #495057;
    margin-left: 0.75rem;
    min-width: 20px;
}

.option-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.correct-indicator {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* تحسين الاستجابة للأجهزة المختلفة */
@media (max-width: 768px) {
    .enhanced-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .preview-btn,
    .edit-btn,
    .delete-btn {
        width: 100%;
        text-align: center;
    }
    
    .question-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .metadata-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

@media (max-width: 576px) {
    .enhanced-header {
        padding: 1rem;
    }
    
    .enhanced-body {
        padding: 0.75rem;
    }
    
    .enhanced-footer {
        padding: 0.75rem;
    }
    
    .question-number {
        font-size: 1.1rem;
    }
    
    .type-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
}

/* تحسين التباين والوضوح */
.enhanced-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.enhanced-card:hover {
    border-color: rgba(52, 152, 219, 0.3);
}

/* تحسين التركيز للوصولية */
.preview-btn:focus,
.edit-btn:focus,
.delete-btn:focus {
    outline: 3px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

/* تحسين التحميل التدريجي */
.enhanced-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.enhanced-card:nth-child(1) { animation-delay: 0.1s; }
.enhanced-card:nth-child(2) { animation-delay: 0.2s; }
.enhanced-card:nth-child(3) { animation-delay: 0.3s; }
.enhanced-card:nth-child(4) { animation-delay: 0.4s; }
.enhanced-card:nth-child(5) { animation-delay: 0.5s; }
.enhanced-card:nth-child(6) { animation-delay: 0.6s; }

/* تنسيق البطاقات المحسن للأسئلة */
.question-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.question-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.question-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question-card-body {
    padding: 1rem;
}

.question-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
    margin-bottom: 1rem;
}

.question-details {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
}

.detail-label {
    font-weight: 600;
    margin-left: 0.5rem;
}

.detail-value {
    color: #495057;
}

.question-card-footer {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dee2e6;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* نهاية التحسينات الجديدة */


/* ============================================
   ✨ التحسينات النهائية الشاملة للبطاقات
   (تطبيق جميع المتطلبات المطلوبة)
============================================ */

/* زيادة المسافة الفاصلة بين البطاقات */
.enhanced-cards-container {
/* ========================================
   الحل النهائي الموحد لمشكلة تنسيق البطاقات
   ======================================== */

/* إزالة جميع الأنماط المتنافسة وتطبيق حل موحد */

/* الحل الأساسي مع أعلى أولوية */
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
html body div.view-container #cardView .enhanced-cards-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
--- نهاية الجزء المعطّل --- */

/* تنسيق البطاقات الفردية */
html body div.view-container #cardView .enhanced-card-wrapper {
    max-width: 400px !important;
    min-width: 350px !important;
    width: 100% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box !important;
}

html body div.view-container #cardView .enhanced-card {
    max-width: 400px !important;
    min-width: 350px !important;
    width: 100% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* إزالة أي تأثيرات Flexbox متداخلة */
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
html body div.view-container #cardView .enhanced-cards-container > * {
    flex: none !important;
    max-width: 400px !important;
    min-width: 350px !important;
}
--- نهاية الجزء المعطّل --- */

/* حل للشاشات المتوسطة */
@media (max-width: 991.98px) and (min-width: 768px) {
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
    html body div.view-container #cardView .enhanced-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(320px, 380px)) !important;
        gap: 1.25rem !important;
    }
--- نهاية الجزء المعطّل --- */
    
    html body div.view-container #cardView .enhanced-card-wrapper,
    html body div.view-container #cardView .enhanced-card {
        max-width: 380px !important;
        min-width: 320px !important;
    }
}

/* حل للشاشات الصغيرة */
@media (max-width: 767.98px) {
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
    html body div.view-container #cardView .enhanced-cards-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        justify-content: center !important;
    }
--- نهاية الجزء المعطّل --- */
    
    html body div.view-container #cardView .enhanced-card-wrapper,
    html body div.view-container #cardView .enhanced-card {
        max-width: 100% !important;
        min-width: auto !important;
        width: 100% !important;
    }
}

/* حل إضافي للتأكد من عدم التداخل */
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
.view-container #cardView .enhanced-cards-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
}
--- نهاية الجزء المعطّل --- */

/* إزالة أي أنماط قد تتداخل من Bootstrap أو مكتبات أخرى */
#cardView .enhanced-cards-container .col,
#cardView .enhanced-cards-container .col-*,
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
#cardView .enhanced-cards-container [class*="col-"] {
    flex: none !important;
    max-width: 400px !important;
    min-width: 350px !important;
    width: auto !important;
}
--- نهاية الجزء المعطّل --- */

/* التأكد من عدم تأثر التنسيق بأي فئات Bootstrap */
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
#cardView .enhanced-cards-container .row {
    display: contents !important;
}
--- نهاية الجزء المعطّل --- */

/* حل نهائي مع أقصى أولوية ممكنة */
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
html body div#main-content div.view-container #cardView .enhanced-cards-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
--- نهاية الجزء المعطّل --- */

html body div#main-content div.view-container #cardView .enhanced-card-wrapper {
    max-width: 400px !important;
    min-width: 350px !important;
    width: 100% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* إعادة تعيين أي أنماط قد تكون مطبقة من مكان آخر */
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
#cardView .enhanced-cards-container * {
    box-sizing: border-box !important;
}
--- نهاية الجزء المعطّل --- */

/* التأكد من أن الحاوي الرئيسي لا يؤثر على التنسيق */
#cardView {
    width: 100% !important;
    overflow: visible !important;
}

/* حل للتأكد من عدم تأثر التنسيق بأي أنماط خارجية */
body #cardView .enhanced-cards-container,
html body #cardView .enhanced-cards-container,
html body div #cardView .enhanced-cards-container,
html body div.container #cardView .enhanced-cards-container,
/* --- تم تعطيل هذا الجزء لتجنب التعارض ---
html body div.container-fluid #cardView .enhanced-cards-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
--- نهاية الجزء المعطّل --- */

/* نهاية الحل النهائي الموحد */


/* ========================================
   تنسيق البطاقات المفلترة (question-results)
   ======================================== */

/* تطبيق نفس تنسيق البطاقات المحسنة على البطاقات المفلترة */
#question-results {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* تنسيق البطاقات الفردية المفلترة */
#question-results .enhanced-card-wrapper {
    max-width: 400px !important;
    min-width: 350px !important;
    width: 100% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box !important;
}

#question-results .enhanced-card {
    max-width: 400px !important;
    min-width: 350px !important;
    width: 100% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box !important;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: white;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

#question-results .enhanced-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* إزالة أي تأثيرات متداخلة */
#question-results .enhanced-cards-container > *,
#question-results > * {
    flex: none !important;
    max-width: 400px !important;
    min-width: 350px !important;
}

/* حل للشاشات المتوسطة */
@media (max-width: 991.98px) and (min-width: 768px) {
    #question-results {
        grid-template-columns: repeat(auto-fit, minmax(320px, 380px)) !important;
        gap: 1.25rem !important;
    }
    
    #question-results .enhanced-card-wrapper,
    #question-results .enhanced-card {
        max-width: 380px !important;
        min-width: 320px !important;
    }
}

/* حل للشاشات الصغيرة */
@media (max-width: 767.98px) {
    #question-results {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        justify-content: center !important;
    }
    
    #question-results .enhanced-card-wrapper,
    #question-results .enhanced-card {
        max-width: 100% !important;
        min-width: auto !important;
        width: 100% !important;
    }
}

/* تنسيق العناصر الداخلية للبطاقات المفلترة */
#question-results .enhanced-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px;
}

#question-results .question-header-correct-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#question-results .question-number {
    font-weight: bold;
    font-size: 1.1em;
}

#question-results .question-id-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

#question-results .course-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

#question-results .image-badge {
    background: #17a2b8;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 5px;
}

#question-results .enhanced-body {
    padding: 15px;
}

#question-results .question-text {
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #333;
}

#question-results .enhanced-details {
    margin-top: 15px;
}

#question-results .detail-item {
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #666;
}

#question-results .detail-item i {
    margin-left: 5px;
    color: #007bff;
}

#question-results .enhanced-footer {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

#question-results .enhanced-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

#question-results .preview-btn,
#question-results .edit-btn,
#question-results .delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#question-results .preview-btn {
    background: #17a2b8;
    color: white;
}

#question-results .edit-btn {
    background: #007bff;
    color: white;
}

#question-results .delete-btn {
    background: #dc3545;
    color: white;
}

#question-results .preview-btn:hover,
#question-results .edit-btn:hover,
#question-results .delete-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* تنسيق الخيارات في البطاقات المفلترة */
#question-results .question-options {
    margin-top: 10px;
}

#question-results .option-item {
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: white;
    transition: all 0.2s;
}

#question-results .option-item:hover {
    background-color: #f8f9fa;
}

#question-results .correct-option {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
}

#question-results .option-number {
    font-weight: bold;
    margin-left: 8px;
}

#question-results .option-text {
    color: #333;
}

#question-results .correct-option .option-text {
    color: #155724;
    font-weight: 500;
}

/* تنسيق الصور في البطاقات المفلترة */
#question-results .question-image img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

#question-results .option-image {
    max-width: 100px;
    margin-top: 5px;
    border-radius: 4px;
}

/* التأكد من عدم تأثر التنسيق بأي أنماط خارجية */
html body #question-results,
html body div #question-results,
html body div.container #question-results,
html body div.container-fluid #question-results {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* نهاية تنسيق البطاقات المفلترة */


/* ========================================
   CSS أقوى للبطاقات المفلترة - إصلاح التنسيق
   ======================================== */

/* CSS بأولوية عالية جداً لضمان التطبيق */
body #question-results,
html body #question-results,
html body div #question-results,
html body div.container #question-results,
html body div.container-fluid #question-results,
html body div.view-container #question-results,
html body main #question-results,
html body .content #question-results {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* إزالة أي flexbox أو display أخرى قد تتداخل */
#question-results,
div#question-results {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
    gap: 1.5rem !important;
    justify-content: flex-start !important;
    align-content: start !important;
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
}

/* تأكيد تنسيق البطاقات الفردية */
#question-results > *,
#question-results .enhanced-card-wrapper,
#question-results .enhanced-card {
    max-width: 400px !important;
    min-width: 350px !important;
    width: 100% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* إزالة أي Bootstrap classes قد تتداخل */
#question-results .col,
#question-results .col-*,
#question-results [class*="col-"],
#question-results .row {
    display: contents !important;
    flex: none !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* CSS للشاشات المختلفة */
@media (max-width: 1200px) {
    #question-results {
        grid-template-columns: repeat(auto-fit, minmax(320px, 380px)) !important;
        gap: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    #question-results {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        justify-content: center !important;
    }
    
    #question-results > *,
    #question-results .enhanced-card-wrapper,
    #question-results .enhanced-card {
        max-width: 100% !important;
        min-width: auto !important;
        width: 100% !important;
    }
}

/* إزالة أي أنماط قد تكون مطبقة من JavaScript */
#question-results[style] {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 400px)) !important;
}

/* === تحديث مرن لتخطيط البطاقات بثلاثة أعمدة كحد أقصى === */
#cardView .enhanced-cards-container {
  display: grid;
  gap: 1.5rem;
  padding: 1rem;
  box-sizing: border-box;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-content: center;
}

/* الشاشات المتوسطة: عمودين */
@media (max-width: 1023px) {
  #cardView .enhanced-cards-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* الجوال: عمود واحد */
@media (max-width: 767px) {
  #cardView .enhanced-cards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    justify-content: center;
  }
}

/* تأكد أن البطاقة تملأ العمود */
#cardView .enhanced-card-wrapper,
#cardView .enhanced-card {
  width: 100%;
  box-sizing: border-box;
  max-width: none;
  min-width: auto;
  display: block;
  flex: none;
}

/* ===== الشريط الملون المتدرج في أعلى البطاقة فقط ===== */

/* إضافة الشريط الملون فقط للبطاقة الخارجية */
.enhanced-card-wrapper {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
}

/* الشريط الملون المتدرج - فقط للبطاقة الخارجية */
.enhanced-card-wrapper::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 6px !important;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%) !important;
    border-radius: 8px 8px 0 0 !important;
    z-index: 999 !important;
    display: block !important;
}

/* ضمان أن محتوى البطاقة لا يتداخل مع الشريط */
.enhanced-card-wrapper .enhanced-card {
    position: relative !important;
    z-index: 2 !important;
    margin-top: 0 !important;
}

/* إضافة تأثير hover للشريط */
.enhanced-card-wrapper:hover::before {
    background: linear-gradient(90deg, #2980b9 0%, #27ae60 100%) !important;
    transition: background 0.3s ease !important;
}



/* ========== أنماط التصفية الديناميكية ========== */
/* تم إضافة هذا القسم لدعم التصفية الديناميكية للوحدات والدروس */

.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-section .form-select {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
}

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

.filter-section .form-select option[style*="display: none"] {
    display: none !important;
}

/* تحسين مظهر قوائم التصفية */
.filter-section .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.filter-section .btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.filter-section .btn-secondary {
    background: #6c757d;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-section .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .filter-section {
        padding: 15px;
    }
    
    .filter-section .row.g-3 {
        gap: 1rem !important;
    }
    
    .filter-section .col-md-4 {
        margin-bottom: 15px;
    }
}

/* تحسين مظهر الخيارات المخفية */
select option[style*="display: none"] {
    display: none !important;
}

/* إضافة مؤشر تحميل للتصفية */
.filter-loading {
    position: relative;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 30px;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* تحسين مظهر البطاقات مع التصفية */
.enhanced-cards-container {
    transition: opacity 0.3s ease;
}

.enhanced-cards-container.filtering {
    opacity: 0.7;
}

/* تحسين مظهر الجدول مع التصفية */
.table-responsive {
    transition: opacity 0.3s ease;
}

.table-responsive.filtering {
    opacity: 0.7;
}


/* ===== قواعد إخفاء العلامات الصحيحة الشاملة ===== */

/* إخفاء الخلفية الخضراء من جميع الخيارات الصحيحة */
.option-item.correct-option.correct-answer-hidden,
#question-results .correct-option.correct-answer-hidden {
    background-color: white !important;
    background: white !important;
    border-color: #dee2e6 !important;
    border: 1px solid #dee2e6 !important;
}

/* إخفاء النص المميز للإجابات الصحيحة */
.option-item.correct-option.correct-answer-hidden .option-text,
#question-results .correct-option.correct-answer-hidden .option-text {
    color: #333 !important;
    font-weight: normal !important;
}

/* إخفاء أيقونة الصح */
.option-item.correct-option.correct-answer-hidden .fas.fa-check,
.option-item.correct-option.correct-answer-hidden i.fas.fa-check,
#question-results .correct-option.correct-answer-hidden .fas.fa-check,
#question-results .correct-option.correct-answer-hidden i.fas.fa-check {
    display: none !important;
    visibility: hidden !important;
}

/* إخفاء مؤشر الإجابة الصحيحة */
.correct-indicator.correct-answer-hidden,
.correct-indicator[data-hidden="true"] {
    display: none !important;
    visibility: hidden !important;
}

/* إخفاء أي gradients خضراء */
.option-item.correct-option.correct-answer-hidden {
    background-image: none !important;
}

/* التأكد من إخفاء جميع العناصر الخضراء */
.correct-answer-hidden {
    background-color: white !important;
    background: white !important;
    border-color: #dee2e6 !important;
    color: #333 !important;
}

.correct-answer-hidden * {
    color: #333 !important;
}

.correct-answer-hidden .fas.fa-check,
.correct-answer-hidden i.fas.fa-check {
    display: none !important;
}


/* ===== أنماط نظام البحث المتقدم ===== */

/* تنسيق شريط البحث */
#search_input {
    border-radius: 8px 0 0 8px;
    border-right: none;
    font-size: 16px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#search_input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    outline: none;
}

#clear_search {
    border-radius: 0 8px 8px 0;
    border-left: none;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

#clear_search:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* تنسيق خيارات البحث */
.search-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-check-inline {
    margin-right: 0;
    margin-left: 1rem;
}

.form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.form-check-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

/* تنسيق عداد النتائج */
#search_results_count {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-results-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* تمييز نتائج البحث */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: highlightPulse 0.5s ease-in-out;
}

@keyframes highlightPulse {
    0% {
        background-color: #ffc107;
        transform: scale(1);
    }
    50% {
        background-color: #fff3cd;
        transform: scale(1.05);
    }
    100% {
        background-color: #fff3cd;
        transform: scale(1);
    }
}

/* تنسيق رسالة عدم وجود نتائج */
#no-search-results {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 2rem 0;
    padding: 3rem 2rem;
    border: 2px dashed #dee2e6;
}

#no-search-results i {
    color: #6c757d;
    margin-bottom: 1rem;
}

#no-search-results h4 {
    color: #495057;
    margin-bottom: 0.5rem;
}

#no-search-results p {
    color: #6c757d;
    margin-bottom: 0;
}

/* تأثيرات الحركة للبحث */
.search-highlighted {
    transition: all 0.3s ease;
}

.search-highlighted:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* تنسيق بطاقة البحث */
.card-header.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.card-header.bg-success h5 {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-header.bg-success i {
    margin-left: 0.5rem;
    font-size: 1.1em;
}

/* تحسين مظهر select */
#search_type {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#search_type:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* تنسيق النص المساعد */
.form-text.text-muted {
    font-size: 13px;
    color: #6c757d !important;
    margin-top: 0.5rem;
}

/* تأثيرات responsive للبحث */
@media (max-width: 768px) {
    .search-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .form-check-inline {
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    
    .search-results-info {
        margin-top: 1rem;
        justify-content: center;
    }
    
    #search_input {
        font-size: 16px; /* منع zoom في iOS */
    }
    
    #no-search-results {
        padding: 2rem 1rem;
    }
    
    #no-search-results i {
        font-size: 2rem;
    }
    
    #no-search-results h4 {
        font-size: 1.25rem;
    }
}

/* تحسين الأداء - تقليل الحركة للمستخدمين الذين يفضلون ذلك */
@media (prefers-reduced-motion: reduce) {
    .search-highlight,
    .search-highlighted,
    #search_input,
    #clear_search,
    #search_type {
        transition: none;
        animation: none;
    }
    
    .highlightPulse {
        animation: none;
    }
}

/* تنسيق خاص للطباعة */
@media print {
    .card-header.bg-success,
    #clear_search,
    .search-options,
    .search-results-info {
        display: none !important;
    }
    
    .search-highlight {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}

/* تحسين إمكانية الوصول */
#search_input:focus,
#search_type:focus,
.form-check-input:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* تنسيق حالة التحميل للبحث */
.search-loading {
    position: relative;
}

.search-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

/* تنسيق الشارات المختلفة */
.badge.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
    color: #000 !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #17a2b8, #007bff) !important;
}

