/* Custom CSS for Arabic Employee Management System */

/* الخط الافتراضي للمشروع: beIN-Normal (الملف: static/fonts/beIN-Normal.ttf) */
@font-face {
    font-family: "beIN-Normal";
    src: url("../fonts/beIN-Normal.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

/* Base Styles & RTL Support */
body {
    font-family: "beIN-Normal", "Cairo", "Segoe UI", Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #eaeaea;
    color: #ffffff;
    overflow-x: hidden;
}

/* مجموعة قواعد لون النص في النظام - تمت إزالة إعدادات التطبيق العامة للسماح بتخصيص كل صفحة */
/* قمنا بإزالة قاعدة تحديد لون النص الأبيض للسماح للصفحات بتحديد ألوانها الخاصة */

/* Arabic Font Enhancement */
body,
h1,
h2,
h3,
h4,
h5,
h6,
.nav-link,
.btn,
.form-control,
.dropdown-item {
    font-family: "beIN-Normal", "Cairo", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Enhanced Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.25rem;
    color: var(--bs-primary);
}

h2 {
    font-size: 1.85rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    line-height: 1.6;
}

/* Fix Bootstrap RTL issues */
.dropdown-menu {
    position: absolute;
    top: 100%;           /* drop just below the trigger */
    right: 0;
    left: auto;
    text-align: right;
    z-index: 1000;       /* raised above most things */
    background-color: #0056b3;
    /* optional extras */
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  }
.form-check {
    padding-right: 1.25rem;
    padding-left: 0;
}

.form-check-input {
    margin-right: -1.25rem;
    margin-left: 0;
}

/* Custom card styling */
.card {
    border: none;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background-color: #1e3a5c;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #2a4f7a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    margin-bottom: 0;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
    background-color: #1e3a5c;
}

.card-footer {
    background-color: #2a4f7a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
}

/* Dashboard cards with icons */
.dashboard-card {
    transition: transform 0.3s;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow: hidden;
    border: none;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card .card-body {
    padding: 1.75rem;
}

.dashboard-card .card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.card-icon-bg {
    width: 140px;
    height: 140px;
    top: -40px;
    right: -30px;
    opacity: 0.2;
}

/* Stats Counter Animation */
.counter-value {
    font-size: 2rem;
    font-weight: bold;
}

/* Table enhancements */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table {
    margin-bottom: 0;
    border: none;
}

.table th {
    font-weight: 600;
    border-top: none;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--bs-info);
    padding: 1rem;
}

.table td {
    color: white;
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-info-rgb), 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(253, 242, 242, 0.03);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Enhanced Badges */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 6px;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.badge.bg-active {
    background-color: var(--bs-success);
}

.badge.bg-inactive {
    background-color: var(--bs-danger);
}

.badge.bg-on_leave {
    background-color: var(--bs-warning);
}

/* Button Enhancements */
.btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background-image: linear-gradient(
        135deg,
        var(--bs-primary),
        rgba(var(--bs-primary-rgb), 0.85)
    );
}

.btn-success {
    background-image: linear-gradient(
        135deg,
        var(--bs-success),
        rgba(var(--bs-success-rgb), 0.85)
    );
}

.btn-info {
    background-image: linear-gradient(
        135deg,
        var(--bs-info),
        rgba(var(--bs-info-rgb), 0.85)
    );
}

.btn-warning {
    background-image: linear-gradient(
        135deg,
        var(--bs-warning),
        rgba(var(--bs-warning-rgb), 0.85)
    );
}

.btn-danger {
    background-image: linear-gradient(
        135deg,
        var(--bs-danger),
        rgba(var(--bs-danger-rgb), 0.85)
    );
}

/* Improve form elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
}

.form-control,
.form-select {
    border-radius: 0.5rem;
}

/* Document status indicators */
.expiry-warning {
    color: var(--bs-warning);
}

.expiry-danger {
    color: var(--bs-danger);
}

.expiry-valid {
    color: var(--bs-success);
}

/* Custom navbar styling */
.navbar-custom {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link.active {
    font-weight: bold;
    position: relative;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 100%;
    height: 2px;
    background-color: var(--bs-primary);
}

/* ============================================= */
/* القائمة الجانبية — ألوان مطابقة للصورة المرفقة */
/* ============================================= */
/* خلفية رئيسية: #29406A | عنصر نشط: #4C72B0 | حد نشط: #5990D5 | شعار: #3F608F | نص: #F0F0F0 | شارة صفراء: #FFC107 | شارة حمراء: #DC3545 */

.sidebar {
    height: 100vh;
    position: fixed;
    right: 0;
    width: 16.66667%;
    top: 0;
    background: #29406A;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: width 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-content {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #A0A0A0 #606060;
    padding: 0.75rem 0.5rem;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #606060;
    border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: #A0A0A0;
    border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: #B0B0B0;
}

/* شعار القائمة — لون الدائرة #3F608F */
.sidebar .circular-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3F608F;
    border-radius: 12px;
    border: none;
    transition: background 0.25s ease, transform 0.2s ease;
}

.sidebar .circular-logo:hover {
    background: #4a6b9e;
    transform: scale(1.02);
}

.sidebar .logo-text {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    margin-bottom: 0.5rem;
    padding-left: 0;
    list-style: none;
}

/* عنصر القائمة */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    border-radius: 10px;
    margin: 0.2rem 0;
    padding: 0.65rem 0.85rem;
    transition: all 0.22s ease;
    position: relative;
    border: none;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateX(-2px);
}

