/* Shared Custom HTML Table styles for GSTR yearly reports and grids */

.custom-table-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 11.5px;
}

.custom-table-wrapper {
    background: #ffffff;
    border-radius: 0;
    max-height: 65vh;
}

/* Custom Scrollbar for modern look */
.custom-table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease-in-out;
}

.custom-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modern HTML Table Styling */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11.5px;
}

/* Force text color #121111 to override Bootstrap table defaults */
.custom-table tbody td,
.custom-table thead th,
.custom-table tfoot td,
.custom-table tbody td.link-label-cell button {
    color: #121111 !important;
}

/* Sticky Headers */
.custom-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    transition: background-color 0.2s;
    user-select: none;
}

.custom-table thead th.sortable-header {
    cursor: pointer;
}

.custom-table thead th.sortable-header:hover {
    background-color: #f1f5f9;
}

.custom-table thead th:last-child {
    border-right: none;
}

/* Table body row layout */
.custom-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    vertical-align: middle;
    transition: background-color 0.15s;
}

.custom-table tbody td:last-child {
    border-right: none;
}

/* Row Hover & Selection Styling */
.custom-table tbody tr {
    transition: background-color 0.15s;
    background-color: #ffffff;
}

.custom-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.custom-table tbody tr:hover {
    background-color: #f0f7ff !important;
}

/* Totals Footer Sticky bottom and style */
.custom-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 4;
}

.custom-table tfoot td {
    background: #e2e8f0 !important;
    border-top: 2px solid #cbd5e1 !important;
    border-bottom: none !important;
    font-weight: 700 !important;
    padding: 10px 12px !important;
}

/* Link Label Button styling inside cells */
.link-label-btn {
    text-decoration: underline !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}

.link-label-btn:hover {
    color: #1e3a8a !important;
}

/* Skeleton Loading Animation */
.skeleton-row td {
    padding: 12px !important;
}

.skeleton-cell {
    height: 14px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading-pulse 1.5s infinite;
    border-radius: 4px;
    width: 100%;
}

@keyframes loading-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom Pagination styling */
.custom-pagination-toolbar {
    background: #f8fafc;
    border-top: 1px solid #eef2f6;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.custom-pagination-btn {
    padding: 4px 8px;
    font-size: 11.5px;
    font-weight: 500;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #334155;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-pagination-btn:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.custom-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-page-indicator {
    font-size: 11.5px;
    font-weight: 500;
    color: #475569;
}

/* Reusable Filter Bar Sizing and Layout classes */
.filter-select-year {
    width: 100px;
    height: 26px;
    font-size: 11.5px;
}

.filter-select-month {
    width: 100px;
    height: 26px;
    font-size: 11.5px;
}

.filter-select-return {
    width: 90px;
    height: 26px;
    font-size: 11.5px;
}

.filter-select-section {
    width: 130px;
    height: 26px;
    font-size: 11.5px;
}

.filter-input-date {
    width: 115px;
    height: 26px;
    font-size: 11.5px;
}

.filter-btn-get {
    height: 26px;
    font-size: 11.5px;
}

.filter-search-box {
    width: 200px;
    min-width: 150px;
    height: 26px;
}

.filter-search-input {
    height: 26px;
    font-size: 11.5px;
}

.filter-search-clear {
    height: 26px;
}

.page-size-select {
    width: 75px;
    height: 26px;
    font-size: 11.5px;
}

/* Viewport height constrained layout wrapper */
.viewport-constrained-container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px) !important;
    overflow: hidden !important;
}

/* Custom Table stretch rules */
.custom-table-container.full-stretch {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
}

.custom-table-container.full-stretch .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.custom-table-container.full-stretch .custom-table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-height: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.custom-table-container.full-stretch .custom-table {
    width: 100% !important;
    min-width: 100% !important;
}

/* Support for SimpleHtmlGrid alignment in full-stretch layouts */
.card-grid.full-stretch {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.card-grid.full-stretch .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.card-grid.full-stretch .simplegrid-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100% !important;
}

.card-grid.full-stretch .simplegrid-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
}

.card-grid.full-stretch .simplegrid-table {
    width: 100% !important;
    min-width: 100% !important;
}

/* GSTR3B Specific Table Styling to mimic SmartGrid (Spreadsheet) look */
.custom-table-gstr3b {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11.5px;
}

.custom-table-gstr3b thead th {
    position: sticky;
    z-index: 5;
    background: var(--primary-theme, #5c6bc0) !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 1px solid #ffffff !important;
    border-right: 1px solid #ffffff !important;
    text-align: center;
    vertical-align: middle;
}

.custom-table-gstr3b thead tr:first-child th {
    top: 0;
}

.custom-table-gstr3b thead tr:nth-child(2) th {
    top: 31px; /* Offset for sticky double-headers */
}

.custom-table-gstr3b thead th:last-child {
    border-right: 1px solid #ffffff !important;
}

.custom-table-gstr3b tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    vertical-align: middle;
    color: #121111 !important;
}

.custom-table-gstr3b tbody td:last-child {
    border-right: 1px solid #e2e8f0 !important;
}

.custom-table-gstr3b tbody tr {
    background-color: #ffffff;
}

.custom-table-gstr3b tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.custom-table-gstr3b tbody tr:hover {
    background-color: #f0f7ff !important;
}

/* Totals Footer Sticky bottom and style for GSTR3B */
.custom-table-gstr3b tfoot {
    position: sticky;
    bottom: 0;
    z-index: 4;
}

.custom-table-gstr3b tfoot td {
    background: #f1f5f9 !important;
    border-top: 2px solid #5c6bc0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    font-weight: 700 !important;
    padding: 8px 10px !important;
    color: #121111 !important;
}


