@media (prefers-color-scheme: dark) {
    :root {
        --bg: #181a1b;
        --border: #3b4245;
        --card: #232829;
        --text: #fbfbfb;
        --text-light: #d6dadc;
        --primary: #1b5f75;
        --primary-light: #24809f;
        --primary-text: #ceeaf4;
        --secondary: #9f2461;
        --secondary-text: #f4cee1;
        --secondary-light: #c92d7a;
        --error: #9f2424;
        --error-text: #f4cece;
    }
}
:root {
    --bg: #fbfbfb;
    --border: #dde0e2;
    --card: #eff0f1;
    --text: #232829;
    --text-light: #5e6a6e;
    --primary: #24809f;
    --primary-light: #2da1c9;
    --primary-text: #ceeaf4;
    --secondary: #9f2461;
    --secondary-text: #f4cee1;
    --secondary-light: #c92d7a;
    --error: #9f2424;
    --error-text: #f4cece;
}
:root:has(#toggle-theme:checked) {
    --bg: #181a1b;
    --border: #3b4245;
    --card: #232829;
    --text: #fbfbfb;
    --text-light: #d6dadc;
    --primary: #1b5f75;
    --primary-light: #24809f;
    --primary-text: #ceeaf4;
    --secondary: #9f2461;
    --secondary-text: #f4cee1;
    --secondary-light: #c92d7a;
    --error: #9f2424;
    --error-text: #f4cece;
}
.icon {
    filter: invert(1) brightness(2);
}

/* Toggle Switch Design */
.switch {
    position: fixed;
    top: 20px;
    right: 20px;
}

.switch input {
    display: none;
}
.slider {
    width: 50px;
    height: 25px;
    background: #ccc;
    border-radius: 30px;
    display: inline-block;
    position: relative;
}
.slider::before {
    content: "";
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    top: 1.5px;
    transition: .3s;
}
input:checked + .slider::before {
    transform: translateX(24px);
}

body {
    font-family: Helvetica, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    margin: auto;
}

h1 {
    font-size: 36px;
}

h3 {
    font-size: 18px;
    font-weight: lighter;
    color: var(--text-light);
}

p {
    font-size: 14px;
}

a {
    color: var(--secondary);
}

a:visited {
    color: var(--secondary-light);
}

.top {
    max-width: 100%;
    text-align: center;
    background: var(--card);
    padding-top: 1px;
    padding-bottom: 1px;
    margin-bottom: 1em;
}

footer {
    max-width: 100%;
    text-align: center;
    background: var(--card);
    padding-top: 5px;
    padding-bottom: 5px;
}

.content {
    max-width: 100%;
    margin: auto;
}

.inputgrid {
    display: grid;
    grid-template-columns: 80%
    grid-column-gap: 5px;
    grid-row-gap: 5px;
    margin-left: 10px;
    margin-right: 10px;
    padding: 20px; 0px;
}

@media (min-width: 700px) {
    .inputgrid {
        grid-template-columns: 3fr 1fr;
    }
}

input[type=text], input[type=number], textarea{
    flex-grow: 1;
    box-sizing:border-box;
    width: calc(50%);
    margin-left: 5px;
    padding: 6px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

select {
    flex-grow: 1;
    box-sizing:border-box;
    width: calc(100% - 5px);
    margin-left: 5px;
    padding: 8px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

button {
    display: inline-block;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    line-height: 16px;
    padding: 2px;
    margin: 1em;
    height: 32px;
    min-width: 60px;
    min-height: 32px;
    border: none;
    color: var(--primary-text);
    background-color: var(--primary);
    transition: background-color .17s ease,color .17s ease;
}
button:hover {
    background-color: var(--primary-light);
}

#loading, #output {
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.bbuttons {
    display: flex;
    justify-content: space-between;
}

.hidden {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.2);
}
.modal-content {
    background-color: var(--card);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border);
    width: 80%;
    animation-name: animatetop;
    animation-duration: 0.4s;
}
.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}