/* العنصر النشط — خلفية #4C72B0 مع حد سفلي #5990D5 */
.sidebar .nav-link.active {
    background-color: #4C72B0;
    box-shadow: none;
    border-bottom: 2px solid #5990D5;
    border-radius: 10px 10px 0 0;
}

/* صندوق الأيقونة */
.sidebar .nav-link > i:not(.fa-chevron-down) {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    margin-right: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1rem;
    transition: all 0.22s ease;
}

.sidebar .nav-link:hover > i:not(.fa-chevron-down) {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar .nav-link.active > i:not(.fa-chevron-down) {
    background: rgba(255, 255, 255, 0.22);
}

.sidebar .nav-link span {
    font-weight: 450;
    font-size: 0.95rem;
    transition: font-weight 0.2s;
}

.sidebar .nav-link:hover span,
.sidebar .nav-link.active span {
    font-weight: 600;
}

.sidebar .nav-link > i.fa-chevron-down {
    margin-right: auto;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.9;
    transition: transform 0.25s ease;
}

/* نص وعناصر القائمة — أبيض/أوف وايت #F0F0F0 */
.nav-link-custom {
    color: #F0F0F0 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    transition: all 0.25s ease;
}

.nav-link-custom:hover {
    color: #ffffff !important;
}

.nav-link-custom.active {
    color: #ffffff !important;
}

.nav-link-custom > i:not(.fa-chevron-down) {
    color: #F0F0F0 !important;
}

.nav-link-custom:hover > i:not(.fa-chevron-down),
.nav-link-custom.active > i:not(.fa-chevron-down) {
    color: #ffffff !important;
}

/* شارة صفراء (مثل لوحة التحليلات) #FFC107 */
.sidebar .nav-link .badge.bg-warning,
.sidebar .nav-link .badge.bg-warning.text-dark {
    background-color: #FFC107 !important;
    color: #fff !important;
}

/* شارة حمراء (مثل إدارة السيارات) #DC3545 */
.sidebar .nav-link .badge.bg-danger {
    background-color: #DC3545 !important;
    color: #fff !important;
}

.sidebar-nav .nav-item ul.collapse .nav-link {
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    font-size: 0.9rem;
}

.sidebar-nav .nav-item ul.collapse .nav-link > i:not(.fa-chevron-down) {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.sidebar hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 0.75rem 0.5rem;
}

/* زر الإشعارات — إطار أبيض وخلفية شفافة */
.notification-sidebar-btn {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.15);
    color: #fff !important;
    transition: all 0.22s ease;
}

.notification-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff !important;
}

.notification-sidebar-btn i {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    color: #fff !important;
    transition: background 0.22s ease;
}

.notification-sidebar-btn:hover i {
    background: rgba(255, 255, 255, 0.18);
}

.notification-sidebar-btn .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
    background-color: #DC3545 !important;
    color: #fff !important;
}

/* منطقة المستخدم أسفل القائمة */
.sidebar .dropdown .dropdown-toggle {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: #F0F0F0 !important;
    transition: background 0.2s ease;
}

