/* v7 - 2026-01-23: Added media query support for instant Dark Mode */
/* Platform Child - Enhanced Tables v1.2 (Single Line & Dual Hints) */

/* 1. The Card Wrapper */
.pc-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 32px 0;
    overflow: hidden; 
    position: relative;
}

/* 2. The Scroll Container */
.pc-table-scroll-area {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Custom Scrollbar */
.pc-table-scroll-area::-webkit-scrollbar { height: 8px; }
.pc-table-scroll-area::-webkit-scrollbar-track { background: transparent; }
.pc-table-scroll-area::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }
.pc-table-scroll-area::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }

/* 3. Table Styling */
.pc-table-card table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.pc-table-card th,
.pc-table-card td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    /* FORCE SINGLE LINE */
    white-space: nowrap; 
}

/* Header Styles */
.pc-table-card th {
    background-color: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    font-family: 'Merriweather', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    
    /* Sortable */
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px; 
    transition: background-color 0.2s;
}

.pc-table-card th:hover { background-color: #e2e8f0; }

/* Sort Icons */
.pc-table-card th::after {
    content: '↕';
    position: absolute;
    right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 0.8em; opacity: 0.3;
}
.pc-table-card th.asc::after { content: '↑'; opacity: 1; color: #2563eb; }
.pc-table-card th.desc::after { content: '↓'; opacity: 1; color: #2563eb; }

.pc-table-card tr:last-child td { border-bottom: none; }
.pc-table-card tr:nth-child(even) td { background-color: #fcfcfc; }

/* 4. Scroll Hints (Top & Bottom) */
.pc-table-hint {
    display: none; /* Hidden by default */
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pc-table-hint:hover { background: #e2e8f0; color: #334155; }
.pc-table-hint-icon { display: inline-block; margin-right: 6px; font-size: 1.1em; vertical-align: middle; }

/* Top Hint specific border */
.pc-hint-top { border-bottom: 1px solid #e2e8f0; }
/* Bottom Hint specific border */
.pc-hint-bottom { border-top: 1px solid #e2e8f0; }

/* Show hints when overflow is detected */
.pc-has-overflow .pc-table-hint { display: block; }

/* --- JS-BASED DARK MODE --- */
[data-scheme="dark"] .pc-table-card { background: #1e293b; border-color: #334155; }
[data-scheme="dark"] .pc-table-card th { background-color: #0f172a; color: #f8fafc; border-bottom-color: #334155; }
[data-scheme="dark"] .pc-table-card th:hover { background-color: #1e293b; }
[data-scheme="dark"] .pc-table-card td { border-bottom-color: #334155; color: #cbd5e1; }
[data-scheme="dark"] .pc-table-card tr:nth-child(even) td { background-color: #1e293b; }
[data-scheme="dark"] .pc-table-hint { background: #0f172a; color: #94a3b8; }
[data-scheme="dark"] .pc-hint-top { border-bottom-color: #334155; }
[data-scheme="dark"] .pc-hint-bottom { border-top-color: #334155; }
[data-scheme="dark"] .pc-table-hint:hover { background: #1e293b; color: #fff; }
[data-scheme="dark"] .pc-table-scroll-area { scrollbar-color: #475569 transparent; }
[data-scheme="dark"] .pc-table-scroll-area::-webkit-scrollbar-thumb { background-color: #475569; }

/* --- INSTANT SYSTEM DARK MODE (v7) --- */
@media (prefers-color-scheme: dark) {
    body:not([data-scheme="light"]) .pc-table-card { background: #1e293b; border-color: #334155; }
    body:not([data-scheme="light"]) .pc-table-card th { background-color: #0f172a; color: #f8fafc; border-bottom-color: #334155; }
    body:not([data-scheme="light"]) .pc-table-card th:hover { background-color: #1e293b; }
    body:not([data-scheme="light"]) .pc-table-card td { border-bottom-color: #334155; color: #cbd5e1; }
    body:not([data-scheme="light"]) .pc-table-card tr:nth-child(even) td { background-color: #1e293b; }
    body:not([data-scheme="light"]) .pc-table-hint { background: #0f172a; color: #94a3b8; }
    body:not([data-scheme="light"]) .pc-hint-top { border-bottom-color: #334155; }
    body:not([data-scheme="light"]) .pc-hint-bottom { border-top-color: #334155; }
    body:not([data-scheme="light"]) .pc-table-hint:hover { background: #1e293b; color: #fff; }
    body:not([data-scheme="light"]) .pc-table-scroll-area { scrollbar-color: #475569 transparent; }
    body:not([data-scheme="light"]) .pc-table-scroll-area::-webkit-scrollbar-thumb { background-color: #475569; }
}