/***************************************************************************************************
 * Copyright (C) 2026 by WallyHackenslacker wallyhackenslacker@noreply.git.hackenslacker.space      *
 *                                                                                                  *
 * Permission to use, copy, modify, and/or distribute this software for any purpose with or without *
 * fee is hereby granted.                                                                           *
 *                                                                                                  *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS     *
 * SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE  *
 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES      *
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,        *
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE *
 * OF THIS SOFTWARE.                                                                                *
 ****************************************************************************************************/

:root {
    --bg-base: #000000;
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --text-primary: #00ff00;
    --text-secondary: #00cc00;
    --text-muted: #006600;
    --border-color: #00ff00;
    --accent-color: #00ff00;
    --accent-hover: #33ff33;
    --selection-bg: #00ff00;
    --selection-text: #000000;
    --border-width: 1px;
    --scanline-opacity: 0.1;
}

[data-theme="light"] {
    --bg-base: #f0f0f0;
    --bg-primary: #ffffff;
    --bg-secondary: #e8e8e8;
    --bg-tertiary: #d0d0d0;
    --text-primary: #006600;
    --text-secondary: #004400;
    --text-muted: #002200;
    --border-color: #006600;
    --accent-color: #006600;
    --accent-hover: #008800;
    --selection-bg: #006600;
    --selection-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-base: #000000;
        --bg-primary: #000000;
        --bg-secondary: #0a0a0a;
        --bg-tertiary: #1a1a1a;
        --text-primary: #00ff00;
        --text-secondary: #00cc00;
        --text-muted: #006600;
        --border-color: #00ff00;
        --accent-color: #00ff00;
        --accent-hover: #33ff33;
        --selection-bg: #00ff00;
        --selection-text: #000000;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-base);
    background-image: __BACKGROUND_IMAGE_CUSTOM__;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.4;
    position: relative;
}

body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2000;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2100;
    width: 40px;
    height: 40px;
    border: var(--border-width) solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.1s;
}

.theme-toggle:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.theme-toggle .icon-auto {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .icon-auto::before,
.theme-toggle .icon-auto::after {
    position: absolute;
    font-size: 18px;
    line-height: 1;
}

.theme-toggle .icon-auto::before {
    content: 'S';
    clip-path: inset(0 50% 0 0);
}

.theme-toggle .icon-auto::after {
    content: 'T';
    clip-path: inset(0 0 0 50%);
}

/* Card Style */
.card {
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    margin-bottom: 20px;
    position: relative;
}

.card-header {
    padding: 8px 16px;
    border-bottom: var(--border-width) solid var(--border-color);
    background: var(--bg-tertiary);
}

.card-header::before {
    content: "> ";
}

.card-title {
    display: inline;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-content {
    padding: 16px;
}

.summaries-content {
    padding: 0;
    padding-top: 10px;
}

/* Filters */
.filters {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 4px;
}

.filter-label:hover {
    background: var(--text-muted);
    color: var(--bg-primary);
}

.filter-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    position: relative;
}

.filter-label input[type="checkbox"]:checked {
    background: var(--text-primary);
}

.filter-label input[type="checkbox"]:checked::after {
    content: 'X';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: var(--bg-primary);
}

.filter-label .service-name {
    text-transform: uppercase;
}

/* Stats */
.stats {
    display: flex;
    justify-content: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    min-width: 120px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Charts */
.charts-wrapper {
    display: grid;
    grid-auto-columns: minmax(280px, 450px);
    grid-template-columns: repeat(auto-fill, minmax(280px, 450px));
    grid-gap: 20px;
    justify-content: center;
}

.chart-container {
    padding: 10px;
    border: 1px dashed var(--border-color);
}

.chart-title {
    font-size: 12px;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}

@media (max-width: 700px) {
    .charts-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .chart-container {
        max-width: 100%;
        width: 100%;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    border: 1px solid transparent;
}

.tab:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.tab.active {
    color: var(--bg-primary);
    background: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.tab-content {
    border-top: 1px solid var(--border-color);
    padding: 16px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 8px;
    text-align: left;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
}

td {
    padding: 8px;
    border-bottom: 1px solid var(--text-muted);
}

tr:hover td {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.color-box {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border: 1px solid currentColor;
}

.service-badge {
    font-size: 10px;
    padding: 0 4px;
    border: 1px solid currentColor;
    margin-left: 8px;
}

.category-badge {
    font-size: 10px;
    padding: 0 4px;
    background: var(--text-muted);
    color: var(--bg-primary);
    margin-left: 4px;
}

/* Others row expansion */
.others-row {
    cursor: pointer;
}

.others-row td:first-child::before {
    content: '[+] ';
}

.others-row.expanded td:first-child::before {
    content: '[-] ';
}

.others-detail {
    display: none;
    background: var(--bg-tertiary);
}

.others-detail.visible {
    display: table-row;
}

.others-detail td {
    padding-left: 32px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2100;
    width: 40px;
    height: 40px;
    border: var(--border-width) solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.scroll-top-arrow::before {
    content: "^";
    font-size: 20px;
    font-weight: bold;
}