.sidebar .dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.sidebar .dropdown .dropdown-toggle img {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced Form Styling */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--bs-dark);
}

.form-text {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.input-group {
    border-radius: 8px;
    overflow: hidden;
}

.input-group-text {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Calendar picker custom styling */
.calendar-container {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Print styling */
@media print {
    .no-print {
        display: none;
    }

    .print-only {
        display: block;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }
}

/* Focus indication for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Custom colors for document types */
.document-national_id {
    border-right: 4px solid var(--bs-primary);
}

.document-passport {
    border-right: 4px solid var(--bs-success);
}

.document-health_certificate {
    border-right: 4px solid var(--bs-info);
}

.document-work_permit {
    border-right: 4px solid var(--bs-warning);
}

.document-education_certificate {
    border-right: 4px solid var(--bs-danger);
}

/* Help tooltip */
.help-tooltip {
    cursor: help;
    color: var(--bs-info);
}

/* Required field indicator */
.required-field::after {
    content: "*";
    color: var(--bs-danger);
    margin-right: 0.25rem;
}

/* Department visualization */
.department-card {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.department-header {
    padding: 1.25rem;
    background-color: var(--bs-primary);
    color: white;
    text-align: center;
    border-radius: 0.5rem 0.5rem 0 0;
}

.department-header h4 {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.department-body {
    padding: 1.25rem;
    background-color: rgba(var(--bs-light-rgb), 0.5);
}

.department-manager {
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Attendance Status Colors */
.status-present {
    background-color: rgba(var(--bs-success-rgb), 0.1);
}

.status-absent {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
}

.status-leave {
    background-color: rgba(var(--bs-warning-rgb), 0.1);
}

.status-sick {
    background-color: rgba(var(--bs-info-rgb), 0.1);
}

/* تنسيق عناوين ملخص الرواتب */
.salary-heading {
    color: #2a5885;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.salary-heading:hover {
    color: #3a7fb9;
    transform: translateY(-2px);
}

/* Better responsive tables */
.table-responsive {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    position: relative;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: auto; /* تأكيد على التمرير الأفقي */
    scrollbar-width: thin;
    white-space: nowrap; /* منع التفاف النص في الخلايا */
}

/* جدول مع تمرير أفقي سلس */
.table-horizontal-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* تجربة سلسة على الأجهزة اللمسية */
    overflow-y: hidden;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    background-color: #1e3a5c;
    cursor: grab; /* مؤشر السحب */
}

.table-horizontal-scroll:active {
    cursor: grabbing; /* مؤشر السحب النشط */
}

.table-horizontal-scroll table {
    min-width: 100%; /* الحد الأدنى لعرض الجدول */
    table-layout: auto; /* يسمح للجدول بالتمدد حسب المحتوى */
}

.table-horizontal-scroll:after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, rgba(30, 58, 92, 0), #1e3a5c);
    pointer-events: none;
    opacity: 0.8;
    z-index: 5;
}

.table-horizontal-scroll:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(30, 58, 92, 0), #1e3a5c);
    pointer-events: none;
    opacity: 0.8;
    z-index: 5;
}

.table-horizontal-scroll::after {
    animation: pulseGradient 2s ease-in-out infinite alternate;
}

@keyframes pulseGradient {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.9;
    }
}

/* ضمان عرض جميع الأعمدة بشكل واضح مع العرض المطلوب */
.table-horizontal-scroll th,
.table-horizontal-scroll td {
    white-space: nowrap; /* منع التفاف النص */
    min-width: 100px; /* حد أدنى لعرض الخلية */
    padding: 12px 15px; /* زيادة المساحة الداخلية */
}

/* تضمين عرض أدنى لبعض الأعمدة المهمة */
.table-horizontal-scroll th.th-name,
.table-horizontal-scroll td.td-name {
    min-width: 180px;
}

.table-horizontal-scroll th.th-id,
.table-horizontal-scroll td.td-id {
    min-width: 120px;
}

.table-horizontal-scroll th.th-actions,
.table-horizontal-scroll td.td-actions {
    min-width: 150px;
}

/* مؤثر بصري لتوضيح إمكانية التمرير */
.has-horizontal-scroll {
    position: relative;
}

.scroll-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    animation: fadeInOut 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fadeInOut {
    0%,
    100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.8;
    }
}

@media (max-width: 992px) {
    .table-horizontal-scroll table {
        min-width: 900px; /* عرض أكبر للجداول على الشاشات المتوسطة لضمان التمرير */
    }
}

@media (max-width: 768px) {
    .table-horizontal-scroll table {
        min-width: 800px; /* عرض أكبر للجداول على الشاشات الصغيرة لضمان التمرير */
    }
}

/* Scroll bar styling */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(var(--bs-primary-rgb), 0.5);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--bs-primary-rgb), 0.7);
}

