/* Responsive Tables CSS */

/* Wrapper for responsive tables */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Base responsive table styles */
.table-responsive {
    min-height: .01%;
    overflow-x: auto;
}

/* Mobile-first table approach */
@media (max-width: 767px) {
    /* Force table to not be like tables anymore */
    .table-mobile-stack table,
    .table-mobile-stack thead,
    .table-mobile-stack tbody,
    .table-mobile-stack th,
    .table-mobile-stack td,
    .table-mobile-stack tr {
        display: block;
    }

    /* Hide table headers (but not display: none;, for accessibility) */
    .table-mobile-stack thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-mobile-stack tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        border-radius: 8px;
        overflow: hidden;
    }

    .table-mobile-stack td {
        /* Behave like a "row" */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important;
        white-space: normal;
        text-align: right;
    }

    .table-mobile-stack td:last-child {
        border-bottom: none;
    }

    .table-mobile-stack td:before {
        /* Now like a table header */
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label);
    }
}

/* Provider comparison table specific */
.provider-comparison-table {
    font-size: 0.9rem;
}

@media (max-width: 767px) {
    .provider-comparison-table {
        font-size: 0.8rem;
    }
    
    .provider-comparison-table th,
    .provider-comparison-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Hide less important columns on mobile */
    .provider-comparison-table .hide-mobile {
        display: none;
    }
}

/* Horizontal scroll indicator */
.table-scroll-indicator {
    position: relative;
}

.table-scroll-indicator::after {
    content: '→';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    color: var(--bs-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-scroll-indicator.scrollable::after {
    opacity: 1;
}

/* Price table responsive */
.price-table-responsive {
    display: table;
    width: 100%;
}

@media (max-width: 575px) {
    .price-table-responsive {
        display: block;
    }
    
    .price-table-responsive tbody {
        display: block;
    }
    
    .price-table-responsive tr {
        display: flex;
        flex-wrap: wrap;
        border-bottom: 1px solid #dee2e6;
        padding: 0.5rem 0;
    }
    
    .price-table-responsive td {
        flex: 1 1 50%;
        border: none !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    .price-table-responsive td:first-child {
        flex: 1 1 100%;
        font-weight: bold;
        background-color: #f8f9fa;
        margin-bottom: 0.25rem;
    }
}