/* Container */
.container {
    position: relative;
    z-index: 0;
}

.glass-card {
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-top: 3px solid var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(6, 46, 82, 0.04), 0 12px 32px rgba(6, 46, 82, 0.03);
}

/* === CST Layout Shell === */
.cst-glass-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-top: 3px solid var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(6, 46, 82, 0.04), 0 12px 32px rgba(6, 46, 82, 0.03);
    padding: 0 16px 16px 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.cst-card-header {
    flex: 0 0 auto;
    margin: 0 -16px 0 -16px;
    padding: 10px 24px;
}

.cst-table-area {
    flex: 1 1 0;
    overflow-x: auto;
    overflow-y: scroll !important;
    min-height: 0;
    margin-top: 4px;
    scrollbar-width: auto;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.cst-table-area .table {
    display: table;
    width: 100%;
    margin-bottom: 0;
}

.cst-table-area .table thead {
    display: table-header-group;
    position: sticky;
    top: 0;
    z-index: 100;
}

.cst-table-area .table tbody {
    display: table-row-group;
}

.cst-card-footer {
    flex: 0 0 auto;
    padding: 6px 16px;
    border-top: 1px solid var(--panel-border);
}

/* Card header area */
.coderstationtable-header {
    background: var(--primary-color);
    padding: 10px 24px;
    margin: 0 -16px 10px -16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Title inside dark header */
.coderstationtable-header h5 {
    color: #ffffff !important;
    position: relative;
    left: -10px;
}

.coderstationtable-header h5 i {
    color: #f4d1c3 !important;
}

/* Search input inside dark header */
.coderstationtable-header .glass-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.coderstationtable-header .glass-input:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.coderstationtable-header .form-control {
    color: #ffffff !important;
}

.coderstationtable-header .form-control::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

.coderstationtable-header .input-group-text i {
    color: rgba(255, 255, 255, 0.75) !important;
}

.table {
    color: var(--text-color);
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    background: #ffffff !important;
    display: table;
    width: 100%;
    min-width: 100%;
    position: relative;
    z-index: 50;
}

.table tbody {
    display: table-row-group;
    position: relative;
}

.table tbody tr {
    display: table-row;
}

.table th:nth-child(1),
.table td:nth-child(1) {
    width: 10%;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 20%;
}

.table th:nth-child(3),
.table td:nth-child(3) {
    width: 25%;
}

.table th:nth-child(4),
.table td:nth-child(4) {
    width: 20%;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 15%;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    width: 10%;
}

.table-responsive {
    border-radius: 5px;
    background: #ffffff;
    box-shadow: none;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.table-responsive::-webkit-scrollbar,
.cst-table-area::-webkit-scrollbar,
.table tbody::-webkit-scrollbar {
    height: 10px;
    width: 10px;
    display: block;
    background: transparent;
}

.table-responsive::-webkit-scrollbar-track,
.cst-table-area::-webkit-scrollbar-track,
.table tbody::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
    margin: 4px;
}

.table-responsive::-webkit-scrollbar-thumb,
.cst-table-area::-webkit-scrollbar-thumb,
.table tbody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.cst-table-area::-webkit-scrollbar-thumb:hover,
.table tbody::-webkit-scrollbar-thumb:hover {
    background: var(--button-background);
}

.table thead {
    display: table-header-group;
    position: sticky;
    top: 0;
    z-index: 100;
}

.table thead th {
    cursor: pointer;
    white-space: nowrap;
    border: none !important;
    background: #f1f5f9 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    padding: 14px 15px;
    font-size: 1.05rem;
}

.table tbody tr {
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    background: #ffffff !important;
    box-shadow: none;
}

.table tbody td, .coderstationtable tbody td, .coderstation-table tbody td {
    border: none !important;
    border-top: 1px solid var(--panel-border) !important;
    border-bottom: 1px solid var(--panel-border) !important;
    vertical-align: middle !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    font-size: 1.0rem;
    background: #ffffff !important;
    color: var(--text-color) !important;
    white-space: nowrap !important;
    text-overflow: ellipsis;
    overflow: hidden;
    height: 48px !important;
}

.table tbody tr, .coderstationtable tbody tr {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    height: 48px !important;
}

/* Zebra striping */
.table tbody tr:nth-child(even) td, .coderstationtable tbody tr:nth-child(even) td {
    background: #f8fafc !important;
}

.table tbody td:first-child {
    border-left: 1px solid var(--panel-border) !important;
    border-radius: 0;
}

.table tbody td:last-child {
    border-right: 1px solid var(--panel-border) !important;
    border-radius: 0;
}

.table tbody tr:first-child td:first-child {
    border-top-left-radius: 5px;
}

.table tbody tr:first-child td:last-child {
    border-top-right-radius: 5px;
}

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 5px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 5px;
}

.table-hover tbody tr:not(.coderstationtable-detail-row):hover {
    background: #eef2ff !important;
    box-shadow: inset 4px 0 0 var(--secondary-color);
    transform: translateY(-1px);
}

.table-hover tbody tr:not(.coderstationtable-detail-row):hover td {
    background: #eef2ff !important;
    color: var(--primary-color) !important;
}

/* Badges */
.table .badge {
    border: 1px solid transparent;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table .badge.bg-success {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #6ee7b7 !important;
}

.table .badge.bg-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

.search-wrapper {
    display: flex;
    justify-content: flex-end;
    position: relative;
    right: -10px;
}

.glass-input {

    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    width: 300px;
    max-width: 100%;
}

.glass-input:focus-within {
    background: #ffffff;
    border-color: var(--button-background);
    box-shadow: 0 0 0 3px rgba(38, 84, 158, 0.12);
    outline: none;
}

.coderstationtable-search-btn {
    background: color-mix(in srgb, var(--button-background) 15%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: none;
    border-left: 1px solid color-mix(in srgb, var(--button-background) 20%, transparent);
    padding: 0.25rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    border-radius: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.coderstationtable-search-btn:hover {
    background: var(--secondary-color);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(var(--bs-secondary-rgb, 255, 92, 10), 0.6);
}

.form-control,
.form-select,
.input-group-text {

    background: transparent !important;
    color: var(--text-color) !important;
    border: none !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.85rem !important;
}

.form-control::placeholder {

    color: rgba(17, 24, 39, 0.4);
}


.table-footer {
    margin-top: auto;
    padding: 6px 8px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 10px;
}

.footer-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 10px;
}

.footer-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 10px;
}

.coderstationtable-page-info {
    font-size: 0.85rem;
    color: #64748b;
    letter-spacing: 0.2px;
}

/* Show X entries wrapper */
.show-entries-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 4px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.show-entries-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.3px;
    white-space: nowrap;
    user-select: none;
}

.pagination {
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-link {

    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #ffffff;
    color: var(--primary-color);
    border: 1px solid var(--panel-border);
    transition: all 0.2s ease;
    margin: 0px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pagination .page-link:hover {

    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pagination .active .page-link {

    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(6, 46, 82, 0.15);
    font-weight: 600;
    color: #ffffff;
}

.pagination .disabled .page-link {
    opacity: .4;
    pointer-events: none;
}

@media (max-width: 992px) {
    .glass-input {
        width: 100%;
        max-width: none;
    }

    .table {
        font-size: .85rem;
    }

    .table-footer {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 15px;
        padding-top: 15px;
        text-align: center;
    }

    .footer-left {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .footer-left .show-entries-wrapper {
        justify-content: center;
    }

    .footer-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px !important;
        width: 100%;
    }

    .footer-right .coderstationtable-page-info {
        margin-bottom: 5px;
    }

    /* Tablet: Hide columns from 5th onwards */
    .table th:nth-child(n+5),
    .table td:nth-child(n+5) {
        display: none;
    }

    /* Accordion Styles (Tablet and Mobile) */
    .table tbody tr:not(.coderstationtable-detail-row) td:first-child {
        position: relative;
        padding-left: 30px;
        cursor: pointer;
    }

    .table tbody tr:not(.coderstationtable-detail-row) td:first-child::before {
        content: '\f0d7';
        /* fa-caret-down */
        font-family: "Font Awesome 6 Pro";
        font-weight: 900;
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%) rotate(-90deg);
        /* RIGHT */
        width: 16px;
        height: 16px;
        line-height: 16px;
        text-align: center;
        color: var(--text-color);
        display: inline-block;
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .table tbody tr:not(.coderstationtable-detail-row):not(.detail-show):hover td:first-child::before {
        transform: translateY(-50%) rotate(0deg);
        /* DOWN */
        color: var(--secondary-color);
    }

    .table tbody tr:not(.coderstationtable-detail-row) {
        cursor: pointer;
        transition: all 0.25s ease;
    }

    .table tbody tr:not(.coderstationtable-detail-row):hover,
    .table tbody tr:not(.coderstationtable-detail-row):hover td {
        background-color: #E5F3FF !important;
    }

    .table tbody tr.detail-show,
    .table tbody tr.detail-show td {
        background: #C1E6F5 !important;
    }

    .table tbody tr.detail-show td:first-child::before {
        transform: translateY(-50%) rotate(180deg);
        /* UP */
        color: var(--secondary-color);
    }
}

@media (max-width: 768px) {
    .header-right {
        width: 100% !important;
        justify-content: center !important;
    }

    .search-wrapper {
        width: 98% !important;
        right: 0 !important;
        justify-content: center !important;
    }

    .glass-input {
        width: 100% !important;
    }

    /* Mobile: Hide columns from 5th onwards */
    .table th:nth-child(n+5),
    .table td:nth-child(n+5) {
        display: none;
    }
}

/* Detail Row Styles */
.coderstationtable-detail-row {
    background: rgba(255, 92, 10, 0.06) !important;
    box-shadow: inset 4px 0 0 var(--secondary-color);
}

.coderstationtable-detail-row td {
    padding: 12px 16px !important;
}

.coderstationtable-details {
    list-style: none;
    padding: 16px !important;
    margin: 0;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 2px 0 rgba(255, 255, 255, 1);
    border: 1px solid var(--panel-border);
}

.coderstationtable-details li {
    padding: 12px 15px;
    border-bottom: 1px dashed var(--panel-border);
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.coderstationtable-details li:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.coderstationtable-details li:last-child {
    border-bottom: none;
}

.coderstationtable-details strong {
    opacity: 0.85;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    text-align: left;
}

.coderstationtable-details .detail-data {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    color: var(--text-color);
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.coderstationtable-details .detail-data>div {
    /* ensure inner flex containers don't center unexpectedly */
    justify-content: flex-start !important;
}

/* Dynamic Accordion Columns Mode */
@media (max-width: 992px) {

    .table[data-accordion-mode="true"] th,
    .table[data-accordion-mode="true"] td {
        display: none !important;
    }

    .table[data-accordion-mode="true"] th.acc-visible,
    .table[data-accordion-mode="true"] td.acc-visible,
    .table[data-accordion-mode="true"] td[colspan] {
        display: table-cell !important;
    }
}

.coderstationtable-limit {
    cursor: pointer !important;
}