/* ===============================================
   تنسيقات عامة
=============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ===============================================
   تخطيط الإدارة الرئيسي
=============================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ===============================================
   الشريط الجانبي
=============================================== */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-header i {
    margin-left: 0.5rem;
    color: #ffd700;
}

.user-welcome {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li {
    margin: 0.5rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav .active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-right-color: #ffd700;
}

.sidebar-nav i {
    margin-left: 0.75rem;
    width: 20px;
    text-align: center;
}

.nav-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.75rem 1.5rem;
}

a.logout {
    color: rgba(255, 255, 255, 0.7);
}

a.logout:hover {
    background-color: rgba(255, 0, 0, 0.2);
    border-right-color: #ff6b6b;
}

/* ===============================================
   المحتوى الرئيسي
=============================================== */
.main-content {
    flex: 1;
    margin-right: 280px;
    background-color: #f8f9fa;
}

.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e9ecef;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #667eea;
    cursor: pointer;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.75rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-time {
    color: #6c757d;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* ===============================================
   المحتوى
=============================================== */
.content {
    padding: 2rem;
}

/* ===============================================
   البطاقات
=============================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-bottom: 2rem;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.card-header {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4a);
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header i {
    font-size: 1.5rem;
    color: #ffd700;
    opacity: 0.9;
}

.card-body {
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #fafbff 0%, #f8f9fa 100%);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ===============================================
   الأزرار
=============================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 171, 47, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* تحسين أزرار النماذج */
.btn i {
    margin-left: 0.5rem;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* تحسين الأزرار في النماذج */
.form-actions .btn {
    min-width: 160px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
}

.form-actions .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.form-actions .btn-success:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    transform: translateY(-3px);
}

.form-actions .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.form-actions .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* ===============================================
   الجداول
=============================================== */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

/* ===============================================
   النماذج
=============================================== */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: #667eea;
    background: white;
}

.form-control.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: "⚠️";
}

/* تحسين textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* تحسين حقول الأرقام */
input[type="number"].form-control {
    text-align: center;
}

