:root {
    --background-primary: #36393F;
    --background-secondary: #2F3136;
    --switch-background: #72767D;
    --switch-background-active: #3BA55D;
    --switch-slider: #FFF;
    --table-background-hover: rgba(255, 255, 255, 0.04);
    --table-border: rgba(255, 255, 255, 0.06);
    --text: #DCDDDE;
    --text-input-bg: rgba(0, 0, 0, 0.1);
    --text-input-border: rgba(0, 0, 0, 0.3);
    --text-input-border-danger: #ED4245;
    --text-input-border-hover: #040405;
    --text-input-border-selected: #00AFF4;
}

[data-theme="light"] {
    --background-primary: #FFF;
    --background-secondary: #F2F3F5;
    --table-background-hover: rgba(0, 0, 0, 0.08);
    --table-border: rgba(6, 6, 7, .08);
    --text: #2E3338;
    --text-input-bg: rgba(79, 84, 92, 0.02);
    --text-input-border: rgba(79, 84, 92, 0.3);
    --text-input-border-hover: #B9BBBE;
    --text-input-border-selected: #0068E0;
}

* {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background-secondary);
    color: var(--text);
    font-family: Whitney, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1 {
    margin: 30px 0 15px;
    text-align: center;
}

main {
    background-color: var(--background-primary);
    border-radius: 8px;
    display: flex;
    margin: 20px auto;
    max-width: 1000px;
    padding: 30px;
}

@media only screen and (max-width: 1110px) {
    main {
        margin: 20px 25px;
    }
}

table {
    border-collapse: collapse;
    display: inline-block;
    width: calc(50% - 5px);
}

@media only screen and (max-width: 800px) {
    main {
        flex-direction: column;
        margin: 20px 0;
    }

    table {
        word-break: break-word;
        width: 100%;
    }

    table:last-child {
        margin-top: 50px;
    }

    .theme-switch span {
        display: none;
    }
}

table td {
    padding: 5px;
    transition: all 0.15s ease;
}

table th {
    padding: 5px 10px;
    user-select: none;
    -webkit-user-select: none;
}

table td:not(:last-child), table th:not(:last-child) {
    border-right: 1px solid var(--table-border);
}

table tr:not(:last-child) td, table th {
    border-bottom: 1px solid var(--table-border);
}

table.input td {
    padding: 5px 20px;
}

table.output th:hover {
    background-color: var(--table-background-hover);
    cursor: pointer;
}

table.output tr:hover td {
    background-color: var(--table-background-hover);
}


input[type=number] {
    -moz-appearance: textfield;
    background-color: var(--text-input-bg);
    border: 1px solid var(--text-input-border);
    border-radius: 3px;
    color: var(--text);
    font-family: Whitney, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 30px;
    outline: none;
    padding: 5px;
    transition: border-color .2s ease-in-out;
    width: 50px;
}

input[type=number]:hover {
    border-color: var(--text-input-border-hover);
}

input[type=number]:focus {
    border-color: var(--text-input-border-selected);
}

input[type=number].invalid {
    border-color: var(--text-input-border-danger);
}

input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 40px;
}

.switch input {
    height: 0;
    opacity: 0;
    width: 0;
}

.switch span {
    -webkit-transition: all 0.4s ease;
    background-color: var(--switch-background);
    border-radius: 14px;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: all 0.4s ease;
}

.switch span:before {
    -webkit-transition: all 0.4s ease;
    background-color: var(--switch-slider);
    border-radius: 50%;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    transition: all 0.4s ease;
    width: 18px;
}

nav {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-switch {
    height: 40px;
    display: inline-block;
    position: relative;
    width: 40px;
}

.theme-switch input {
    width: 0;
    height: 0;
    opacity: 0;
}

.theme-switch span {
    -webkit-transition: all 0.4s ease;
    background-color: var(--text);
    border-radius: 50%;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: all 0.4s ease;
}

.switch input:checked + span {
    background-color: var(--switch-background-active);
}

.switch input:checked + span:before {
    -ms-transform: translateX(16px);
    -webkit-transform: translateX(16px);
    transform: translateX(16px);
}