/* ===== Pro Data Tables - Frontend CSS v1.5 ===== */

/* === Responsive Scroll Wrapper === */
.pdt-responsive-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* === Scrollable Table Body (auto-applied when >5 rows) === */
.pdt-scroll-wrapper {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #d0d5dd;
    border-top: none;
}
.pdt-scroll-wrapper table {
    border-top: none;
}
.pdt-scroll-wrapper table thead th {
    border-top: none;
}

/* Sticky header when scrolling */
.pdt-scroll-wrapper thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Custom scrollbar */
.pdt-scroll-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.pdt-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.pdt-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 4px;
}
.pdt-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* === Base Table === */
.pdt-frontend-table {
    border-collapse: collapse;
    margin: 0 auto;
    width: 100%;
}

/* === Search === */
.pdt-search-wrap {
    text-align: left;
    margin-bottom: 12px;
}
.pdt-search-input {
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 260px;
    max-width: 100%;
    box-sizing: border-box;
}

/* === Sortable Headers === */
.pdt-frontend-table[data-sortable="1"] thead th {
    cursor: pointer;
    user-select: none;
    position: relative;
}
.pdt-frontend-table[data-sortable="1"] thead th:hover {
    opacity: 0.85;
}
.pdt-sort-icon {
    margin-left: 6px;
    font-size: 10px;
    opacity: 0.7;
}

/* === PDF Download Column === */
.pdt-pdf-td {
    text-align: center !important;
    white-space: nowrap;
}
.pdt-pdf-dl {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s, transform 0.15s;
}
.pdt-pdf-dl:hover {
    background: rgba(0,0,0,0.08);
    transform: scale(1.15);
}
.pdt-pdf-dl svg {
    display: block;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet & Phone: ≤ 768px */
@media screen and (max-width: 768px) {
    .pdt-responsive-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: 0;
        margin-right: 0;
    }
    .pdt-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 300px;
    }
    /* Make columns wide enough so only 4-5 fit on screen */
    .pdt-frontend-table thead th,
    .pdt-frontend-table tbody td {
        min-width: 80px;
        white-space: nowrap;
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
    .pdt-search-input {
        width: 100%;
    }
}
