/* ===== HORIZONTAL SCROLL CSS ===== */
/* File ini berisi styling khusus untuk fitur scroll horizontal pada tabel */

/* ===== PROGRESS PENGEMBALIAN TABLE SCROLL ===== */
.progress-pengembalian-table {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar untuk webkit browsers */
.progress-pengembalian-table::-webkit-scrollbar {
    height: 12px;
    background: #f8f9fa;
}

.progress-pengembalian-table::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.progress-pengembalian-table::-webkit-scrollbar-thumb {
    background: #20B2AA;
    border-radius: 6px;
    border: 2px solid #f8f9fa;
    min-width: 50px;
}

.progress-pengembalian-table::-webkit-scrollbar-thumb:hover {
    background: #008B8B;
}

.progress-pengembalian-table::-webkit-scrollbar-corner {
    background: #f8f9fa;
}

/* Firefox scrollbar */
.progress-pengembalian-table {
    scrollbar-width: thin;
    scrollbar-color: #20B2AA #f8f9fa;
}

/* Table styling dalam container scroll */
.progress-pengembalian-table .table {
    min-width: 1000px; /* Increased minimum width */
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.progress-pengembalian-table .table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    padding: 1rem;
    font-weight: 600;
    color: #343a40;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    min-width: 120px; /* Minimum width for each column */
}

.progress-pengembalian-table .table td {
    white-space: nowrap;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
    min-width: 120px; /* Minimum width for each column */
}

/* Specific column widths */
.progress-pengembalian-table .table th:nth-child(1), /* No */
.progress-pengembalian-table .table td:nth-child(1) {
    min-width: 60px;
    width: 60px;
    text-align: center;
}

.progress-pengembalian-table .table th:nth-child(2), /* Kode Barang */
.progress-pengembalian-table .table td:nth-child(2) {
    min-width: 140px;
    width: 140px;
}

.progress-pengembalian-table .table th:nth-child(3), /* Nama Barang */
.progress-pengembalian-table .table td:nth-child(3) {
    min-width: 200px;
    width: 200px;
}

.progress-pengembalian-table .table th:nth-child(4), /* Kategori */
.progress-pengembalian-table .table td:nth-child(4) {
    min-width: 120px;
    width: 120px;
}

.progress-pengembalian-table .table th:nth-child(5), /* Qty Dipinjam */
.progress-pengembalian-table .table td:nth-child(5) {
    min-width: 120px;
    width: 120px;
    text-align: center;
}

.progress-pengembalian-table .table th:nth-child(6), /* Qty Dikembalikan */
.progress-pengembalian-table .table td:nth-child(6) {
    min-width: 140px;
    width: 140px;
    text-align: center;
}

.progress-pengembalian-table .table th:nth-child(7), /* Status */
.progress-pengembalian-table .table td:nth-child(7) {
    min-width: 160px;
    width: 160px;
}

.progress-pengembalian-table .table th:nth-child(8), /* Satuan */
.progress-pengembalian-table .table td:nth-child(8) {
    min-width: 100px;
    width: 100px;
    text-align: center;
}

/* Hover effect pada baris tabel */
.progress-pengembalian-table .table tbody tr:hover {
    background-color: rgba(32, 178, 170, 0.08);
    transition: background-color 0.2s ease;
}

/* Badge styling dalam tabel */
.progress-pengembalian-table .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

/* Scroll indicator styling */
.scroll-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #20B2AA 0%, #008B8B 100%);
    opacity: 0.7;
    border-radius: 0 0 0.375rem 0.375rem;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

/* Scroll progress bar */
.scroll-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: #20B2AA;
    transition: width 0.3s ease;
    z-index: 15;
    border-radius: 0 0.375rem 0 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .progress-pengembalian-table {
        border-radius: 0.25rem;
        border: none;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    .progress-pengembalian-table .table th,
    .progress-pengembalian-table .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
        min-width: 100px;
    }
    
    .progress-pengembalian-table .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        min-width: 60px;
    }
    
    .progress-pengembalian-table::-webkit-scrollbar {
        height: 8px;
    }
}

/* Smooth scroll behavior */
.progress-pengembalian-table {
    scroll-behavior: smooth;
}

/* Focus styles untuk accessibility */
.progress-pengembalian-table:focus-within {
    outline: 2px solid #20B2AA;
    outline-offset: 2px;
}

/* Table header shadow effect */
.progress-pengembalian-table .table thead {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Zebra striping untuk readability */
.progress-pengembalian-table .table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.progress-pengembalian-table .table tbody tr:nth-child(even):hover {
    background-color: rgba(32, 178, 170, 0.12);
}

/* Loading state */
.progress-pengembalian-table.loading {
    opacity: 0.7;
    pointer-events: none;
}

.progress-pengembalian-table.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #20B2AA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
