.theme-popup {
    --total_text_color: #e0e0e0;
    --total_font_family: Menlo, Roboto Mono, monospace;

    --btn_bg: #3a3a3a;
    --btn_padding: 0.5em;
    --btn_height: 2em;
    --btn_border_radius: 0.3125em;
    --btn_outline_width: 0.0625em;
    --btn_outline_color: #a0a0a0;
    --btn_outline_offset: 0.0625em;
    --btn_gap: 0.3125em;

    --list_padding: 0.5em;
    --list_bg: var(--btn_bg);
    --list_border_radius: var(--btn_border_radius);
    --list_gap: 0.1875em;
    --list_btn_hover_bg: #5a5656;
    --list_btn_active: #b9b9b970;
    --list_btn_border_radius: 0.25em;
    --list_btn_padding: 0.35em 1em;
    --list_btn_gap: 0.4375em;
    --list_btn_outline_width: 0.0625em;
    --list_btn_outline_color: rgb(212, 210, 210);
    --list_offset: 0.35em;
    --list_btn_font_size: 14px;
    --list_position_left: 0;
    --list_position_right: unset;
}

.theme-popup-button .theme-popup-icons svg,
#light,
#dark,
#default,
#checkbox,
.theme-popup-list-container {
    display: none;
}

.theme-popup {
    color: var(--total_text_color);
    font-family: var(--total_font_family);
    position: relative;
    user-select: none;
}

.theme-popup-list-container {
    position: absolute;
    left: var(--list_position_left);
    right: var(--list_position_right);
    top: calc(var(--btn_height) + var(--list_offset));
}

.theme-popup-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.theme-popup-button {
    line-height: var(--btn_height);
    background-color: var(--btn_bg);
    padding: 0 var(--btn_padding);
    display: inline-flex;
    align-items: center;
    column-gap: var(--btn_gap);
    border-radius: var(--btn_border_radius);
    border: none;
    color: inherit;
    font-family: inherit;
    outline: none;
    font-weight: bold;
}

.theme-popup-list {
    margin: 0;
    list-style-type: none;
    padding: var(--list_padding);
    border-radius: var(--list_border_radius);
    background-color: var(--list_bg);
    display: flex;
    flex-direction: column;
    row-gap: var(--list_gap);
}

.theme-popup-list label {
    display: flex;
    align-items: center;
    justify-content: start;
    column-gap: var(--list_btn_gap);
    padding: var(--list_btn_padding);
    border-radius: var(--list_btn_border_radius);
    white-space: nowrap;
}

.theme-popup-list label span {
    font-size: var(--list_btn_font_size);
}

/* actions */

#checkbox:checked~.theme-popup-button {
    outline: var(--btn_outline_width) solid var(--btn_outline_color);
    outline-offset: var(--btn_outline_offset);
}

#checkbox:checked~.theme-popup-list-container {
    display: block;
}

.theme-popup-list label:hover,
.theme-popup-button:hover,
#checkbox:checked~.theme-popup-button {
    background-color: var(--list_btn_hover_bg);
}

#default:checked~.theme-popup-list-container label[for="default"],
#light:checked~.theme-popup-list-container label[for="light"],
#dark:checked~.theme-popup-list-container label[for="dark"] {
    background-color: var(--list_btn_active);
    outline: var(--list_btn_outline_width) solid var(--list_btn_outline_color);
}

#default:checked~label svg.default,
#light:checked~label svg.sun,
#dark:checked~label svg.moon {
    display: block;
}

.dark-theme {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5rem;
}
