/* ==========================================================================
   DCP Table Builder — Frontend Styles
   ========================================================================== */

/* Wrapper */
.dcpub-table-wrapper {
    position: relative;
    margin-bottom: 24px;
}

/* Scroll container */
.dcpub-table-scroll-container {
    overflow-y: auto;
}
.dcpub-table-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Base table */
.dcpub-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.dcpub-table th,
.dcpub-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

/* Group header row */
.dcpub-group-header td {
    font-weight: 700;
    font-size: 0.95em;
    padding: 10px 12px;
    background-color: #e8e8e8 !important;
    border-bottom: 2px solid #ccc;
}

/* ---------------------------------------------------------------------------
   Responsive — hide columns on mobile
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .dcpub-hide-mobile {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------------- */
.dcpub-table-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
    justify-content: center;
}

.dcpub-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}
.dcpub-page-btn:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}
.dcpub-page-btn.dcpub-page-active {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
    font-weight: 600;
    cursor: default;
}

/* ---------------------------------------------------------------------------
   Loading overlay
   --------------------------------------------------------------------------- */
.dcpub-table-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.dcpub-table-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: dcpub-spin 0.6s linear infinite;
}

@keyframes dcpub-spin {
    to {
        transform: rotate(360deg);
    }
}