/* تحسين حقول الألوان */
input[type="color"].form-control {
    height: 60px;
    border: 3px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"].form-control:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

/* تحسينات إضافية للنماذج */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* تحسين البطاقات في النماذج */
.card.mb-3 {
    margin-bottom: 2rem !important;
    border: 2px solid #f1f3f4;
    background: white;
}

.card.mb-3:hover {
    border-color: rgba(102, 126, 234, 0.2);
}

.card.mb-3 .card-body {
    background: linear-gradient(135deg, #fafbff 0%, #f8f9fa 100%);
}

/* شبكة الحقول في البطاقات */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* تحسين النص المساعد */
.text-muted {
    color: #6c757d !important;
    font-size: 0.9rem;
    font-style: italic;
}

small.text-muted {
    display: block;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-weight: 500;
}

/* تحسين أزرار الحفظ والإلغاء */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding: 2rem 0;
}

.form-actions .btn {
    min-width: 150px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* تأثيرات تفاعلية للحقول */
.form-group {
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-group:focus-within::before {
    opacity: 1;
}

/* تحسين شكل الـ placeholder */
.form-control::placeholder {
    color: #adb5bd;
    opacity: 1;
    font-style: italic;
}

.form-control:focus::placeholder {
    opacity: 0.5;
}

/* تحسينات التحريك والانتقالات */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

/* تحسين حالة التحميل */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* تحسين التصميم المتجاوب للنماذج */
@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        min-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .color-field-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    input[type="color"].form-control {
        width: 100%;
        height: 50px;
    }
}

/* إخفاء أي نص JavaScript قد يظهر عن طريق الخطأ */
script {
    display: none !important;
}

/* إخفاء أي محتوى غير مرغوب فيه */
body > script:last-child,
body > *:last-child:not(div):not(script) {
    display: none !important;
}

/* التأكد من إخفاء أي كود يظهر في نهاية الصفحة */
body::after {
    content: '';
    display: block;
    clear: both;
}

/* ===============================================
   النوافذ المنبثقة
=============================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 820px; /* مساحة أوسع للنماذج */
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    max-height: 90vh; /* حتى لا تخرج أسفل الشاشة */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* منع خروج الحواف */
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #667eea;
}

/* ===============================================
   التنبيهات
=============================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

/* ===============================================
   النشاط الأخير
=============================================== */
.recent-activity {
    margin-top: 2rem;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background-color: #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    color: white;
}

.activity-icon.success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.activity-icon.danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.activity-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.activity-time {
    color: #6c757d;
    font-size: 0.875rem;
}

/* ===============================================
   شارات الحالة
=============================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* ===============================================
   التقسيم والصفحات
=============================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===============================================
   الحقول الديناميكية
=============================================== */
.dynamic-fields {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.dynamic-fields::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dynamic-fields:hover::before {
    opacity: 0.1;
}

.dynamic-field-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dynamic-field-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.dynamic-field-item:last-child {
    margin-bottom: 0;
}

.dynamic-field-item input {
    flex: 1;
    border: 2px solid #f1f3f4;
    background: #fafafa;
}

.dynamic-field-item input:focus {
    background: white;
    border-color: #667eea;
}

.remove-field {
    padding: 0.75rem;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-field:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.add-field {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    margin-top: 1rem;
    width: 100%;
}

.add-field:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.add-field:active {
    transform: translateY(0);
}

/* تحسين نمط الألوان */
.color-field-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ===============================================
   الاستجابة (Responsive)
=============================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .dynamic-fields {
        padding: 1rem;
    }
    
    .dynamic-field-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-body .grid-container {
        grid-template-columns: 1fr;
    }
}

/* ===============================================
   تحسينات إضافية
=============================================== */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* مؤشر تحميل للجدول */
.table-loading {
    padding: 60px 20px;
    text-align: center;
}

.table-loading .loading {
    margin-bottom: 15px;
}

.table-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.w-100 { width: 100%; }

/* تنسيق الكود والتعليمات */
pre {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
    direction: ltr;
    text-align: left;
}

code {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    direction: ltr;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-info {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1976d2;
}

.alert-success {
    background-color: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.alert-danger {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.alert h5 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* ===============================================
   Modal (نافذة منبثقة)
   =============================================== */
/* إعادة ضبط تعريف مكرر للمودال لضمان الاتساق */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000; /* أعلى من أي عناصر أخرى */
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: none; /* يظهر عند الحاجة */
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem; /* ضمان وجود مساحة حول المحتوى في الشاشات الصغيرة */
    overflow-y: auto; /* السماح بالتمرير إذا كان المحتوى أطول من الشاشة */
}

/* توحيد خصائص المودال - تمت معالجتها أعلاه (منع التكرار) */
/* إن احتجنا تخصيصاً إضافياً يمكن إضافة صنف فرعي لاحقاً */
.modal-content .modal-body {
    overflow-y: auto;
    padding-right: 4px; /* مساحة للتمرير */
}

.modal-content .form-actions,
.modal-content .modal-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    background: linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0.3));
    position: sticky;
    bottom: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.modal .close:hover {
    color: #000;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: right;
}

.modal .form-group {
    margin-bottom: 15px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    text-align: right;
}

.modal .form-group input[type="number"],
.modal .form-group input[type="date"],
.modal .form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    direction: rtl;
}

.modal .form-group input[type="number"]:focus,
.modal .form-group input[type="date"]:focus,
.modal .form-group input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.modal .form-group input[type="checkbox"] {
    margin-left: 8px;
    transform: scale(1.2);
}

.modal .form-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    direction: rtl;
    text-align: right;
}

.modal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal .form-actions .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

/* ===============================================
   شارات حالة أكواد الخصم
=============================================== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-secondary {
    background-color: #6c757d;
}

.badge-info {
    background-color: #17a2b8;
}

/* ===============================================
   تحسينات للجداول
=============================================== */
.table-secondary {
    opacity: 0.7;
    background-color: rgba(108, 117, 125, 0.1);
}

/* ===============================================
   رسائل التنبيه المحسنة
=============================================== */
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
    border-radius: 0.375rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #6c757d;
}

.text-muted {
    color: #6c757d !important;
}

/* ===============================================
   تحسينات النماذج
=============================================== */
.form-group small ul {
    font-size: 0.8em;
    margin: 0;
    padding-left: 15px;
}

.form-group small ul li {
    margin-bottom: 2px;
}

/* تحسينات إضافية للنماذج */
.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

/* تحسين عرض checkbox */
.form-group input[type="checkbox"] {
    width: auto;
    margin-left: 8px;
    transform: scale(1.2);
}

/* تحسين الأزرار */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

/* ===============================================
   شبكة الأقسام
=============================================== */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.section-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.section-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.section-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.section-card:hover .section-image img {
    transform: scale(1.05);
}

.section-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #6c757d;
    font-size: 3rem;
}

.section-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.section-status.active {
    background-color: #28a745;
}

.section-status.inactive {
    background-color: #dc3545;
}

.section-info {
    padding: 1.5rem;
}

.section-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.section-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.section-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-meta i {
    color: #667eea;
}

.section-actions {
    padding: 0 1.5rem 1.5rem;
}

.section-actions .btn {
    width: 100%;
    justify-content: center;
}

