/* Override from thief-tool.css */
#formatter-hero .subtitle {
    display: block;
}

/* Layout */
#form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px 16px;
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 0 16px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 14px;
}

.textarea-wrap {
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

textarea {
    resize: none;
    background-color: #192648;
    color: #c9c9c9;
    border: 1px solid silver;
    border-radius: 5px;
    width: min(100%, 900px);
    height: clamp(260px, 55vh, 560px);
    padding: 10px;
    font-size: 0.95rem;
}

.char-count-wrap {
    display: flex;
    justify-content: flex-end;
    width: min(100%, 900px);
    margin: 6px auto 0;
    padding: 0 16px;
    font-size: 0.85rem;
    color: #c9c9c9;
}

#charCount.over-limit {
    color: #ff6b6b;
    font-weight: 600;
}

.button {
    font-size: clamp(0.85rem, 2.2vw, 1rem);
    color: #ffe78f;
    padding: clamp(8px, 1.8vw, 11px) clamp(14px, 3vw, 28px);
    border: 1px solid #ffe78f;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.button:active {
    transform: translateY(0);
}

.button-maroon {
    background-color: maroon;
}
.button-navy {
    background-color: navy;
}
.button-slate {
    background-color: #3a3f4b;
}

.format-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #192648;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffe78f' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-left: 10px;
    padding-right: 36px;
}

.format-select::-ms-expand {
    display: none;
}

.writing-surface {
    background-color: #192648;
    color: #c9c9c9;
    text-align: center;
    width: 140px;
    padding-left: 10px;
    padding-right: 10px;
    flex: 0 0 auto;
}

.writing-surface::placeholder {
    color: #7a869a;
}

/* Queue toggle - styled as a distinct switch, separate from the format buttons */
.toggle-checkbox {
    display: none; /* Hide the default checkbox */
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.85rem, 2.2vw, 1rem);
    color: #ffe78f;
    padding: 8px 20px 8px 10px;
    background-color: rgba(143, 206, 0, 0.08);
    border: 1px solid #ffe78f;
    border-radius: 999px;
    cursor: pointer;
    user-select: none; /* Prevent text selection */
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.toggle-switch {
    position: relative;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 999px;
    background-color: rgba(255, 231, 143, 0.25);
    border: 1px solid rgba(255, 231, 143, 0.6);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.toggle-knob {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffe78f;
    transition: transform 160ms ease, background-color 160ms ease;
}

.toggle-text {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
}

/* Change appearance when checkbox is checked */
.toggle-checkbox:checked + .toggle-label {
    background-color: rgba(76, 175, 80, 0.25);
    box-shadow: 0 0 0 1px rgba(118, 255, 122, 0.4), 0 0 14px rgba(118, 255, 122, 0.35);
}

.toggle-checkbox:checked + .toggle-label .toggle-switch {
    background-color: #4caf50;
    border-color: #8bffa0;
}

.toggle-checkbox:checked + .toggle-label .toggle-knob {
    transform: translateX(18px);
    background-color: #fff;
}

.toggle-checkbox:focus-visible + .toggle-label {
    outline: 2px solid #ffe78f;
    outline-offset: 2px;
}

/* Responsive tweaks */
@media (max-width: 640px) {
    #form {
        gap: 12px;
    }

    .button-group {
        width: 100%;
        gap: 10px;
    }

    .button {
        flex: 1 1 calc(33.333% - 10px);
    }
}

@media (max-width: 420px) {
    #form {
        flex-direction: column;
        align-items: stretch;
    }

    .queue-toggle {
        align-self: center;
    }

    .button {
        flex: 1 1 100%;
    }
}

footer a:link {
    color: #d6b064;
}
footer a:visited {
    color: #9b6c3d;
}
