﻿/* ========================================
   تصميم احترافي لصفحة تحميل الملفات
   ======================================== */

/* الخطوط العربية الاحترافية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

/* المتغيرات العامة */
:root {
    --primary-color: #0f5132;
    --primary-dark: #0a3d24;
    --primary-light: #1a7a4f;
    --secondary-color: #d4af37;
    --bg-light: #f8fdfb;
    --bg-white: #ffffff;
    --border-color: #b6dfc8;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --shadow-sm: 0 2px 4px rgba(15, 81, 50, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 81, 50, 0.15);
    --shadow-lg: 0 8px 24px rgba(15, 81, 50, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* إعادة تعيين وإعدادات أساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
    background: #f8fdfb;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

    /* خلفية متحركة احترافية */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 20% 50%, rgba(15, 81, 50, 0.02) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
        animation: backgroundMove 20s ease-in-out infinite;
        z-index: -1;
        pointer-events: none;
    }

@keyframes backgroundMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(-5%, 5%) scale(1.05);
    }

    50% {
        transform: translate(3%, -3%) scale(0.95);
    }

    75% {
        transform: translate(-3%, 3%) scale(1.02);
    }
}

/* حاوية رئيسية */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ========================================
   صندوق الهيدر - Header Box
   ======================================== */
.header-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: slideDown 0.6s ease-out;
}

    /* تأثير خلفية متحركة للهيدر */
    .header-box::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient( 45deg, transparent 30%, rgba(15, 81, 50, 0.02) 50%, transparent 70% );
        animation: shimmer 8s linear infinite;
    }

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.header-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100% );
    background-size: 200% 100%;
    animation: gradientMove 3s ease-in-out infinite;
}

@keyframes gradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* الشعار */
.company-logo {
    max-width: 140px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(15, 81, 50, 0.15));
    transition: var(--transition);
    animation: logoFade 0.8s ease-out;
}

    .company-logo:hover {
        transform: scale(1.05) rotate(2deg);
        filter: drop-shadow(0 6px 12px rgba(15, 81, 50, 0.25));
    }

/* العنوان الرئيسي */
.page-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(15, 81, 50, 0.1);
    letter-spacing: -0.5px;
    animation: titleFade 1s ease-out;
}

/* العنوان الفرعي */
.page-subtitle {
    font-size: 16px;
    color: #258529;
    font-weight: 600;
    text-align: center;
    line-height: 1.8;
    position: relative;
    z-index: 1;
    animation: subtitleFade 1.2s ease-out;
}

/* ========================================
   صندوق الفلترة - Filter Box
   ======================================== */
.filter-box {
    background: #f0f9f4;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out 0.2s both;
}

    .filter-box::before {
        content: '🔍';
        position: absolute;
        top: 6px;
        left: 15px;
        font-size: 24px;
        opacity: 0.15;
        animation: pulse 2s ease-in-out infinite;
    }

    /* حقول الإدخال والاختيار */
    .filter-box .form-select,
    .filter-box .form-control {
        border: 2px solid var(--primary-color);
        border-radius: 12px;
        font-weight: 600;
        font-size: 15px;
        padding: 12px 18px;
        transition: var(--transition);
        background-color: #b5cdc0;
        box-shadow: var(--shadow-sm);
    }

        .filter-box .form-select:focus,
        .filter-box .form-control:focus {
            border-color: var(--primary-dark);
            box-shadow: 0 0 0 4px rgba(15, 81, 50, 0.15);
            outline: none;
            transform: translateY(-2px);
        }

        .filter-box .form-select:hover,
        .filter-box .form-control:hover {
            border-color: var(--primary-light);
            box-shadow: var(--shadow-md);
        }

/* ========================================
   قائمة الملفات - File List
   ======================================== */
.file-list {
    border-radius: 16px;
    overflow: visible;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

/* عنصر الملف */
.file-item {
    background: #ffffff;
    border: 2px solid #e8f5ed;
    margin-bottom: 12px;
    border-radius: 12px;
    padding: 18px 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    animation: slideIn 0.5s ease-out both;
    animation-delay: calc(var(--index, 0) * 0.05s);
}

    .file-item::before {
        content: '';
        position: absolute;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent 0%, rgba(15, 81, 50, 0.05) 50%, transparent 100% );
        transition: right 0.6s ease;
    }

    .file-item:hover::before {
        right: 100%;
    }

    .file-item:hover {
        background: #f0f9f4;
        border-color: var(--primary-color);
        box-shadow: var(--shadow-lg);
        transform: translateX(-8px) scale(1.02);
    }

    /* رابط التحميل */
    .file-item a {
        font-weight: 700;
        font-size: 16px;
        color: var(--primary-color);
        text-decoration: none;
        transition: var(--transition);
        display: inline-flex;
        align-items: center;
        gap: 10px;
        position: relative;
        z-index: 1;
    }

        .file-item a::before {
            content: '📄';
            font-size: 20px;
            transition: var(--transition);
        }

        .file-item a:hover {
            color: var(--primary-dark);
            text-decoration: none;
            transform: translateX(-4px);
        }

    .file-item:hover a::before {
        transform: scale(1.2) rotate(5deg);
    }

    /* شارة القسم */
    .file-item .badge {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        font-size: 13px;
        font-weight: 600;
        padding: 6px 14px;
        border-radius: 20px;
        box-shadow: var(--shadow-sm);
        transition: var(--transition);
        position: relative;
        z-index: 1;
    }

    .file-item:hover .badge {
        background: linear-gradient(135deg, var(--secondary-color) 0%, #b8941f 100%);
        transform: scale(1.05);
        box-shadow: var(--shadow-md);
    }

/* ========================================
   الرسوم المتحركة - Animations
   ======================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes logoFade {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes titleFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtitleFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.15;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.25;
    }
}

/* ========================================
   التصميم المتجاوب - Responsive Design
   ======================================== */

/* الأجهزة اللوحية الكبيرة */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 15px;
    }

    .page-title {
        font-size: 28px;
    }

    .header-box {
        padding: 30px 25px;
    }
}