/* حالة فارغة للأقسام */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* بطاقات الإحصائيات للأقسام */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* معلومات القسم في صفحة المنتجات */
.section-info.mt-3 {
    margin-top: 1rem !important;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.ms-2 {
    margin-right: 0.5rem !important;
}

/* تحسينات إضافية للمرونة */
@media (max-width: 768px) {
    .sections-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ===============================================
   تنسيقات إدارة الطلبات
=============================================== */
.order-details {
    padding: 1rem;
}

.order-details h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.info-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-section h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-section p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.info-section strong {
    color: #495057;
}

.order-summary {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.color-circle {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    vertical-align: middle;
}

/* تنسيقات شارات الحالة */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* تنسيقات النموذج المنبثق الكبير */
.modal-lg .modal-content {
    max-width: 900px;
    width: 90vw;
}

/* تنسيقات الجدول المضغوط */
.table-sm {
    font-size: 0.875rem;
}

.table-sm th,
.table-sm td {
    padding: 0.5rem;
    border-top: 1px solid #dee2e6;
}

/* تنسيقات النص */
.text-right {
    text-align: right;
}

.text-success {
    color: #28a745;
}

.text-muted {
    color: #6c757d;
}

/* تنسيقات الأعمدة */
.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;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .modal-lg .modal-content {
        width: 95vw;
        max-width: none;
    }
    
    .order-details {
        padding: 0.5rem;
    }
    
    .info-section {
        padding: 0.75rem;
    }
}

/* Order Items Grid Styles */
.order-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.order-item-card {
    display: flex;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.item-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-image:hover img {
    transform: scale(1.1);
}

.no-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 2rem;
}

.item-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.item-details h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.item-attributes {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.attribute {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

.attribute strong {
    color: #495057;
    min-width: 50px;
}

.item-pricing {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.unit-price {
    font-size: 0.9rem;
    color: #6c757d;
}

.total-price {
    font-size: 1rem;
    color: #667eea;
    font-weight: bold;
}

/* Responsive adjustments for order items */
@media (max-width: 768px) {
    .order-items-grid {
        grid-template-columns: 1fr;
    }
    
    .order-item-card {
        flex-direction: column;
    }
    
    .item-image {
        width: 100%;
        height: 200px;
    }
    
    .item-details {
        padding: 15px;
    }
    
    .item-attributes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Add Section Modal Styles */
#addSectionModal .modal-content {
    max-width: 600px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.4rem;
}

.modal-header .close {
    font-size: 2rem;
    font-weight: bold;
    color: #adb5bd;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-header .close:hover {
    color: #6c757d;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.form-group label i {
    margin-left: 8px;
    color: #667eea;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 10px;
    transform: scale(1.2);
    accent-color: #667eea;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
    min-height: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
    transform: translateY(-1px);
}

.btn-success:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Responsive form adjustments */
@media (max-width: 768px) {
    #addSectionModal .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-header {
        padding: 15px 20px 10px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Delete Warning Modal Styles */
#deleteWarningModal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#deleteWarningModal .modal-content {
    max-width: 600px;
    width: 90%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#deleteWarningModal[style*="block"] .modal-content {
    transform: scale(1);
}

.warning-modal {
    border: 3px solid #ff6b6b;
}

.warning-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 20px 25px;
    border: none;
}

.warning-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.warning-header .close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.warning-header .close:hover {
    opacity: 1;
}

.warning-body {
    padding: 30px 25px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
}

.warning-icon {
    font-size: 4rem;
    color: #ff6b6b;
    flex-shrink: 0;
    margin-top: 10px;
}

.warning-content {
    flex: 1;
}

.warning-content h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.warning-content p {
    color: #5a6c7d;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.warning-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-right: 4px solid #ff6b6b;
}

.warning-details h5 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.warning-details ul {
    margin: 0;
    padding-right: 20px;
    list-style-type: none;
}

.warning-details li {
    color: #5a6c7d;
    margin-bottom: 8px;
    position: relative;
    padding-right: 20px;
}

.warning-details li:before {
    content: "•";
    color: #ff6b6b;
    font-weight: bold;
    position: absolute;
    right: 0;
}

.warning-footer {
    background: #f8f9fa;
    padding: 20px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #e9ecef;
}

.warning-footer .btn {
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.warning-footer .btn-secondary {
    background: #6c757d;
    border: none;
    color: white;
}

.warning-footer .btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.warning-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.warning-footer .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
}

/* Responsive warning modal */
@media (max-width: 768px) {
    #deleteWarningModal .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .warning-body {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .warning-icon {
        font-size: 3rem;
        margin: 0 auto 20px;
    }
    
    .warning-footer {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .warning-footer .btn {
        width: 100%;
    }
}

/* نافذة نجاح حذف المنتج */
.success-modal {
    border: 3px solid #28a745;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    box-shadow: 0 20px 60px rgba(40, 167, 69, 0.3);
    animation: successPulse 2s ease-in-out infinite alternate;
    max-width: 500px;
    margin: 0 auto;
}

.success-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #1e7e34;
    text-align: center;
    position: relative;
}

.success-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.success-header i {
    font-size: 1.5em;
    animation: checkmark 2s ease-in-out infinite;
}

.success-body {
    padding: 25px;
    text-align: center;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounceIn 1s ease-out;
}

.success-icon i {
    color: #28a745;
    filter: drop-shadow(0 4px 8px rgba(40, 167, 69, 0.3));
}

.success-content h4 {
    color: #495057;
    margin: 15px 0;
    font-size: 1.4em;
    font-weight: bold;
}

.success-content p {
    color: #6c757d;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 15px 0;
}

.success-details {
    background: rgba(40, 167, 69, 0.1);
    border-right: 4px solid #28a745;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
}

/* نقاط التحميل للنجاح */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0; }

/* الرسوم المتحركة للنجاح */
@keyframes successPulse {
    0% { box-shadow: 0 20px 60px rgba(40, 167, 69, 0.3); }
    100% { box-shadow: 0 25px 80px rgba(40, 167, 69, 0.5); }
}

@keyframes checkmark {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive success modal */
@media (max-width: 768px) {
    #deleteSuccessModal .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .success-body {
        padding: 20px;
    }
    
    .success-icon {
        font-size: 3rem;
        margin: 0 auto 20px;
    }
}

/* ===================================== */
/* CSS خاص بإدارة الأقسام */
/* ===================================== */

/* تحسين أزرار الأقسام */
.section-actions {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.section-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-actions .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section-actions .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.section-actions .btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #17a2b8 100%);
}

.section-actions .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.section-actions .btn-danger:hover {
    background: linear-gradient(135deg, #a71e2a 0%, #941f29 100%);
}

/* نوافذ إدارة الأقسام */
#editSectionModal .modal-content,
#deleteSectionWarningModal .modal-content,
#sectionEditSuccessModal .modal-content,
#sectionDeleteSuccessModal .modal-content {
    animation: slideInDown 0.4s ease-out;
}

/* تخصيص نافذة تحذير حذف القسم */
#deleteSectionWarningModal .warning-icon i {
    color: #ff9500;
    font-size: 4em;
}

#deleteSectionWarningModal .warning-content h4 {
    color: #856404;
}

