/**
 * تصميم حديث وجذاب بخلفية فاتحة
 * Modern & Attractive Design with Light Background
 */

/* ========================================
   إعدادات عامة
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #ede9fe;
    --secondary: #10b981;
    --secondary-light: #d1fae5;
    --accent: #f59e0b;
    --accent-light: #fef3c7;

    --bg-main: aliceblue;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-hover: #f1f5f9;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    --border-color: #e2e8f0;
    --border-light: #cbd5e1;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-purple: 0 4px 14px rgba(124, 58, 237, 0.25);

    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@font-face{font-family:coconnextarabic-regular;font-style:normal;font-weight:600;src:url(fonts/CoconNextArabic-Regular.woff2) format('woff2')}
body {
      font-family: 'CoconNextArabic-Regular', sans-serif!important;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   الحاوية الرئيسية
======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

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

/* ========================================
   الهيدر - تصميم مستوحى من DzExams
======================================== */
.header {
    background:linear-gradient(135deg, #10B981 0%, #059669 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-purple);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: 100%;
}

/* أيقونة القائمة اليمنى */
.menu-icon-right {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    order: 3;
}

.menu-icon-right span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.menu-icon-right:hover span {
    background: rgba(255, 255, 255, 0.8);
}

/* الشعار في المنتصف */
.logo {
    font-size: 28px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 2px;
    order: 2;
    flex: 1;
    justify-content: center;
}

/* أيقونة القائمة اليسرى (همبرغر) */
.menu-icon-left {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    order: 1;
}

.menu-icon-left span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.menu-icon-left:hover span {
    background: rgba(255, 255, 255, 0.8);
}

/* إخفاء القائمة القديمة على الشاشات الصغيرة */
.nav {
    display: none;
}

/* إظهار القائمة على الشاشات الكبيرة */
@media (min-width: 769px) {
    .menu-icon-left,
    .menu-icon-right {
        display: none;
    }

    .nav {
        display: flex;
        gap: 8px;
        align-items: center;
        order: 3;
    }

    .logo {
        order: 1;
        justify-content: flex-start;
    }
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.nav-link:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   الأزرار
======================================== */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-purple);
    color: white;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-error:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   الكروت
======================================== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 10px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary);
}

.card-body {
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 18px 18px 0px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.stat-card-t {

display: flex;
    align-items: center;
    justify-content: space-between
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:nth-child(2)::before {
    background: var(--gradient-secondary);
}

.stat-card:nth-child(3)::before {
    background: var(--gradient-accent);
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

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

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

.stat-card:nth-child(4) .stat-value {
    color: #3b82f6;
}

.stat-label {

    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 28px;
    box-shadow: var(--shadow-md);
}

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

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

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* ========================================
   الجداول
======================================== */
.table-container {
    overflow-x: auto;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--primary-light);
}

th {
    padding: 18px;
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg-light);
}

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

/* ========================================
   النماذج
======================================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: var(--bg-white);
}

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

.form-error {
    color: var(--error);
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

.form-help {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

/* ========================================
   التنبيهات
======================================== */
.alert {
    padding: 18px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: var(--error);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: var(--info);
}

/* ========================================
   شريط التقدم
======================================== */
.progress {
    width: 100%;
    height: 10px;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    margin: 14px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.4s ease;
    border-radius: 6px;
}

.progress-label {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 600;
}

/* ========================================
   الشارات
======================================== */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid var(--success);
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid var(--warning);
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--error);
}

/* ========================================
   الأيقونات
======================================== */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* ========================================
   صفحة تسجيل الدخول
======================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--gradient-primary);
    opacity: 0.08;
    border-radius: 50%;
    top: -250px;
    right: -250px;
    filter: blur(100px);
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--gradient-secondary);
    opacity: 0.08;
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    filter: blur(100px);
}

.auth-card {
    background: var(--bg-white);
    padding: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--primary);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   المحتوى الرئيسي
======================================== */
.main-content {
    padding: 10px 0;
    min-height: calc(100vh - 200px);
}

.page-header {
    margin-bottom: 36px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--primary);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 15px;
}

/* ========================================
   رفع الملفات
======================================== */
.file-upload-area {
    border: 3px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    background: var(--bg-white);
    transition: var(--transition);
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.file-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.file-type-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
    background: var(--bg-white);
    cursor: pointer;
}

.file-type-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.file-type-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-purple);
}

/* ========================================
   قائمة الملفات
======================================== */
.file-list-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.file-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(-4px);
    border-color: var(--primary);
}

.file-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: var(--shadow-md);
}

.file-info {
    flex: 1;
}

.file-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.file-meta {
    font-size: 13px;
    color: var(--text-muted);
}

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

/* ========================================
   التصميم المتجاوب
======================================== */
@media (max-width: 768px) {
    .header-content {
        padding: 14px 20px;
    }

    .logo {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 28px;
    }

    .file-types-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 12px;
    }
}

/* ========================================
   المساعدات
======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden {
    display: none !important;
}

/* ========================================
   Modal / نوافذ مودال
======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
    animation: modalBackdropFadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalContentFadeIn 0.4s ease;
    border: 1px solid var(--border-color);
}

@keyframes modalContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--error);
    transform: rotate(90deg);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px 24px;
    }

    .modal-body {
        padding: 24px;
    }

    .modal-footer {
        padding: 16px 24px;
    }
}

/* ========================================
   Loading Indicator
======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-container {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.progress {
    width: 100%;
    height: 10px;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}
.dataTables_wrapper .dataTables_filter input{
	height:35px!important;margin-bottom:5px!important;
}
.dataTables_wrapper{
	overflow: auto!important;
}