/* =========================================================================
   NFM Elementor Table – Styles
   ========================================================================= */

/* --- Wrapper --- */
.nfm-table-wrapper {
    position: relative;
    overflow: visible;
}

.nfm-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Table Base --- */
.nfm-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
    font-family: inherit;
}

/* --- Caption --- */
.nfm-table caption {
    padding: 12px 18px;
    font-weight: 600;
    font-size: 1.1em;
}

/* --- Header --- */
.nfm-table thead th {
    font-weight: 600;
    white-space: nowrap;
    position: relative;
    transition: background-color 0.2s ease;
}

.nfm-table thead th.nfm-sortable {
    cursor: pointer;
    user-select: none;
}

.nfm-table thead th.nfm-sortable:hover {
    filter: brightness(1.15);
}

.nfm-sort-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.8em;
    opacity: 0.6;
    vertical-align: middle;
}

/* --- Body Cells --- */
.nfm-table tbody td {
    transition: background-color 0.15s ease;
}

/* --- Row Highlight --- */
.nfm-table tbody tr.nfm-row-highlight td {
    background-color: var(--nfm-row-highlight, #fff3cd) !important;
}

/* --- Links in Cells --- */
.nfm-table tbody td a,
.nfm-table tbody td .nfm-cell-link {
    text-decoration: none;
    font-weight: inherit;
    transition: color 0.2s ease;
}

.nfm-table tbody td a:hover,
.nfm-table tbody td .nfm-cell-link:hover {
    text-decoration: underline;
}

/* --- Search --- */
.nfm-table-search {
    margin-bottom: 16px;
}

.nfm-table-search input.nfm-search-input {
    width: 100%;
    max-width: 380px;
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.nfm-table-search input.nfm-search-input:focus {
    border-color: #666;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* =========================================================================
   RESPONSIVE: Stack Mode
   ========================================================================= */

.nfm-table.nfm-stacked thead {
    display: none;
}

.nfm-table.nfm-stacked,
.nfm-table.nfm-stacked tbody,
.nfm-table.nfm-stacked tr,
.nfm-table.nfm-stacked td {
    display: block;
    width: 100%;
}

.nfm-table.nfm-stacked tbody tr {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nfm-table.nfm-stacked tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

.nfm-table.nfm-stacked tbody td:last-child {
    border-bottom: none;
}

.nfm-table.nfm-stacked tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
    flex-shrink: 0;
    margin-right: 16px;
    color: #555;
    font-size: 0.9em;
}

/* Scrollbar-Styling für scroll-Modus */
.nfm-table-scroll::-webkit-scrollbar {
    height: 6px;
}

.nfm-table-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nfm-table-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.nfm-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* --- Print Styles --- */
@media print {
    .nfm-table-search {
        display: none;
    }

    .nfm-table-wrapper {
        overflow: visible;
        box-shadow: none !important;
    }

    .nfm-table thead th {
        background-color: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nfm-sort-icon {
        display: none;
    }
}
