/* =============================================================
   Tabelle Gamecast — Design System v3
   File: assets/css/gc-tables.css
   ============================================================= */

/* =============================================================
   BASE
   ============================================================= */

.wp-block-table {
    margin: 32px 0;
    border-radius: 16px;
    overflow: hidden;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: relative;
}

.wp-block-table figure {
    margin: 0;
    background: transparent;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: transparent;
    margin: 0;
}

.wp-block-table th,
.wp-block-table td {
    box-shadow: none;
}

.wp-block-table thead th:first-child,
.wp-block-table tbody td:first-child {
    width: 36%;
}

.wp-block-table thead th,
.wp-block-table tbody td {
    text-align: left;
    vertical-align: middle;
}

/* =============================================================
   DARK MODE
   Supporta:
   - body.rb-dark
   - [data-theme="dark"]
   - default fallback
   ============================================================= */

/* Container dark */
.wp-block-table,
body.rb-dark .wp-block-table,
[data-theme="dark"] .wp-block-table {
    background: linear-gradient(160deg, #111128 0%, #16162e 100%);
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, .55),
        0 2px 10px rgba(0, 0, 0, .30),
        inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* Header dark */
.wp-block-table thead tr,
body.rb-dark .wp-block-table thead tr,
[data-theme="dark"] .wp-block-table thead tr {
    background: linear-gradient(90deg, #0d0d24 0%, #12122a 100%);
}

.wp-block-table thead th,
body.rb-dark .wp-block-table thead th,
[data-theme="dark"] .wp-block-table thead th {
    padding: 14px 22px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .58);
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, .05);
    border-bottom: 2px solid rgba(0, 173, 226, .22);
}

.wp-block-table thead th:last-child,
body.rb-dark .wp-block-table thead th:last-child,
[data-theme="dark"] .wp-block-table thead th:last-child {
    border-right: none;
}

/* Body rows dark */
.wp-block-table tbody tr,
body.rb-dark .wp-block-table tbody tr,
[data-theme="dark"] .wp-block-table tbody tr {
    background: transparent;
    transition: background .18s ease;
}

.wp-block-table tbody tr:nth-child(even),
body.rb-dark .wp-block-table tbody tr:nth-child(even),
[data-theme="dark"] .wp-block-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, .02);
}

.wp-block-table tbody tr:hover,
body.rb-dark .wp-block-table tbody tr:hover,
[data-theme="dark"] .wp-block-table tbody tr:hover {
    background: rgba(0, 173, 226, .08);
}

/* Cells dark */
.wp-block-table tbody td,
body.rb-dark .wp-block-table tbody td,
[data-theme="dark"] .wp-block-table tbody td {
    padding: 15px 22px;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(210, 218, 245, .78);
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, .05);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.wp-block-table tbody td:last-child,
body.rb-dark .wp-block-table tbody td:last-child,
[data-theme="dark"] .wp-block-table tbody td:last-child {
    border-right: none;
}

.wp-block-table tbody tr:last-child td,
body.rb-dark .wp-block-table tbody tr:last-child td,
[data-theme="dark"] .wp-block-table tbody tr:last-child td {
    border-bottom: none;
}

/* First column dark */
.wp-block-table tbody td:first-child,
body.rb-dark .wp-block-table tbody td:first-child,
[data-theme="dark"] .wp-block-table tbody td:first-child {
    font-weight: 700;
    color: #00ade2;
    white-space: nowrap;
    border-left: 3px solid rgba(0, 173, 226, .45);
    padding-left: 19px;
}

/* =============================================================
   LIGHT MODE
   Supporta:
   - body.rb-light
   - [data-theme="light"]
   ============================================================= */

/* Container light */
body.rb-light .wp-block-table,
[data-theme="light"] .wp-block-table {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow:
        0 6px 26px rgba(15, 23, 42, .08),
        0 1px 4px rgba(15, 23, 42, .05);
}