/* Fixed header for tables with scrolling */
.table-fixed-header {
    position: relative;
    max-height: 65vh;
    overflow-y: auto;
}

.table-fixed-header thead th {
    position: fixed;
    right: 0;
    width: 16.66667%; /* col-lg-2 */
    top: 0;
    z-index: 10;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Infinite scrolling table container */
.table-infinite-scroll {
    position: relative;
    overflow: auto;
    max-height: 70vh;
}

/* Authentication pages styling */
.auth-wrapper {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        rgba(33, 37, 41, 0.95) 0%,
        rgba(33, 37, 41, 0.8) 100%
    );
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.2);
    filter: blur(50px);
    z-index: 0;
}

.auth-wrapper::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(20, 184, 166, 0.2);
    filter: blur(50px);
    z-index: 0;
}

.login-container,
.register-container,
.profile-container,
.unauthorized-container {
    max-width: 450px;
    width: 100%;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(33, 37, 41, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.login-container:hover,
.register-container:hover,
.profile-container:hover,
.unauthorized-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.login-container::before,
.register-container::before,
.profile-container::before,
.unauthorized-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-info));
}

.login-title,
.register-title,
.profile-title,
.unauthorized-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.login-logo,
.register-logo,
.profile-logo,
.unauthorized-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.login-logo img,
.register-logo img,
.profile-logo img,
.unauthorized-logo img {
    max-width: 100px;
    transition: all 0.5s ease;
    animation: float 3s ease-in-out infinite;
}

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

.login-logo::after,
.register-logo::after,
.profile-logo::after,
.unauthorized-logo::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(3px);
}

.login-btn,
.register-btn {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    border: none;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.login-btn.btn-primary,
.register-btn.btn-primary {
    background: linear-gradient(135deg, var(--bs-primary), #0056b3);
}

.login-btn.btn-light,
.register-btn.btn-light {
    background: linear-gradient(135deg, #f8f9fa, #e2e6ea);
}

.login-btn:hover,
.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.login-btn:active,
.register-btn:active {
    transform: translateY(1px);
}

.login-btn i,
.register-btn i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.login-btn:hover i,
.register-btn:hover i {
    transform: scale(1.2);
}

.system-name {
    font-size: 1.75rem;
    text-align: center;
    margin: 1rem 0 2rem;
    color: var(--bs-info);
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.system-name::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--bs-info),
        transparent
    );
}

/* Authentication forms */
.auth-wrapper .form-control {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.auth-wrapper .form-control:focus {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--bs-info);
    box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.25);
}

.auth-wrapper .form-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.auth-wrapper .form-check-label {
    color: rgba(255, 255, 255, 0.7);
}

