/* Light Mode Theme Overrides */
/* Using html[data-theme="light"] to ensure higher specificity than :root */
html[data-theme="light"] {
    --bg-color: #f0f0f4;
    --card-bg: #ffffff;
    --text-main: #202028;
    --text-muted: #666670;

    /* Adjusted accents for light background */
    --accent-primary: #d00040;
    --accent-success: #008833;
    --accent-info: #008899;
    --accent-warning: #b38600;

    --border-color: #202028;
    --shadow: 4px 4px 0px #202028;
}

/* Ensure transition for smooth toggle */
body,
.panel,
.stat-card,
.nes-container,
.app-icon,
.nes-btn,
.nes-input,
.nes-select,
header {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Table Text Truncation */
.truncate-text {
    text-decoration: underline dotted var(--accent-info);
    cursor: pointer;
    transition: color 0.2s;
}

.truncate-text:hover {
    color: var(--accent-info);
}

/* Global Detail Modal (Pixel Style) */
.pixel-modal {
    background: var(--card-bg) !important;
    border: 4px solid var(--border-color) !important;
    box-shadow: 8px 8px 0 var(--border-color) !important;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    position: relative;
    font-family: var(--font-main);
}

.pixel-modal .modal-header {
    font-size: 28px;
    color: var(--accent-warning);
    border-bottom: 4px solid var(--bg-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.pixel-modal .modal-body {
    line-height: 1.4;
    max-height: 60vh;
    overflow-y: auto;
}

/* Custom Scrollbar for Modal */
.pixel-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.pixel-modal .modal-body::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.pixel-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
    border: 4px solid var(--border-color);
}

.table-responsive table {
    margin-bottom: 0;
    min-width: 600px;
    /* Ensure a minimum width to prevent squishing */
    border: none;
    /* Border is handled by wrapper */
}

@media (max-width: 768px) {
    .table-responsive {
        border-width: 2px;
    }

    th,
    td {
        white-space: nowrap;
        /* Prevent text wrapping in cells on mobile */
        padding: 10px 8px;
    }
}