/* ═══════════════════════════════════════════════════════════
   HosounDataTable - Shared DataTables Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── Card Container ─── */
.hosoun-dt-card .card {
    border: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border-radius: .75rem;
}
.hosoun-dt-card .card-header {
    background: #fff;
    border-bottom: 1px solid #f0f1f3;
    padding: 1rem 1.25rem;
}
.hosoun-dt-card .card-header h5 {
    font-weight: 600;
    margin-bottom: 0;
}
.hosoun-dt-card .card-header small {
    color: #878a99;
}

/* ─── Search Input (pill shape with icon) ─── */
.hosoun-dt-search { position: relative; }
.hosoun-dt-search::before {
    content: "\f0d1";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-family: 'remixicon' !important;
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}
.dataTables_filter input[type="search"] {
    padding-left: 36px !important;
    border-radius: 50rem !important;
    border: 1px solid #e9ecef !important;
    box-shadow: none !important;
    transition: border-color .2s ease;
}
.dataTables_filter input[type="search"]:focus {
    border-color: #405189 !important;
}
.dataTables_filter { width: 100%; }
.dataTables_filter label { width: 100%; }

/* ─── Table Header ─── */
thead.table-light th {
    background: #f8f9fc !important;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

/* ─── Row Hover ─── */
table.dataTable tbody tr:hover {
    background-color: #f6f9ff !important;
}

/* ─── Action Buttons (32px icon-only) ─── */
.hosoun-dt-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
.hosoun-dt-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all .2s ease;
}
.hosoun-dt-actions .btn i {
    font-size: 16px;
    margin: 0 !important;
}
.hosoun-dt-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

/* ─── Badge Color System (consistent soft badges) ─── */
/* These extend Bootstrap's subtle badges for consistency */

/* ─── Skeleton Placeholder ─── */
.hosoun-dt-skeleton td {
    padding: .75rem !important;
}
.hosoun-dt-skeleton .placeholder {
    border-radius: 4px;
    min-height: 14px;
}

/* ─── Row Fade-In Animation ─── */
.hosoun-dt-fade-in {
    animation: hosounDtFadeIn .3s ease-out;
}
@keyframes hosounDtFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── DataTables Responsive Adjustments ─── */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    background-color: #405189;
}

/* ─── Pagination ─── */
.dataTables_paginate .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: 13px;
}
.dataTables_paginate .page-item.active .page-link {
    background-color: #405189;
    border-color: #405189;
}

/* ─── Length Menu ─── */
.dataTables_length select {
    border-radius: 6px !important;
    border: 1px solid #e9ecef !important;
    padding: 4px 8px;
}

/* ─── Info Text ─── */
.dataTables_info {
    font-size: 13px;
    color: #878a99;
}

/* ─── Responsive Breakpoints ─── */
@media (max-width: 992px) {
    .hosoun-dt-card .card-header h5 {
        font-size: 16px;
    }
    .hosoun-dt-card .card-header small {
        font-size: 11px;
    }
    thead.table-light th {
        font-size: 11px;
        padding: 8px 4px;
    }
    table.dataTable tbody td {
        font-size: 12px;
        padding: 8px 4px;
    }
    .hosoun-dt-actions .btn {
        width: 28px;
        height: 28px;
    }
    .hosoun-dt-actions .btn i {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .badge {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    .hosoun-dt-actions .btn {
        width: 26px;
        height: 26px;
    }
    .hosoun-dt-actions .btn i {
        font-size: 13px;
    }
    .dataTables_paginate .pagination {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .hosoun-dt-card .card-body {
        padding: 12px;
    }
    .hosoun-dt-card .card-header {
        padding: 12px;
    }
    thead.table-light th {
        font-size: 10px;
        padding: 6px 2px;
    }
    table.dataTable tbody td {
        font-size: 11px;
        padding: 6px 2px;
    }
    .hosoun-dt-actions {
        gap: 3px;
    }
    .hosoun-dt-actions .btn {
        width: 24px;
        height: 24px;
    }
    .hosoun-dt-actions .btn i {
        font-size: 12px;
    }
}

/* ─── RTL adjustments ─── */
[dir="rtl"] .hosoun-dt-search::before {
    left: auto;
    right: 12px;
}
[dir="rtl"] .dataTables_filter input[type="search"] {
    padding-left: 12px !important;
    padding-right: 36px !important;
}