.auth-wrapper .form-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.auth-wrapper .input-group-text {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.auth-wrapper a {
    color: var(--bs-info);
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-wrapper a:hover {
    color: #0dcaf0;
    text-decoration: underline;
}

.auth-wrapper .nav-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.auth-wrapper .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    border-radius: 0;
}

.auth-wrapper .nav-tabs .nav-link:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.auth-wrapper .nav-tabs .nav-link.active {
    color: var(--bs-info);
    background-color: transparent;
    border-color: var(--bs-info);
}

.auth-wrapper .alert {
    border-radius: 10px;
    border: none;
}

.auth-wrapper .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

.table-infinite-scroll .loading-indicator {
    display: none;
    text-align: center;
    padding: 1rem;
    font-style: italic;
    color: #6c757d;
}

.table-infinite-scroll.loading .loading-indicator {
    display: block;
}

/* Animation Effects */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-in {
    animation: slideInRight 0.5s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Enhanced page layout */
.content-wrapper {
    margin-right: 16.66667%; /* space for fixed sidebar */
    padding: 1.5rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 1.75rem;
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #6c757d;
    font-weight: 400;
}

/* Top action bar */
.action-bar {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.action-bar .btn-group {
    margin: 0.25rem;
}

/* Filter controls */
.filter-controls {
    background-color: rgba(var(--bs-primary-rgb), 0.03);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.filter-controls.active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-controls .form-group {
    margin-bottom: 1rem;
}

.filter-controls .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    margin: 0.25rem;
    transition: all 0.2s ease;
}

.filter-badge:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
}

.filter-badge .badge-remove {
    margin-right: 0.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.filter-badge .badge-remove:hover {
    opacity: 1;
}

.filter-toggle {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.filter-toggle.active {
    transform: rotate(180deg);
}

.filter-summary {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

/* Filter animation */
.filter-transition {
    transition: all 0.3s ease;
    overflow: hidden;
}

.filter-transition.collapse:not(.show) {
    display: block;
    height: 0;
    opacity: 0;
}

.filter-result-count {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(var(--bs-success-rgb), 0.1);
    color: var(--bs-success);
    margin-right: 0.5rem;
}

/* Visual feedback for filtering */
.highlight-new {
    animation: highlightNew 2s ease;
}

@keyframes highlightNew {
    0% {
        background-color: rgba(var(--bs-primary-rgb), 0.2);
    }
    100% {
        background-color: transparent;
    }
}

/* Enhanced attendance status visualization */
.status-present td {
    background-color: rgba(var(--bs-success-rgb), 0.05);
    border-left: 3px solid var(--bs-success);
    transition: all 0.3s ease;
}

.status-present:hover td {
    background-color: rgba(var(--bs-success-rgb), 0.1);
}

.status-absent td {
    background-color: rgba(var(--bs-danger-rgb), 0.05);
    border-left: 3px solid var(--bs-danger);
    transition: all 0.3s ease;
}

.status-absent:hover td {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
}

.status-leave td {
    background-color: rgba(var(--bs-warning-rgb), 0.05);
    border-left: 3px solid var(--bs-warning);
    transition: all 0.3s ease;
}

.status-leave:hover td {
    background-color: rgba(var(--bs-warning-rgb), 0.1);
}

.status-sick td {
    background-color: rgba(var(--bs-info-rgb), 0.05);
    border-left: 3px solid var(--bs-info);
    transition: all 0.3s ease;
}

.status-sick:hover td {
    background-color: rgba(var(--bs-info-rgb), 0.1);
}

/* Enhanced Select2 dropdown styling - تحسين مظهر قوائم الاختيار */
.select2-container--bootstrap-5 .select2-selection {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 6px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.select2-container--bootstrap-5 .select2-selection:hover {
    border-color: var(--bs-primary);
}

.select2-container--bootstrap-5
    .select2-selection--single
    .select2-selection__rendered {
    padding-right: 25px;
    padding-left: 15px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.95rem;
}

.select2-container--bootstrap-5
    .select2-selection--single
    .select2-selection__clear {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.2rem;
    font-weight: 300;
    transition: all 0.2s ease;
}

.select2-container--bootstrap-5
    .select2-selection--single
    .select2-selection__clear:hover {
    color: var(--bs-danger);
}

.select2-dropdown {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 3px;
    border-color: rgba(0, 0, 0, 0.1);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.select2-employee-option {
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    font-weight: 500;
}

/* تحسين مظهر أيقونات العناصر */
.select2-employee-option i.fas {
    opacity: 0.8;
    margin-left: 5px;
    font-size: 0.9rem;
}

.select2-employee-option .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 400;
}

/* RTL specific select2 adjustments */
.select2-container--bootstrap-5[dir="rtl"]
    .select2-selection--single
    .select2-selection__rendered {
    padding-left: 30px;
    padding-right: 15px;
}

/* Pagination styling */
.pagination {
    margin-top: 1rem;
}

.page-link {
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    border: none;
    color: var(--bs-primary);
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* Dark mode enhancements */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .action-bar {
    background-color: #1e3a5c;
}

[data-bs-theme="dark"] .table th {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2a4f7a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}

/* إصلاح ألوان نص العناوين في الأقسام - تحسينات الوضع المظلم */
[data-bs-theme="dark"] .department-header {
    background-color: var(--bs-primary);
    color: white !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .department-header h4 {
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .department-body {
    color: #f8f9fa;
    background-color: #2a4f7a;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .department-manager {
    color: #f8f9fa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .salary-heading {
    color: #8fd6ff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .salary-heading:hover {
    color: #b0e0ff;
}

[data-bs-theme="dark"] .department-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #1e3a5c;
}

[data-bs-theme="dark"] .badge.bg-primary {
    background-color: var(--bs-primary) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .page-link {
    background-color: #2a4f7a;
    color: #f8f9fa;
}

/* Select2 dark mode adjustments - تحسينات قوائم الاختيار للوضع المظلم */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: #2a4f7a;
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #2a4f7a;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-results__option {
    color: #fff !important;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-selection__rendered {
    color: #fff !important;
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-results__option--highlighted {
    background-color: rgba(var(--bs-primary-rgb), 0.3);
    color: #fff !important;
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-results__option--selected {
    background-color: rgba(var(--bs-primary-rgb), 0.4);
    color: #fff !important;
    font-weight: 500;
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-selection__placeholder {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .select2-search__field {
    color: #fff !important;
    background-color: #1e3a5c !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-bs-theme="dark"] .select2-employee-option .badge.bg-light {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ddd !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-selection__choice {
    background-color: rgba(var(--bs-primary-rgb), 0.3) !important;
    color: #fff !important;
    border: none !important;
}

[data-bs-theme="dark"] .select2-employee-option {
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-employee-option i.text-primary {
    color: var(--bs-primary) !important;
}

/* RTL-specific select2 adjustments - ضبط القوائم للعربية */
.select2-dropdown-rtl {
    text-align: right;
    direction: rtl;
}

.select2-dropdown-rtl .select2-results__option {
    padding-right: 15px;
    padding-left: 10px;
}

.select2-dropdown-rtl .select2-search__field {
    padding-right: 10px;
    text-align: right;
}

/* Override Select2 container styles to work properly in RTL */
.select2-container--bootstrap-5.select2-container--rtl
    .select2-selection--single
    .select2-selection__clear {
    float: left;
    margin-left: 10px;
    margin-right: 0;
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-dropdown
    .select2-search__field {
    background-color: #1e3a5c !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px;
}

[data-bs-theme="dark"]
    .select2-container--bootstrap-5
    .select2-dropdown
    .select2-search__field:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* تحسينات مظهر حقل البحث */
.select2-container--bootstrap-5 .select2-search--dropdown {
    padding: 10px;
}

.select2-container--bootstrap-5
    .select2-search--dropdown
    .select2-search__field {
    padding: 8px;
    border-radius: 4px;
}

/* تحسين ظهور الخيارات */
.select2-container--bootstrap-5 .select2-results__options {
    padding: 5px;
}

/* تحسين مظهر القائمة */
.select2-container--bootstrap-5 .select2-results__option {
    margin: 2px 0;
    border-radius: 4px;
    padding: 8px 10px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Submenu Styles */
.sidebar-nav .nav-item .collapse {
    transition: all 0.3s ease;
}

.sidebar-nav .nav-item .collapse.show {
    margin-top: 0.5rem;
}

.sidebar-nav .nav-item .fa-chevron-down {
    transition: transform 0.28s ease;
}

.sidebar-nav .nav-item:has(.collapse.show) .nav-link > i.fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar-nav .nav-item ul.collapse .nav-link {
    padding-left: 1rem;
    font-size: 0.95em;
}

.sidebar-nav .nav-item ul.collapse .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.form-label {
    color: white;
}

/* Responsive adjustments for fixed sidebar */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        right: -280px;
        width: 260px;
        height: 100vh;
        z-index: 1050;
        transition: right 0.3s ease-in-out;
    }

    .sidebar.sidebar-open {
        right: 0;
    }

    .content-wrapper {
        margin-right: 0 !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .col-lg-10.col-md-9 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
    }
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.sidebar-backdrop.active {
    display: block;
}

.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1060;
    background: #29406A;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

@media (max-width: 991px) {
    .sidebar-toggle-btn {
        display: block;
    }
}

/* ============================================= */
/* Notification System Styles */
/* ============================================= */

.notification-header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notification-floating-btn {
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    height: 44px;
}

.notification-floating-btn:hover {
    color: #fff;
    text-decoration: none;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.notification-sidebar-btn {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.notification-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.notification-badge {
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Dark theme adjustments for notifications */
[data-bs-theme="dark"] .notification-floating-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
