/* Table Wrapper */
#rgst-table-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Controls Section */
.rgst-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
}

/* Search Input */
.rgst-search input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 250px;
    font-size: 14px;
}

.rgst-search input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Per Page Select */
.rgst-per-page select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

/* Table Container */
#rgst-table-container {
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
}

/* Hide DataTables search box */
.dataTables_filter {
    display: none !important;
}

/* Loading State */
.rgst-loading {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #666;
}

/* Table Styles */
.rgst-table {
    width: 100% !important;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* DataTables wrapper */
.dataTables_wrapper {
    width: 100% !important;
    overflow-x: hidden !important;
}

/* Header Styles */
.rgst-table thead th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: pointer;
}

.rgst-table thead th:hover {
    background-color: #e9ecef;
}

/* Sorting Icons */
.rgst-table thead th.sorting:after {
    content: "↕";
    margin-left: 5px;
    opacity: 0.3;
}

.rgst-table thead th.sorting_asc:after {
    content: "↑";
    margin-left: 5px;
}

.rgst-table thead th.sorting_desc:after {
    content: "↓";
    margin-left: 5px;
}

/* Body Styles */
.rgst-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.rgst-table tbody tr:last-child {
    border-bottom: none;
}

.rgst-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.rgst-table tbody tr:hover {
    background-color: #f2f2f2;
}

.rgst-table td {
    padding: 0.875rem 1rem;
    color: #444;
}

/* Pagination */
.rgst-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.dataTables_paginate {
    display: flex;
    gap: 5px;
}

.dataTables_paginate .paginate_button {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    color: #333;
    text-decoration: none;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.dataTables_paginate .paginate_button.current {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Text */
.dataTables_info {
    color: #666;
    font-size: 14px;
}

/* Error State */
.rgst-error {
    color: #dc3545;
    padding: 1rem;
    text-align: center;
    background: #fff;
    border: 1px solid #dc3545;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.rgst-loading {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .rgst-controls {
        flex-direction: column;
        gap: 10px;
    }

    .rgst-search input {
        width: 100%;
    }

    .rgst-table thead th {
        padding: 0.75rem;
    }

    .rgst-table td {
        padding: 0.75rem;
    }

    .dataTables_paginate .paginate_button {
        padding: 4px 8px;
    }
}