/* الأجهزة اللوحية */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .company-logo {
        max-width: 110px;
    }

    .header-box {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .filter-box {
        padding: 20px;
        border-radius: 12px;
    }

        .filter-box .row {
            gap: 10px;
        }

        .filter-box .col-md-4 {
            margin-bottom: 10px;
        }

    .file-item {
        padding: 15px 18px;
        margin-bottom: 10px;
    }

        .file-item a {
            font-size: 15px;
        }

        .file-item .badge {
            font-size: 12px;
            padding: 5px 12px;
            margin-top: 8px;
            display: inline-block;
        }
}

/* الهواتف المحمولة */
@media (max-width: 576px) {
    .container {
        padding: 10px;
    }

    .page-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .page-subtitle {
        font-size: 13px;
        line-height: 1.6;
    }

    .company-logo {
        max-width: 90px;
        margin-bottom: 15px;
    }

    .header-box {
        padding: 20px 15px;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .filter-box {
        padding: 15px;
        margin-bottom: 20px;
    }

        .filter-box .form-select,
        .filter-box .form-control {
            font-size: 14px;
            padding: 10px 14px;
        }

    .file-item {
        padding: 12px 15px;
        border-radius: 10px;
        margin-bottom: 8px;
    }

        .file-item:hover {
            transform: translateX(-4px) scale(1.01);
        }

        .file-item a {
            font-size: 14px;
            gap: 8px;
        }

            .file-item a::before {
                font-size: 18px;
            }

        .file-item .badge {
            font-size: 11px;
            padding: 4px 10px;
            margin-top: 10px;
            display: block;
            width: fit-content;
        }
}

/* الهواتف الصغيرة جداً */
@media (max-width: 375px) {
    .page-title {
        font-size: 18px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .company-logo {
        max-width: 75px;
    }

    .file-item a {
        font-size: 13px;
    }
}

/* ========================================
   تحسينات إضافية
   ======================================== */

/* تأثير التمرير السلس */
html {
    scroll-behavior: smooth;
}

/* تحسين الأداء */
.file-item,
.filter-box,
.header-box {
    will-change: transform;
}

/* تأثير التركيز للوصولية */
*:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* تحسين عرض النصوص */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* رسالة عدم وجود نتائج */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 18px;
    font-weight: 600;
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   إعدادات الطباعة - Print Styles
   ======================================== */
@media print {
    body {
        background: white;
    }

        body::before {
            display: none;
        }

    .company-logo {
        max-width: 80px;
    }

    .header-box {
        page-break-inside: avoid;
        box-shadow: none;
        border: 2px solid var(--primary-color);
        background: white;
    }

    .filter-box {
        display: none;
    }

    .file-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 8px;
    }

        .file-item:hover {
            transform: none;
            box-shadow: none;
        }

        .file-item a {
            color: black;
        }

    .badge {
        background: #0f5132 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* وضع الظلام (اختياري) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1a2f23;
        --bg-white: #2d4a3a;
        --text-dark: #e0e0e0;
        --border-color: #3d5f4a;
    }

    body {
        background: #1e3d30;
    }
}
/* =========================
   كارت الملف - File Card
   ========================= */
.file-item {
    display: block;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e6f4ec;
}

    .file-item .d-flex {
        gap: 10px;
    }

    .file-item a {
        font-size: 17px;
        font-weight: 700;
        line-height: 1.6;
    }

    /* ترتيب اسم الملف والقسم */
    .file-item .badge {
        align-self: flex-start;
    }
@media (max-width: 576px) {

    /* الكارت */
    .file-item {
        padding: 16px;
        border-radius: 14px;
        box-shadow: 0 4px 12px rgba(15, 81, 50, 0.12);
        margin-bottom: 14px;
        background: linear-gradient( 135deg, #ffffff 0%, #f0f9f4 100% );
    }

        /* تحويل المحتوى إلى عمودي */
        .file-item .d-flex {
            flex-direction: column;
            align-items: flex-start;
        }

        /* اسم الملف */
        .file-item a {
            font-size: 15px;
            font-weight: 800;
            margin-bottom: 6px;
            display: block;
            width: 100%;
        }

            /* أيقونة الملف */
            .file-item a::before {
                font-size: 18px;
            }

        /* القسم */
        .file-item .badge {
            font-size: 12px;
            padding: 6px 14px;
            border-radius: 20px;
            margin-top: 4px;
            background: linear-gradient( 135deg, var(--primary-color), var(--primary-dark) );
            color: #fff;
        }
}
@media (hover: none) {
    .file-item:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(15, 81, 50, 0.2);
    }
}
