/***************************************************************************************************
 * 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.                                                                                *
 ****************************************************************************************************/

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

:root {
    --bg-base: #2d004d;
    --bg-primary: #1a0033;
    --bg-secondary: #240046;
    --bg-tertiary: #3c096c;
    --text-primary: #ff00ff;
    --text-secondary: #00ffff;
    --text-muted: #7a5af8;
    --border-color: #ff00ff;
    --accent-color: #00ffff;
    --accent-hover: #ffffff;
    --accent-secondary: #ffff00;
    --selection-bg: rgba(255, 0, 255, 0.3);
    --selection-text: #ffffff;
    --shadow-color: rgba(255, 0, 255, 0.5);
    --glow-text: 0 0 10px var(--text-primary);
    --glow-border: 0 0 10px var(--border-color);
    --card-radius: 0px;
    --border-width: 2px;
}

[data-theme="light"] {
    --bg-base: #f0e6ff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f0ff;
    --bg-tertiary: #e0ccff;
    --text-primary: #9d00ff;
    --text-secondary: #00bfff;
    --text-muted: #7a5af8;
    --border-color: #9d00ff;
    --shadow-color: rgba(157, 0, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-base: #2d004d;
        --bg-primary: #1a0033;
        --bg-secondary: #240046;
        --bg-tertiary: #3c096c;
        --text-primary: #ff00ff;
        --text-secondary: #00ffff;
        --text-muted: #7a5af8;
        --border-color: #ff00ff;
        --accent-color: #00ffff;
        --accent-hover: #ffffff;
        --selection-bg: rgba(255, 0, 255, 0.3);
        --selection-text: #ffffff;
    }
}

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

body {
    font-family: 'Orbitron', sans-serif;
    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.5;
    text-shadow: var(--glow-text);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border: var(--border-width) solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--glow-border);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--border-color);
}

.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: 20px;
    line-height: 1;
}

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

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

/* Card Style */
.card {
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--glow-border);
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

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

.card-title {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-secondary);
    text-shadow: 0 0 10px var(--text-secondary);
}

.card-content {
    padding: 24px;
}

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

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

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.filter-label:hover {
    box-shadow: 0 0 15px var(--border-color);
    transform: translateY(-2px);
}

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

.filter-label input[type="checkbox"]:checked {
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.filter-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-label .service-name {
    color: var(--text-secondary);
}

.filter-label .service-count {
    color: var(--text-muted);
    font-size: 11px;
}

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

.stat {
    text-align: center;
    padding: 24px 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    min-width: 160px;
    box-shadow: inset 0 0 10px var(--shadow-color);
}

.stat-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-color);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

.chart-container {
    min-width: 280px;
    max-width: 450px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 20px var(--shadow-color);
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

@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 24px;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.tab {
    padding: 14px 28px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 2px;
    background: var(--bg-secondary);
    border: var(--border-width) solid var(--border-color);
    border-bottom: none;
    transition: all 0.3s ease;
    margin-right: 4px;
}

.tab:hover {
    color: var(--text-secondary);
    box-shadow: 0 -5px 10px var(--shadow-color);
}

.tab.active {
    color: var(--accent-color);
    background: var(--bg-primary);
    border-bottom-color: var(--bg-primary);
    box-shadow: 0 -5px 15px var(--shadow-color);
    position: relative;
}

.tab-content {
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    padding: 24px;
    box-shadow: var(--glow-border);
}

.tab-panel {
    display: none;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    padding: 16px 24px;
    text-align: left;
    font-weight: 900;
    color: var(--text-secondary);
    border-bottom: var(--border-width) solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
}

td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--bg-tertiary);
    color: var(--text-primary);
}

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

tr:last-child td {
    border-bottom: none;
}

.time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.percent {
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--text-muted);
}

.color-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 12px;
    vertical-align: middle;
    box-shadow: 0 0 5px currentColor;
}

.service-badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    margin-left: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.category-badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 10px;
    background: var(--accent-color);
    border: 1px solid var(--border-color);
    color: var(--bg-primary);
    margin-left: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

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

.others-row td:first-child::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 10px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.others-row.expanded td:first-child::before {
    transform: rotate(90deg);
}

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

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

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

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    box-shadow: 0 0 10px var(--border-color);
}

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

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .stats {
        gap: 16px;
    }

    .stat {
        padding: 20px;
        min-width: 120px;
    }

    .stat-value {
        font-size: 28px;
    }

    .filter-label {
        padding: 8px 14px;
        font-size: 11px;
    }

    .tabs {
        padding: 0 12px;
    }

    .tab {
        padding: 12px 16px;
        font-size: 11px;
    }
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border: var(--border-width) solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-border);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

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

.scroll-top:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--border-color);
}

.scroll-top-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 12px solid currentColor;
}
