/* ============================================
   Material for MkDocs - Enhanced Table Styles
   Compact, full-width, theme-integrated design
   ============================================ */

/* Override default table styling - FORCE 100% WIDTH */
.md-typeset table:not([class]) {
    font-size: 0.75rem;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    display: table;
    width: 100% !important;
    max-width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

/* Table header styling - Compact with theme colors */
.md-typeset table:not([class]) thead {
    background-color: var(--md-primary-fg-color--light, var(--md-default-fg-color--lightest));
    border-bottom: 1px solid var(--md-default-fg-color--lighter);
}

.md-typeset table:not([class]) thead th {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--md-primary-bg-color, var(--md-default-bg-color));
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: none;
    white-space: nowrap;
}

/* Table body styling - Compact */
.md-typeset table:not([class]) tbody tr {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    transition: background-color 0.15s ease;
}

.md-typeset table:not([class]) tbody tr:last-child {
    border-bottom: none;
}

.md-typeset table:not([class]) tbody tr:hover {
    background-color: var(--md-accent-fg-color--transparent, var(--md-default-fg-color--lightest));
}

.md-typeset table:not([class]) tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: top;
    border-bottom: none;
    line-height: 1.5;
}

/* First column styling - make it stand out like GitBook */
.md-typeset table:not([class]) tbody td:first-child {
    font-weight: 500;
    color: var(--md-default-fg-color);
}

/* Compact table styling for summary tables */
.md-typeset table:not([class]) tbody td code,
.md-typeset table:not([class]) tbody td .highlight {
    background-color: var(--md-code-bg-color);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Ensure proper spacing between table and surrounding content */
.md-typeset table:not([class]) {
    margin: 1em 0;
}

/* Emoji and icon support in tables */
.md-typeset table:not([class]) td .twemoji,
.md-typeset table:not([class]) th .twemoji {
    vertical-align: middle;
    height: 1.2em;
}

/* Multi-line content in cells - compact */
.md-typeset table:not([class]) td ul,
.md-typeset table:not([class]) td ol {
    margin: 0;
    padding-left: 1em;
}

.md-typeset table:not([class]) td p:last-child {
    margin-bottom: 0;
}

.md-typeset table:not([class]) td p {
    margin: 0.25em 0;
}

/* Responsive table handling */
@media screen and (max-width: 76.1875em) {
    .md-typeset table:not([class]) {
        font-size: 0.7rem;
    }
    
    .md-typeset table:not([class]) td,
    .md-typeset table:not([class]) th {
        padding: 0.4rem 0.6rem;
    }
}

/* Dark mode adjustments - Use theme colors */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
    border-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) thead {
    background-color: var(--md-primary-fg-color--light, rgba(255, 255, 255, 0.08));
    border-bottom-color: var(--md-default-fg-color--lighter);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) thead th {
    color: var(--md-primary-bg-color, var(--md-default-bg-color));
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:hover {
    background-color: var(--md-accent-fg-color--transparent, rgba(255, 255, 255, 0.04));
}

/* Specific styling for Integration Summary tables */
.md-typeset h3 + table:not([class]),
.md-typeset h4 + table:not([class]) {
    margin-top: 1em;
}

/* Key-value pair tables (2 columns) - Better width distribution */
.md-typeset table:not([class]):has(tbody tr td:nth-child(2):last-child) tbody td:first-child {
    width: 25%;
    min-width: 120px;
    font-weight: 600;
    color: var(--md-default-fg-color);
}

.md-typeset table:not([class]):has(tbody tr td:nth-child(2):last-child) tbody td:last-child {
    width: 75%;
}

/* Code blocks within tables */
.md-typeset table:not([class]) td code {
    font-family: var(--md-code-font-family);
    background-color: var(--md-code-bg-color);
    color: var(--md-code-fg-color);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
    word-break: break-word;
}

/* Badge-like elements in tables (✅ ❌) */
.md-typeset table:not([class]) td:has(.twemoji),
.md-typeset table:not([class]) td > svg {
    text-align: center;
}

/* Nested content indentation */
.md-typeset table:not([class]) td > ul:first-child,
.md-typeset table:not([class]) td > ol:first-child {
    margin-top: 0.5em;
}

/* Better line height for readability - compact */
.md-typeset table:not([class]) {
    line-height: 1.5;
}

/* Remove excessive padding from checkmark/cross columns */
.md-typeset table:not([class]) td:only-child {
    text-align: center;
}

/* Force table wrapper to be full width */
.md-typeset__table {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Override any default width constraints */
.md-typeset .md-typeset__scrollwrap {
    margin: 1em 0;
}

.md-typeset__scrollwrap table {
    width: 100% !important;
    min-width: 100%;
}

/* Additional full-width enforcement */
.md-content table:not([class]),
article table:not([class]) {
    width: 100% !important;
    max-width: 100% !important;
}

/* Prevent table shrinking */
.md-typeset table:not([class]) {
    min-width: 100%;
}

/* Override Material's default table container */
.md-typeset > table:not([class]) {
    display: table;
    width: 100% !important;
    table-layout: fixed;
}

/* For tables with specific column counts, distribute evenly */
.md-typeset table:not([class]):has(thead th:nth-child(2):last-child) {
    table-layout: fixed;
}

.md-typeset table:not([class]):has(thead th:nth-child(2):last-child) th:first-child,
.md-typeset table:not([class]):has(thead th:nth-child(2):last-child) td:first-child {
    width: 25%;
}

.md-typeset table:not([class]):has(thead th:nth-child(2):last-child) th:last-child,
.md-typeset table:not([class]):has(thead th:nth-child(2):last-child) td:last-child {
    width: 75%;
}