:root {
    --bg-color: #161616;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --shadow-dark: #0d0d0d;
    --shadow-light: #1f1f1f;
    --shadow-overlay: rgba(0, 0, 0, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --white: white;
}

body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

p {
    font-size: xx-large;
}

.container {
    width: 100%;
    max-width: 700px;
    margin: auto;
    text-align: center;
}

.tagline {
    font-size: large;
    margin-top: -1rem;
}

textarea {
    color: var(--text-primary);
    background-color: var(--bg-color);
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    margin: 10px 0;
    min-height: 25vh;
    max-height: 70vh;
    resize: vertical;
    border-radius: 8px;
    border: none;
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
    transition-duration: 0.2s;
    outline: none;
}

#key {
    width: 100%;
    resize: none;
    min-height: 50px;
    max-height: 50px;
    height: 50px;
    padding: 15px;
    overflow: hidden;
    white-space: nowrap;
}

button {
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: 8px;
    color: var(--text-primary);
    transition-duration: 0.2s;
    border: none;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    cursor: pointer;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 20px auto;
}

.buttons button {
    width: 100%;
    margin: 0;
}

button:hover {
    color: var(--white);
}

button:active {
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

textarea:focus {
    box-shadow: inset 7px 7px 14px var(--shadow-dark), inset -7px -7px 14px var(--shadow-light);
}

hr {
    border: none;
    border-top: 1px solid var(--shadow-dark);
    box-shadow: 0px 1px 0px var(--shadow-light);
    margin-bottom: 20px;
}

.dataverse {
    margin-top: 40px;
    display: flex;
    bottom: 30px;
    margin-left: 50%;
    transform: translate(-50%);
    justify-content: center;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
    font-size: 13px;
    margin-top: 3px;
}

.logo {
    height: 20px;
}

.info {
    opacity: 0.6;
    font-size: 12px;
}

/* Form Layout & Custom Controls */
.form-wrapper {
    text-align: left;
    width: 90%;
    margin: 0 auto;
}

.input-label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Segmented Control (Toggle) */
.segmented-control {
    display: flex;
    background-color: var(--bg-color);
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
    border-radius: 8px;
    padding: 5px;
    margin-top: 15px;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.3s ease;
    user-select: none;
}

input[type="radio"]:checked + .toggle-btn {
    color: var(--text-primary);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

/* Custom Checkbox */
.checkbox-container {
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    background-color: var(--bg-color);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked + .checkbox-label .custom-checkbox {
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

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

.checkbox-subtext {
    opacity: 0.5;
    margin-left: 5px;
    font-size: 12px;
}

footer {
    margin-top: auto;
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.footer-text {
    text-align: right;
    opacity: 0.4;
}

footer a {
    text-decoration: underline;
}



/* Manual Overlay Styles */
.manual-overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 350px;
    max-width: 100vw;
    background-color: var(--bg-color);
    box-shadow: 10px 0 20px var(--shadow-overlay);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    overflow-y: auto;
    box-sizing: border-box;
}

.manual-overlay.open {
    transform: translateX(0);
}

.manual-content {
    padding: 30px 20px;
    text-align: left;
}

.manual-content h2,
.manual-content h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-weight: normal;
}

.manual-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
}

/* Help Button */
.help-btn {
    position: static;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}