/***************************************************************************************************
 * 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: #ffb7ff;
    --bg-primary: rgba(255, 255, 255, 0.8);
    --bg-secondary: #01cdfe;
    --bg-tertiary: #fffb96;
    --text-primary: #ff71ce;
    --text-secondary: #01cdfe;
    --text-muted: #b967ff;
    --border-color: #05ffa1;
    --accent-color: #ff71ce;
    --accent-hover: #b967ff;
    --accent-secondary: #05ffa1;
    --selection-bg: rgba(255, 113, 206, 0.3);
    --selection-text: #ffffff;
    --shadow-color: rgba(1, 205, 254, 0.3);
    --card-radius: 4px;
    --border-width: 3px;
}

[data-theme="dark"] {
    --bg-base: #120458;
    --bg-primary: rgba(18, 4, 88, 0.9);
    --bg-secondary: #ff71ce;
    --bg-tertiary: #01cdfe;
    --text-primary: #05ffa1;
    --text-secondary: #ff71ce;
    --text-muted: #b967ff;
    --border-color: #01cdfe;
    --shadow-color: rgba(255, 113, 206, 0.5);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-base: #120458;
        --bg-primary: rgba(18, 4, 88, 0.9);
        --bg-secondary: #ff71ce;
        --bg-tertiary: #01cdfe;
        --text-primary: #05ffa1;
        --text-secondary: #ff71ce;
        --text-muted: #b967ff;
        --border-color: #01cdfe;
        --shadow-color: rgba(255, 113, 206, 0.5);
    }
}

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

body {
    font-family: 'MS PGothic', 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: 14px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-base);
    background-image: linear-gradient(45deg, var(--bg-base) 25%, transparent 25%), 
                      linear-gradient(-45deg, var(--bg-base) 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, var(--bg-tertiary) 75%), 
                      linear-gradient(-45deg, transparent 75%, var(--bg-tertiary) 75%);
    background-size: 100px 100px;
    background-image: __BACKGROUND_IMAGE_CUSTOM__;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    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: 8px 8px 0 var(--shadow-color);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 var(--shadow-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: 10px 10px 0 var(--shadow-color);
    margin-bottom: 40px;
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: var(--border-width) solid var(--border-color);
    background: linear-gradient(90deg, var(--bg-secondary), var(--text-primary));
}

.card-title {
    font-size: 24px;
    font-weight: 400;
    font-style: italic;
    color: #ffffff;
    text-shadow: 3px 3px 0 var(--text-muted);
}

.card-content {
    padding: 24px;
}

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

/* 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: 8px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    font-style: italic;
}

.filter-label:hover {
    transform: scale(1.05);
    background: #ffffff;
}

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

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

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

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

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

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

.stat {
    text-align: center;
    padding: 20px 30px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    min-width: 150px;
    box-shadow: 5px 5px 0 var(--text-muted);
}

.stat-value {
    font-size: 32px;
    font-weight: 400;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: lowercase;
    font-style: italic;
}

/* 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: #ffffff;
    border: var(--border-width) solid var(--border-color);
}

.chart-title {
    font-size: 18px;
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

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

.tab {
    padding: 12px 24px;
    cursor: pointer;
    color: var(--text-muted);
    font-style: italic;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-bottom: none;
    transition: all 0.2s ease;
}

.tab:hover {
    background: var(--bg-tertiary);
}

.tab.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    font-weight: bold;
    transform: translateY(-5px);
    box-shadow: 5px 0 0 var(--shadow-color);
}

.tab-content {
    background: #ffffff;
    border: var(--border-width) solid var(--border-color);
    padding: 24px;
    box-shadow: 10px 10px 0 var(--shadow-color);
}

.tab-panel {
    display: none;
}

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

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

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

th {
    padding: 12px 20px;
    text-align: left;
    font-style: italic;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-muted);
}

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

.color-box {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    vertical-align: middle;
    border: 1px solid #000;
}

.service-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg-secondary);
    color: #ffffff;
    margin-left: 8px;
}

.category-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    margin-left: 4px;
    border: 1px solid var(--border-color);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--text-primary);
    border: 3px solid var(--bg-tertiary);
}

/* 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: 8px 8px 0 var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

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

.scroll-top-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 12px solid var(--text-primary);
}

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

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

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

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

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

.others-detail td {
    padding-left: 48px;
    font-size: 13px;
    color: var(--text-muted);
}
