/**
 * DataTable Custom Styles - Metronic RTL Arabic
 * تنسيقات مخصصة للداتاتيبل مع دعم RTL والعربية
 */

/* ===== General Table Styling ===== */
.dataTables_wrapper {
    direction: rtl;
    text-align: right;
}

.dataTables_wrapper .table {
    margin-bottom: 0 !important;
}

/* ===== Header Styling ===== */
.dataTables_wrapper .table thead th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #181C32;
    border-bottom: 2px solid #e4e6ef;
    padding: 1rem 1.5rem;
    text-align: right;
}

.dataTables_wrapper .table thead th.sorting,
.dataTables_wrapper .table thead th.sorting_asc,
.dataTables_wrapper .table thead th.sorting_desc {
    cursor: pointer;
    position: relative;
    padding-left: 2rem;
}

.dataTables_wrapper .table thead th.sorting:before,
.dataTables_wrapper .table thead th.sorting_asc:before,
.dataTables_wrapper .table thead th.sorting_desc:before {
    left: 0.5rem;
    right: auto;
}

/* ===== Body Styling ===== */
.dataTables_wrapper .table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #3F4254;
    text-align: right;
}

.dataTables_wrapper .table tbody tr:hover {
    background-color: #f9f9f9;
}

/* ===== Search Box ===== */
.dataTables_filter {
    margin-bottom: 1.5rem;
}

.dataTables_filter label {
    margin-bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_filter input {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* ===== Length Menu ===== */
.dataTables_length {
    margin-bottom: 1.5rem;
}

.dataTables_length label {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_length select {
    margin: 0 0.5rem;
}

/* ===== Info Text ===== */
.dataTables_info {
    padding-top: 1.5rem;
    color: #7E8299;
    font-size: 0.925rem;
}

/* ===== Pagination ===== */
.dataTables_paginate {
    padding-top: 1.5rem;
    text-align: left;
}

.dataTables_paginate .pagination {
    margin: 0;
    gap: 0.25rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0;
    border-radius: 0.475rem;
    border: 0;
    transition: all 0.15s ease;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #f1faff;
    color: #009ef7;
    border: 0;
}

.dataTables_paginate .paginate_button.current {
    background-color: #009ef7 !important;
    color: #ffffff !important;
    border: 0;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Processing Indicator ===== */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e4e6ef;
    border-radius: 0.475rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* ===== Empty State ===== */
.dataTables_empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #7E8299;
    font-size: 1rem;
}

/* ===== Action Buttons ===== */
.dataTables_wrapper .btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dataTables_wrapper .btn-icon i {
    margin: 0;
}

/* ===== Status Badges ===== */
.dataTables_wrapper .badge {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== Image Symbols ===== */
.dataTables_wrapper .symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dataTables_wrapper .symbol img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        text-align: center;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: 300px;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
    }

    .dataTables_wrapper .table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===== Dark Mode Support ===== */
[data-bs-theme="dark"] .dataTables_wrapper .table thead th {
    background-color: #1e1e2d;
    color: #ffffff;
    border-bottom-color: #2b2b40;
}

[data-bs-theme="dark"] .dataTables_wrapper .table tbody td {
    color: #92929f;
}

[data-bs-theme="dark"] .dataTables_wrapper .table tbody tr:hover {
    background-color: #1e1e2d;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: #565674;
}

[data-bs-theme="dark"] .dataTables_wrapper .paginate_button:hover {
    background-color: #1e1e2d;
    color: #009ef7;
}

/* ===== Loading Animation ===== */
@keyframes datatableLoading {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.dataTables_wrapper.loading tbody {
    animation: datatableLoading 1.5s ease-in-out infinite;
}

/* ===== Custom Scrollbar ===== */
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