#deleteSectionWarningModal .warning-details {
    background: rgba(255, 149, 0, 0.1);
    border-right: 4px solid #ff9500;
}

/* تخصيص أيقونة نجاح تعديل القسم */
#sectionEditSuccessModal .success-icon i {
    color: #17a2b8;
    animation: editSuccess 2s ease-in-out infinite;
}

/* تخصيص أيقونة نجاح حذف القسم */
#sectionDeleteSuccessModal .success-icon i {
    color: #dc3545;
    animation: deleteSuccess 2s ease-in-out infinite;
}

/* الرسوم المتحركة للأقسام */
@keyframes editSuccess {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        color: #17a2b8;
    }
    25% { 
        transform: scale(1.1) rotate(-5deg);
        color: #138496;
    }
    75% { 
        transform: scale(1.1) rotate(5deg);
        color: #20c997;
    }
}

@keyframes deleteSuccess {
    0%, 100% { 
        transform: scale(1);
        color: #dc3545;
    }
    50% { 
        transform: scale(1.2);
        color: #c82333;
    }
}

/* تحسين شكل الفورم في نافذة التعديل */
#editSectionForm .form-group {
    margin-bottom: 20px;
}

#editSectionForm .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1em;
}

#editSectionForm .form-group label i {
    margin-left: 8px;
    color: #6c757d;
    width: 16px;
}

#editSectionForm input,
#editSectionForm textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff;
}

#editSectionForm input:focus,
#editSectionForm textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #f8f9ff;
}

#editSectionForm .error-message {
    margin-top: 5px;
    color: #dc3545;
    font-size: 0.875em;
    display: none;
}

#editSectionForm .error-message.show {
    display: block;
    animation: shake 0.5s ease-in-out;
}

/* تحسين Checkbox في نافذة التعديل */
#editSectionForm .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

#editSectionForm .checkbox-label:hover {
    background: rgba(102, 126, 234, 0.05);
}

#editSectionForm .checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Responsive للأقسام */
@media (max-width: 768px) {
    .section-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .section-actions .btn-sm {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 0.9em;
    }
    
    #editSectionModal .modal-content,
    #deleteSectionWarningModal .modal-content {
        width: 95%;
        margin: 10px auto;
    }
    
    #editSectionForm .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    #editSectionForm .form-actions .btn {
        width: 100%;
    }
}