/* ============================================================
   RESOURCE COMPARISON TABLE STYLES (Borderless & Ultra-Compact)
   Resourify MD3 Integration - Borderless UI Policy
   Rule: NO animation on hover, NO drop shadows (box-shadow), NO borders
   ============================================================ */

.table-wrapper {
    margin: 16px 0 24px 0;
    width: 100%;
    background: var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface));
    border: none !important;
    border-radius: var(--md-sys-shape-corner-medium, 8px);
    padding: 14px 16px;
    transition: none;
    box-shadow: none !important;
}

.table-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.table-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.1px;
}

.table-count-badge {
    font-size: 10.5px;
    font-weight: 500;
    background: var(--md-sys-color-surface-container);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: var(--md-sys-shape-corner-full, 50px);
    border: none !important;
}

.table-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--md-sys-color-surface-container-low, var(--md-sys-color-surface));
    border: none !important;
    border-radius: var(--md-sys-shape-corner-medium, 6px);
    padding: 4px 10px;
    min-width: 220px;
}

.table-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.7;
}

.table-search-input {
    border: none !important;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    width: 100%;
}

.table-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--md-sys-shape-corner-small, 6px);
    border: 1px solid var(--table-border, rgba(0, 0, 0, 0.08)) !important;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
    background: transparent;
}

.table th {
    background: var(--table-header-bg, var(--md-sys-color-surface-container-low));
    color: var(--table-header-color, var(--text-heading));
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--table-border, rgba(0, 0, 0, 0.08)) !important;
    white-space: nowrap;
    user-select: none;
    position: relative;
}

.table th.sortable {
    cursor: pointer;
}

.table th.sortable:hover {
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container);
}

.table th .sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.table th.sort-asc .sort-icon::after {
    content: "↑";
    color: var(--md-sys-color-on-surface);
    font-weight: 700;
}

.table th.sort-desc .sort-icon::after {
    content: "↓";
    color: var(--md-sys-color-on-surface);
    font-weight: 700;
}

.table th.sort-asc,
.table th.sort-desc {
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container);
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--table-border, rgba(0, 0, 0, 0.08)) !important;
    color: var(--md-sys-color-on-surface);
    vertical-align: middle;
    line-height: 1.35;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.dark .table-scroll-container {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.dark .table th,
.dark .table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.dark .table tbody tr:last-child td {
    border-bottom: none !important;
}

.table tbody tr {
    background: transparent;
}

.table tbody tr:nth-child(even) {
    background: var(--md-sys-color-surface-container-lowest, rgba(0, 0, 0, 0.02));
}

.table tbody tr:hover {
    background: var(--md-sys-color-surface-container-low);
}

.table-provider-cell {
    font-weight: 600;
    white-space: nowrap;
}

.table-provider-link {
    color: var(--md-sys-color-on-surface);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    cursor: pointer;
    font-weight: 600;
}

.table-provider-link:hover {
    color: var(--link-color, #2960ec);
    text-decoration-thickness: 1.5px;
}

.table-capacity-badge {
    display: inline-block;
    font-weight: 600;
    font-size: 12px;
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container-low);
    padding: 2px 6px;
    border-radius: var(--md-sys-shape-corner-small, 4px);
    border: none !important;
    white-space: nowrap;
}

.table-price-cell {
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
}

.table-unit-price {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Minimal Compact Link Button */
.table-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 11.5px;
    font-weight: 600;
    border-radius: var(--md-sys-shape-corner-full, 50px);
    text-decoration: none;
    border: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: none;
    box-shadow: none !important;
}

.table-link-btn:hover {
    background: var(--accent-hover, #1e293b);
    color: var(--md-sys-color-on-primary);
    text-decoration: none;
}

html.dark .table-link-btn:hover {
    background: #ffffff;
    color: #000000;
}

/* Neutral minimal rating badge */
.table-rating-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--md-sys-shape-corner-small, 4px);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    border: none !important;
    white-space: nowrap;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ============================================================
   BOTTOM BRAND FEATURES & SECURITY OVERVIEW SECTION
   ============================================================ */
.table-brands-overview {
    margin-top: 28px;
}

.table-brands-heading {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 14px 0;
    line-height: 1.3;
}

.table-brand-card {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--md-sys-color-surface-container-low, var(--md-sys-color-surface));
    border: none !important;
    border-radius: var(--md-sys-shape-corner-medium, 8px);
    scroll-margin-top: 85px;
    box-shadow: none !important;
}

.table-brand-card:target,
.table-brand-card.highlighted {
    background: var(--md-sys-color-surface-container);
}

.table-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: none !important;
}

.table-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.table-brand-grid {
    display: grid;
    gap: 10px;
}

.table-brand-item {
    font-size: 12.5px;
    line-height: 1.45;
}

.table-brand-label {
    display: block;
    font-weight: 600;
    font-size: 11.5px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-brand-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .table-wrapper {
        padding: 12px 8px;
        margin: 14px 0;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .table-search-box {
        width: 100%;
        min-width: 0;
    }

    .table th, 
    .table td {
        padding: 7px 8px;
        font-size: 11.5px;
    }

    .table-brand-card {
        padding: 12px;
    }
}
