/* ============================================
   نظام التصميم الجديد - Dark & Modern
   ============================================ */

:root {
    /* لوحة الألوان الجديدة - نعناع منعش وغابة */
    --primary-color: #2a9d8f;
    /* أخضر نعناعي منعش */
    --primary-dark: #264653;
    /* أخضر غابي داكن */
    --primary-light: #a8dadc;
    /* أخضر مائي فاتح */

    --secondary-color: #6c757d;
    /* رمادي محايد */

    --accent-color: #e9c46a;
    /* ذهبي رملي كلمسة */

    /* ألوان الحالة */
    --success-color: #28a745;
    /* أخضر للنجاح */
    --danger-color: #e76f51;
    /* أحمر برتقالي للخطر */
    --warning-color: #f4a261;
    /* برتقالي للتحذير */

    /* ألوان الخلفيات والأسطح */
    --bg-body: #f8f9fa;
    /* خلفية بيضاء تقريبا */
    --bg-surface: #ffffff;
    /* أبيض نقي للأسطح */
    --bg-surface-2: #e9ecef;
    /* رمادي فاتح للتمييز */

    /* ألوان النصوص */
    --text-primary: #343a40;
    /* رمادي داكن للنصوص */
    --text-secondary: #6c757d;
    /* رمادي للنصوص الثانوية */
    --text-on-primary: #ffffff;
    /* أبيض على الأزرار الخضراء */

    /* ألوان الحدود */
    --border-color: #dee2e6;
    /* رمادي فاتح للحدود */

    /* الظلال */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.05);

    /* الخطوط */
    --font-family-sans-serif: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    /* 16px */
    --line-height-base: 1.7;

    /* تباعدات متجاوبة */
    --p-mobile: 1rem;
    --p-desktop: 2rem;
}

/* تحسين الطباعة المتجاوبة */
.h1-responsive { font-size: clamp(1.5rem, 5vw, 2.5rem); }
.h2-responsive { font-size: clamp(1.25rem, 4vw, 2rem); }
.h3-responsive { font-size: clamp(1.1rem, 3vw, 1.75rem); }


/* ============================================
   إعدادات عامة
   ============================================ */
body {
    font-family: var(--font-family-sans-serif);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: var(--line-height-base);
    padding-top: 80px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-primary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

/* ============================================
   شريط التنقل (Navbar)
   ============================================ */
.navbar {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.05rem;
    color: #a5b4fc;
}

.nav-link {
    color: #cbd5e1;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
    color: #818cf8;
}

/* ============================================
   قسم الهيرو (Hero Section)
   ============================================ */
.hero-section {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-section .display-3 {
    font-size: 3rem;
    font-weight: 700;
}

/* ============================================
   البطاقات (Cards)
   ============================================ */
.card,
.service-card,
.stat-card,
.form-container,
.result-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: none;
    margin-bottom: 2rem;
    transition: all 0.2s ease-in-out;
}

.card:hover,
.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

/* ============================================
   الأزرار (Buttons)
   ============================================ */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--text-on-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.2);
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.btn i, .btn-premium i {
    font-size: 18px !important; /* حجم ثابت للأيقونات ليناسب النص */
    line-height: 1 !important;
    vertical-align: middle !important;
    display: inline-block !important;
}

.btn-premium i {
    transition: transform 0.3s ease;
}

.btn-premium:hover i {
    transform: scale(1.1);
}

.btn-premium-next:hover i {
    transform: translateX(-4px) scale(1.1);
}

.btn-premium-prev:hover i {
    transform: translateX(4px) scale(1.1);
}

.btn-premium-home:hover i {
    transform: translateY(-2px) scale(1.1);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-on-primary);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

/* ============================================
   لوحة تحكم الأدمن (Admin Panel)
   ============================================ */
.admin-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-left: none;
    min-height: 100vh;
    padding-top: 1rem;
}

.admin-sidebar .nav-link {
    color: #cbd5e1;
    padding: 10px 16px;
    margin: 0 8px 4px;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.admin-sidebar .nav-link:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.admin-sidebar .nav-link.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.admin-content {
    background-color: var(--bg-body);
    padding: 2rem;
}

/* ============================================
   حالات الطلب (Request Status)
   ============================================ */
.request-status {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Status Colors - Matching Admin View */
.status-جديد, .status-new {
    background-color: #e0f2fe;
    color: #0369a1;
}

.status-بانتظار-موافقة-المدير {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-تمت-الموافقة, .status-completed {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-قيد-المراجعة {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fef3c7;
}

.status-تم-تعليق-المعاملة {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-مرفوض, .status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-جاري-الاعتمادية {
    background-color: #ecfeff;
    color: #0891b2;
    border: 1px solid #cffafe;
}

/* ============================================
   نماذج الإدخال (Forms)
   ============================================ */
.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control,
.form-select {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.25);
    outline: none;
}

/* ============================================
   صفحة نتائج الاستعلام
   ============================================ */
.result-container .header,
.top-bar {
    background-color: var(--bg-surface-2);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    background-color: var(--bg-surface-2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-right: 4px solid var(--primary-color);
}

.user-name {
    color: var(--primary-light);
    font-weight: 700;
}

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

th,
td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-surface-2);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background-color: var(--bg-surface-2);
}

.action-buttons {
    border-top: 1px solid var(--border-color);
}

/* ============================================
   تذييل الصفحة (Footer)
   ============================================ */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ============================================
   أدوات مساعدة (Utilities)
   ============================================ */
.text-danger {
    color: var(--danger-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

/* منع خروج العناصر عن الشاشة */
.overflow-x-hidden { overflow-x: hidden !important; }
.w-xs-100 { width: 100% !important; }

@media (max-width: 576px) {
    .p-mobile-0 { padding: 0 !important; }
    .m-mobile-0 { margin: 0 !important; }
    .rounded-mobile-0 { border-radius: 0 !important; }
}

/* ============================================
   التوافق مع الشاشات الصغيرة (Responsive)
   ============================================ */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        font-size: 0.95rem; /* تصغير الخط قليلا */
    }

    .hero-section {
        padding: 40px 15px; /* تقليل المسافات */
    }

    .hero-section .display-3 {
        font-size: 1.8rem; /* تصغير العنوان الرئيسي بشكل مناسب */
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }

    .admin-content {
        padding: 1rem 0.5rem; /* تقليل الحواف المزعجة */
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    /* تصغير الأيقونات */
    .service-icon {
        font-size: 2.5rem !important;
    }
    .fas, .far, .fa {
        font-size: 16px !important;
        max-width: 100% !important;
    }
    .btn-premium i, .btn i, .btn-flex i {
        font-size: 18px !important;
    }
    
    /* جعل البطاقات تملأ العرض مع مسافات بسيطة */
    .card, .service-card, .stat-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    /* منع خروج البطاقات عن نطاق الشاشة */
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden;
    }
    
    /* الجداول في النتائج */
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 0.75rem 0.5rem;
    }
}

/* ============================================
   قوائم البحث الذكي (Smart Search Dropdowns)
   ============================================ */
.dropdown-list {
    position: absolute;
    top: calc(100% + 5px);
    width: 100%;
    min-width: max-content;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1060;
    display: none;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.dropdown-item {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--bg-surface-2);
    color: var(--primary-color);
    padding-right: 25px;
    /* Subtle movement effect for RTL */
}

/* Custom Scrollbar for dropdown */
.dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: var(--bg-surface-2);
    border-radius: 10px;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}