/* ========================================
   Global Enhancements - تحسينات عامة خفيفة
   Lightweight CSS-only improvements
   ======================================== */

/* ========================================
   1. Smooth Scroll - تمرير سلس
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   2. Selection Style - تنسيق التحديد
   ======================================== */
::selection {
    background: linear-gradient(135deg, #1976D2, #42A5F5);
    color: #ffffff;
}

::-moz-selection {
    background: #1976D2;
    color: #ffffff;
}

/* ========================================
   3. Scrollbar Styling - تنسيق شريط التمرير
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1976D2, #42A5F5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1565C0, #1976D2);
}

/* ========================================
   4. Focus States - حالات التركيز
   ======================================== */
:focus-visible {
    outline: 2px solid #1976D2;
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #1976D2;
    outline-offset: 3px;
}

/* ========================================
   5. Link Transitions - انتقالات الروابط
   ======================================== */
a {
    transition: color 0.25s ease, background-color 0.25s ease;
}

/* ========================================
   6. Image Optimizations - تحسينات الصور
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ========================================
   7. Better Typography - تحسين الخطوط
   ======================================== */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75em;
}

p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ========================================
   8. Container Improvements - تحسينات الحاوية
   ======================================== */
.container {
    max-width: 1200px;
}

/* ========================================
   9. Breadcrumb Styling - مسار التنقل
   ======================================== */
.breadcrumb-nav {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 0;
    margin-bottom: 30px;
    border-radius: 0;
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: #1976D2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #1565C0;
}

.breadcrumb-item.active {
    color: #616161;
    font-weight: 600;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    color: #9e9e9e;
    font-weight: bold;
    font-size: 1.2em;
}

/* ========================================
   10. Page Header Styling - عنوان الصفحة
   ======================================== */
.page-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    padding: 40px 0;
    margin-bottom: 40px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header h1,
.page-header h2 {
    color: #fff;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.page-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   11. Alert Improvements - تحسين التنبيهات
   ======================================== */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* ========================================
   12. Form Improvements - تحسين النماذج
   ======================================== */
.form-control {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control:focus {
    border-color: #1976D2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.form-control::placeholder {
    color: #9e9e9e;
}

.form-label {
    font-weight: 600;
    color: #424242;
    margin-bottom: 8px;
}

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

/* ========================================
   13. Button Enhancements - تحسين الأزرار
   ======================================== */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

/* ========================================
   14. Table Improvements - تحسين الجداول
   ======================================== */
.table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.table thead th {
    background: linear-gradient(135deg, #1976D2, #42A5F5);
    color: #fff;
    border: none;
    padding: 15px;
    font-weight: 600;
}

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

.table tbody tr:hover {
    background-color: rgba(25, 118, 210, 0.05);
}

/* ========================================
   15. Loading States - حالات التحميل
   ======================================== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   16. Fade In Animation - تأثير الظهور
   ======================================== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   17. Hover Lift Effect - تأثير الرفع
   ======================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ========================================
   18. Gradient Border - حدود متدرجة
   ======================================== */
.gradient-border {
    position: relative;
    background: #fff;
    border-radius: 12px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #1976D2, #42A5F5, #4CAF50, #FF9800);
    border-radius: 14px;
    z-index: -1;
}

/* ========================================
   19. Section Spacing - تباعد الأقسام
   ======================================== */
section {
    padding: 60px 0;
}

section+section {
    padding-top: 40px;
}

/* ========================================
   20. Back to Top Button - زر العودة للأعلى
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1976D2, #42A5F5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(25, 118, 210, 0.5);
}

.back-to-top i,
.back-to-top .icon {
    font-size: 1.2rem;
}

/* ========================================
   21. Responsive Typography - خطوط متجاوبة
   ======================================== */
@media (max-width: 991.98px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    section {
        padding: 40px 0;
    }
}

@media (max-width: 767.98px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    section {
        padding: 30px 0;
    }

    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ========================================
   22. Print Styles - أنماط الطباعة
   ======================================== */
@media print {

    .back-to-top,
    .navbar,
    .footer-section {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }
}

/* ========================================
   23. Reduced Motion - تقليل الحركة
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   24. Performance Optimizations - تحسينات الأداء
   ======================================== */
.card,
.btn,
.nav-link,
.social-icon {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* GPU acceleration for animations */
.hover-lift,
.back-to-top {
    transform: translate3d(0, 0, 0);
}