/* =========================================
   TABLE & LAYOUT
========================================= */

.table {
    --bs-table-striped-bg: #f8fcff;
    min-width: 100%;
}

/* STICKY HEADER - Stays visible when scrolling page */
.table thead th {
    position: sticky;
    top: 0; /* Adjust this if you have a fixed navbar - e.g., top: 60px */
    background-color: #f8f9fa;
    z-index: 20;
    width: 150px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Adds subtle shadow when sticky */
}

.table tbody td {
    width: 150px;
}

.table th, .table td {
    padding:.5rem .75rem;
}

/* Specific column widths */
.table th:first-child,
.table td:first-child {
    width: 200px;
}

.table th:last-child,
.table td:last-child {
    width: 100px;
}

/* Enable horizontal scrolling ONLY */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.table-responsive::-webkit-scrollbar {
    display: none;
}

/* Cell spacing */
table th,
table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.table-fixed {
    table-layout: fixed;
    width: 100%;
}

/* =========================================
   STICKY SCROLLBAR
========================================= */

.scrollbar-wrapper {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 100;
    background: white;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.scrollbar-content {
    height: 1px;
    background: transparent;
}

/* Enhanced scrollbar styling */
.scrollbar-wrapper::-webkit-scrollbar { 
    height: 12px;
    background: #f1f1f1;
} 

.scrollbar-wrapper::-webkit-scrollbar-thumb { 
    background: #888;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
    min-width: 40px;
} 

.scrollbar-wrapper::-webkit-scrollbar-track { 
    background: #f1f1f1;
    border-radius: 6px;
}

.scrollbar-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Remove scrollbar arrows/buttons */
.scrollbar-wrapper::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

/* =========================================
   ANIMATIONS
========================================= */

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in */
.fade-in,
.new-row {
    animation: fadeIn 0.3s ease-in-out;
}

/* Spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner-border {
    animation: spin 0.75s linear infinite;
}

/* =========================================
   LOADING OVERLAY
========================================= */

#loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   PAGINATION CONTROLS
========================================= */

#pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
