/* ======================================================= */
/* 📊 PREMIUM INTERACTIVE TABLES (GLASSMORPHISM) */
/* ======================================================= */

.interactive-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.interactive-table th,
.interactive-table td {
    padding: 18px 26px;
    text-align: left;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 2px solid rgba(255, 255, 255, 0.02);
    /* Extremely subtle in dark */
}

body.light-theme .interactive-table td {
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
    /* Subtle in light */
}

/* Header Styling */
.interactive-table th {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.2px;
    background: var(--table-bg, color-mix(in srgb, var(--surface-1) 70%, transparent));
    backdrop-filter: blur(var(--table-blur, 20px));
    -webkit-backdrop-filter: blur(var(--table-blur, 20px));
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: none;
    /* Soft shadow for header separation only */
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
}

/* Numbering Column (First Child) - CLEAN & FLAT */
.interactive-table th:first-child,
.interactive-table td:first-child {
    /* No sticky logic by default, unless JS adds it or .fixed-num class is used */
    font-weight: 600;
    color: var(--text-secondary);
    /* Muted numbering */
    /* REMOVED SHADOW AND BORDER */
    background: transparent;
    border-right: none;
    box-shadow: none !important;
}

/* Hover Effects */
.interactive-table tbody tr {
    transition: background-color 0.2s ease;
}

.interactive-table tbody tr:hover td {
    background-color: var(--table-hover-bg, color-mix(in srgb, var(--surface-1) 40%, transparent));
    color: var(--text-headings);
}

/* PINNED COLUMN STYLES (Applied via JS) */
.is-pinned {
    position: sticky !important;
    z-index: 5;
    background: var(--panel);
    /* Solid fallback */
    background: var(--table-bg, color-mix(in srgb, var(--panel) 98%, transparent)) !important;
    /* Almost opaque */
    backdrop-filter: blur(var(--table-blur, 20px));
    -webkit-backdrop-filter: blur(var(--table-blur, 20px));
    /* Right border shadow for pinned columns */
    box-shadow: 4px 0 12px -4px rgba(0, 0, 0, 0.2) !important;
    clip-path: inset(0px -20px 0px 0px);
    /* allow shadow to bleed right */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

th.is-pinned {
    z-index: 20 !important;
    /* Header pinned is highest */
    background: var(--surface-1);
    background: var(--table-bg, color-mix(in srgb, var(--surface-1) 95%, transparent)) !important;
}

body.light-theme .is-pinned {
    background: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 4px 0 12px -4px rgba(0, 0, 0, 0.08) !important;
}

/* PIN BUTTON STYLING */
.pin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    vertical-align: text-bottom;
    transition: all 0.2s var(--ease);
    opacity: 0.4;
}

.pin-btn:hover {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    opacity: 1;
    transform: scale(1.1);
}

.is-pinned .pin-btn,
.pin-btn.active {
    opacity: 1;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.pin-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

/* Wrapper */
.table-wrapper-glass {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: var(--radius-lg);
    background: var(--table-bg, color-mix(in srgb, var(--panel) 30%, transparent));
    backdrop-filter: blur(var(--table-blur, 20px)) !important;
    -webkit-backdrop-filter: blur(var(--table-blur, 20px)) !important;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

/* Scrollbar */
.thin-track-scrollbar::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.thin-track-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.thin-track-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

.thin-track-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

body.light-theme .thin-track-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
}