/* Figure / table light reset */
body.rb-light .wp-block-table figure,
[data-theme="light"] .wp-block-table figure,
body.rb-light .wp-block-table table,
[data-theme="light"] .wp-block-table table {
    background: transparent;
}

/* Header light vero */
body.rb-light .wp-block-table thead tr,
[data-theme="light"] .wp-block-table thead tr {
    background: #f4f6fb;
}

body.rb-light .wp-block-table thead th,
[data-theme="light"] .wp-block-table thead th {
    padding: 14px 22px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7b8498;
    background: #f4f6fb;
    border-right: 1px solid rgba(15, 23, 42, .08);
    border-bottom: 1px solid rgba(15, 23, 42, .10);
}

body.rb-light .wp-block-table thead th:last-child,
[data-theme="light"] .wp-block-table thead th:last-child {
    border-right: none;
}

/* Body rows light */
body.rb-light .wp-block-table tbody tr,
[data-theme="light"] .wp-block-table tbody tr {
    background: transparent;
    transition: background .18s ease;
}

body.rb-light .wp-block-table tbody tr:nth-child(even),
[data-theme="light"] .wp-block-table tbody tr:nth-child(even) {
    background: transparent;
}

body.rb-light .wp-block-table tbody tr:hover,
[data-theme="light"] .wp-block-table tbody tr:hover {
    background: transparent;
}

/* Cells light */
body.rb-light .wp-block-table tbody td,
[data-theme="light"] .wp-block-table tbody td {
    padding: 15px 22px;
    font-size: 14px;
    line-height: 1.55;
    color: #1f2430;
    background: #ffffff !important;
    border-right: 1px solid rgba(15, 23, 42, .08);
    border-bottom: 1px solid rgba(15, 23, 42, .07);
    box-shadow: none !important;
}

body.rb-light .wp-block-table tbody td:last-child,
[data-theme="light"] .wp-block-table tbody td:last-child {
    border-right: none;
}

body.rb-light .wp-block-table tbody tr:nth-child(even) td,
[data-theme="light"] .wp-block-table tbody tr:nth-child(even) td {
    background: #f7f8fc !important;
}

body.rb-light .wp-block-table tbody tr:hover td,
[data-theme="light"] .wp-block-table tbody tr:hover td {
    background: rgba(239, 158, 64, .05) !important;
}

body.rb-light .wp-block-table tbody tr:last-child td,
[data-theme="light"] .wp-block-table tbody tr:last-child td {
    border-bottom: none;
}

/* First column light */
body.rb-light .wp-block-table tbody td:first-child,
[data-theme="light"] .wp-block-table tbody td:first-child {
    font-weight: 700;
    color: #c47e10;
    white-space: nowrap;
    border-left: 3px solid rgba(239, 158, 64, .50);
    padding-left: 19px;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 900px) {
    .wp-block-table {
        margin: 24px 0;
        border-radius: 14px;
    }

    .wp-block-table thead th,
    body.rb-dark .wp-block-table thead th,
    [data-theme="dark"] .wp-block-table thead th,
    body.rb-light .wp-block-table thead th,
    [data-theme="light"] .wp-block-table thead th {
        padding: 12px 16px;
        font-size: 10px;
    }

    .wp-block-table tbody td,
    body.rb-dark .wp-block-table tbody td,
    [data-theme="dark"] .wp-block-table tbody td,
    body.rb-light .wp-block-table tbody td,
    [data-theme="light"] .wp-block-table tbody td {
        padding: 13px 16px;
        font-size: 13px;
        line-height: 1.5;
    }

    .wp-block-table tbody td:first-child,
    body.rb-dark .wp-block-table tbody td:first-child,
    [data-theme="dark"] .wp-block-table tbody td:first-child,
    body.rb-light .wp-block-table tbody td:first-child,
    [data-theme="light"] .wp-block-table tbody td:first-child {
        padding-left: 14px;
    }
}

@media (max-width: 640px) {
    .wp-block-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wp-block-table table {
        min-width: 640px;
    }
}