body {
    margin: 0;
    font-family: sans-serif;
    background: #f9f9ff;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

header {
    padding: 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#logo {
    position: absolute;
    padding: 1em 3em;
    bottom: calc(100% - 35px);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    left: 0;
}

img.logo {
    height: 150px;
    width: auto;
}

img.title {
    height: 22px;
    width: auto;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: baseline;
    position: relative;
    box-sizing: content-box;
    max-height: 100vh;
}

main .background {
    background-image: url("background.png"), linear-gradient(7deg, #7231ff, #c615ee);
    background-position: 50%, 0 0;
    background-size: 110% 110%, auto;
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    overflow: hidden;
}

main .container {
    display: flex;
    justify-content: center;
    align-items: normal;
    position: relative;
    flex-grow: 1;
    max-width: 1400px;
    padding: 4rem 1rem 0 1rem;
    height: 100vh;
    box-sizing: border-box;
}

.content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 13rem);
    max-height: calc(100vh - 13rem);
    height: 100%;
    max-width: 50%;
    padding: 0;
    margin: 0 1.5rem;
    z-index: 2;
}
.content-wrapper.left {
    margin-left: 0;
}
.content-wrapper.right {
    margin-right: 0;
}
.content-wrapper > h2 {
    font-weight: bold;
    color: white;
    margin-left: 1rem;
}
.content-wrapper > div {
    position: relative;
    min-height: inherit;
    max-height: inherit;
    height: 100%;
    width: 100%;
}

.content-box#output {
    z-index: 2;
    opacity: 1;
}
.content-box#schema-output {
    z-index: 1;
    opacity: 0;
}
#view-toggles {
    position: absolute;
    z-index: 3;
    top: calc(-2rem - 7px);
    right: 1rem;
    display: flex;
    flex-direction: row;
    font-size: 90%;
    color: #fff;
}
#view-toggles > div {
    position: relative;
    background: #000;
    border: 7px solid #131313;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    border-bottom: 0;
    padding: .3rem .5rem;
    margin: 0 .3rem;
    height: 2rem;
    box-sizing: border-box;
    cursor: pointer;
}
#view-toggles > div.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
#view-toggles > div:hover {
    background-color: #683cb6;
    z-index: 3;
}
#view-toggles > div:first-child {
    z-index: 2;
    right: -.5rem;
}

/* Show JSON */
.content-wrapper.right[view="json"] .content-box#output {
    z-index: 2;
    opacity: 1;
}
.content-wrapper.right[view="json"] .content-box#schema-output,
.content-wrapper.right[view="json"] .content-box#markdown-output,
.content-wrapper.right[view="json"] .content-box#validation-output {
    z-index: 1;
    opacity: 0;
}

/* Show schema */
.content-wrapper.right[view="schema"] .content-box#schema-output {
    z-index: 2;
    opacity: 1;
}
.content-wrapper.right[view="schema"] .content-box#output,
.content-wrapper.right[view="schema"] .content-box#markdown-output,
.content-wrapper.right[view="schema"] .content-box#validation-output {
    z-index: 1;
    opacity: 0;
}

/* Show markdown */
.content-wrapper.right[view="markdown"] .content-box#markdown-output {
    z-index: 2;
    opacity: 1;
}
.content-wrapper.right[view="markdown"] .content-box#output,
.content-wrapper.right[view="markdown"] .content-box#schema-output,
.content-wrapper.right[view="markdown"] .content-box#validation-output {
    z-index: 1;
    opacity: 0;
}

/* Show validation */
.content-wrapper.right[view="validation"] .content-box#validation-output {
    z-index: 2;
    opacity: 1;
}

.content-wrapper.right[view="validation"] .content-box#output,
.content-wrapper.right[view="validation"] .content-box#schema-output,
.content-wrapper.right[view="validation"] .content-box#markdown-output {
    z-index: 1;
    opacity: 0;
}

.content-box {
    position: absolute;
    border-radius: 15px;
    padding: 2em;
    height: 100%;
    min-height: inherit;
    max-height: inherit;
    background-color: #1a1a1a;
    box-shadow: 0 0 0 7px #ffffff0f;
    background-image: linear-gradient(294deg, #000, #0000004d);
    border-radius: 12px;
    flex-flow: column;
    width: 100%;
    padding: 2em;
    transition: color .4s;
    display: flex;
    box-sizing: border-box;
}

#content-container {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#content-container form > div {
    margin-bottom: 2rem;
}

.convert-form {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.convert-form label {
    white-space: nowrap;
}

.convert-form > .start-button {
    margin-top: auto;
}

#process-id {
    text-align: center;
    color: #333;
    position: absolute;
    left: 0;
    bottom: .5em;
    width: 100%;
    font-size: 80%;
}
#process-id:empty {
    display: none;
}
#process-id:not(:empty):before {
    content: "Job ID: ";
}

#code-block-wrapper {
    position: relative;
    flex-grow: 1;
}

.output-button {
    position: absolute;
    top: 1em;
    right: 2em;
    color: #fff;
    z-index: 3;
    cursor: pointer;
}
.output-button:hover {
    color: #673AB7;
}
.output-button span {
    display: none;
    position: absolute;
    top: 120%;
    left: -150%;
    padding: .3em;
    background: #fff;
    color: #000;
    border-radius: 7px;
}
.output-button.pressed span {
    display: inline-block;
}

#copy, #copy-schema, #copy-markdown {
    top: 1em;
    right: 4em;
}

#download, #download-schema, #download-markdown {
    top: 1em;
    right: 2em;
}

pre.language-json, #markdown-code {
    position: absolute;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    background: black !important; /* Dark theme background */
    color: #f8f8f2;      /* Text color */
    padding: 15px;
    border-radius: 5px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.language-json {
    font-size: 12px !important;
}

#apikey.hidden {
    display: none;
}

#options {
    display: flex;
    margin-top: 1rem;
}

#options .option {
    width: 50%;
}

#options .option:first-child {
    margin-right: .5em;
}
#options .option:last-child {
    margin-left: .5em;
}

label {
    display: block;
    margin-bottom: .5em;
    font-weight: bold;
    color: #ffffffb3;
}

.tooltip {
    color: #464646;
    line-height: 1.25rem;
    margin-top: -1.5rem;
    text-align: center;
}

#options .option input,
#options .option select {
    width: 100%;
}

#apikey, #policy, #quality, #mode {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.75em;
    font-size: 1em;
}

.option {
    position: relative;
}

.popup {
    position: absolute;
    width: 100%;
    top: 0;
}

.popup > .popup-btn {
    width: 1em;
    height: 1em;
    border-radius: 100%;
    background: #fff;
    text-align: center;
    font-weight: bold;
    position: absolute;
    right: 0;
}
.popup > .popup-btn:after {
    content: "?"
}
.popup > .popup-btn:hover {
    color: #673AB7;
}

.popup > .popup-btn:hover + .popup-content {
    display: block;
}

.popup > .popup-content {
    display: none;
    padding: .5em;
    background-color: #1a1a1a;
    background-image: linear-gradient(294deg, #000, #0000004d);
    color: #fff;
    position: absolute;
    bottom: 1em;
    box-shadow: 0 0 0 7px #ffffff0f;
    border-radius: 12px;
}

.popup > .popup-content.active {
    display: block;
}

.popup > .popup-content:after {
    content: "";
    position: absolute;
    bottom: -12px;
    right: 9px;
	border: 6px solid transparent;
	border-top-color: #000;
    border-right-color: #000;
    z-index: 1;
}

.file-drop-area {
    border: 2px dashed #ffffff0f;
    border-radius: 15px;
    padding: 1em 2em;
    text-align: center;
    color: #ffffffb3;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.file-drop-area:hover {
    background: #673AB7;
    color: white;
}

#pdf-file {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

#json-file {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

.checkmark {
    color: green;
    font-size: 1.5em;
    font-weight: bold;
}

.button {
    margin-top: 1em;
    background: #673AB7;
    color: #fff;
    padding: 1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 100%;
    text-decoration: none;
    transition: background 0.2s;
    pointer-events: auto;
    opacity: 1;
    border: 1px solid #673AB7; 
}
.button:hover {
    background: #F3F1FA;
    color: #673AB7;
    border: 1px solid #673AB7; 
}
.button.disabled {
    opacity: 0.5;
    pointer-events: none;
}

#debug {
    display: none;
    position: absolute;
    bottom: .75rem; 
    left: 1rem;
    z-index: 2;
}

#debug button {
    padding: .25rem .5rem;
    margin-right: .25rem;
    color:  #ffffffb3;
    border: 0;
    background: #1a1a1a;
}

footer {
    background: black;
    color: white;
    padding: 1em;
    text-align: center;
    font-size: 0.9em;
    position: absolute; 
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    height: 2.5rem;
}

footer a,
#feedback a {
    color: #673AB7;
    text-decoration: none;
}

footer a:hover,
#feedback a:hover {
    text-decoration: underline;
}

#status-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 3;
}
#status-container:empty {
    display: none;
}

#status-container > p {
    margin: 0;
    color:white;
    background: #000;
    padding: .3rem;
    border-radius: 5px;
}

#status-container.finished {
    height: auto;
    top: unset;
    bottom: 4rem;
}

.preview-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    flex-grow: 1;
    box-sizing: border-box;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.preview-container > img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Excel Preview Styles */
.excel-preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
}

.excel-file-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.excel-file-info h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: #a6e22e;
}

.file-details {
    margin-bottom: 1.5rem;
}

.file-details p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: #fff;
}

.file-details strong {
    color: #fff;
}

.preview-note {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
}

.preview-note p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #fff;
}

.excel-preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #f92672;
    padding: 2rem;
}

.excel-preview-error p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.excel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    font-size: 1.1rem;
    color: #a6e22e;
    text-align: center;
}

.excel-loading p {
    margin-top: 1rem;
    color: #fff;
}

.excel-table-container {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
}

.excel-table th,
.excel-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.excel-table th {
    background: rgba(166, 226, 46, 0.15);
    color: #a6e22e;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.excel-table td {
    color: #fff;
}

.excel-table tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

.excel-table th:last-child,
.excel-table td:last-child {
    border-right: none;
}

.excel-table tbody tr:last-child th,
.excel-table tbody tr:last-child td {
    border-bottom: none;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid #fff;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

.button-container {
    margin-top: 1em;
    display: flex;
    justify-content: center;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.error-message {
    color: red;
    font-weight: bold;
    margin-bottom: 3em;
}


#feedback {
    display: none;
    position: absolute;
    bottom: 2.5rem;
    z-index: 4;
    background-color: #1a1a1a;
    background-image: linear-gradient(294deg, #000, #0000004d);
    border: 7px solid #0d0d0d;
    border-bottom-width: 0;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    min-height: unset;
    height: auto;
    color: #fff;
    box-sizing: border-box;
    padding: 0 .5rem .5rem .5rem;
    width: auto;
    max-width: 27rem;
}
body.processing-done #feedback {
    display: block;
}
#feedback.expanded {
    padding: 1rem;
}
#feedback .feedback-thanks {
    margin-top: 1rem;
    color: #a6e22e;
    text-align: center;
}
#feedback > #feedback-close {
    position: absolute;
    top: -1rem;
    right: -1rem;
    cursor: pointer;
}
#feedback > #feedback-close svg > g > path {
    fill: rgb(231 231 231) !important;
}
#feedback > #feedback-close:hover svg > g > path {
    fill: #fff !important;
}

#feedback > p {
    font-size: 90%;
    margin:  .5rem 0;
    text-align: center;
}
#feedback.expanded > p {
    display: none;
}

#feedback > #feedback-stars {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: fit-content;
    margin: auto;
}
#feedback > #feedback-stars > div {
    mask: url(./star.svg) no-repeat center;
    background-color: #434343;
    width: 1rem;
    height: 1rem;
    padding: .2rem;
    box-sizing: content-box;
    cursor: pointer;
}
#feedback > #feedback-stars:hover > div {
    background-color: #edc45b !important;
}
#feedback > #feedback-stars:hover > div:hover ~ div {
    background-color: #434343 !important;
}
#feedback > #feedback-stars > input[value] ~ div { background-color: #edc45b; }
#feedback > #feedback-stars > input[value="1"] ~ div:nth-of-type(1) ~ div { background-color: #434343; }
#feedback > #feedback-stars > input[value="2"] ~ div:nth-of-type(2) ~ div { background-color: #434343; }
#feedback > #feedback-stars > input[value="3"] ~ div:nth-of-type(3) ~ div { background-color: #434343; }
#feedback > #feedback-stars > input[value="4"] ~ div:nth-of-type(4) ~ div { background-color: #434343; }

#feedback > #feedback-additional {
    display: none;
}
#feedback.expanded > #feedback-additional {
    display: initial;
}
#feedback > #feedback-additional > p {
    font-weight: bold;
    margin: 2rem 0;
    text-align: center;
}
#feedback > #feedback-additional > div {
}
#feedback > #feedback-additional > div > div > p {
    font-weight: bold;
    text-align: center;
}
#feedback > #feedback-additional textarea {
    width: 100%;
    height: 4rem;
    border: 2px solid #000;
    background-color: #1c1c1c;
    color: #fff;
    padding: .3rem;
    box-sizing: border-box;
}
#feedback > #feedback-additional #feedback-submit {
    margin: 2rem auto 1rem;
    text-align: center;
}
#feedback > #feedback-additional #feedback-submit > div {
    color: #a6e22e;
    margin-top: 1rem;
}
#feedback > #feedback-additional #feedback-submit > div:empty {
    display: none;
}
#feedback > #feedback-additional #feedback-submit > div.error {
    color: #f92672;
}
#feedback > #feedback-additional #feedback-submit > button {
    background: #673AB7;
    color: #fff;
    padding: .5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 100%;
    text-decoration: none;
    transition: background 0.2s;
    pointer-events: auto;
    opacity: 1;
    border: 1px solid #673AB7; 
}
#feedback > #feedback-additional #feedback-submit > button:hover {
    background: #F3F1FA;
    color: #673AB7;
    border: 1px solid #673AB7; 
}

div.select-binary {
    margin-bottom: 1rem;
}
div.select-binary > label {
    font-weight: normal;
}
div.select-binary > div.subtitle {
    margin: .5rem 0;
    color: #464646;
    font-size: 90%;
    width: 25em;
    display: block;
}
div.select-binary > div {
    display: flex;
    flex-direction: row;
}
div.select-binary > div > div.select-binary-option {
    padding: .3rem;
    border: 2px solid #000;
    cursor: pointer;
    width: 50%;
    box-sizing: border-box;
    text-align: center;
    background-color: #1c1c1c;
}

div.select-binary > div > div.select-binary-option + div.select-binary-option {
    border-left: none;
}

div.select-binary > div > div.select-binary-option:hover {
    background-color: #673AB7 !important;
}
div.select-binary > input[value="true"] + div > div.select-binary-yes,
div.select-binary > input[value="false"] + div > div.select-binary-no,
div.select-binary > input[value="null"] + div > div.select-binary-dunno { background-color: #673AB7; }
div.select-binary > input[value="true"] + div > div.select-binary-no,
div.select-binary > input[value="true"] + div > div.select-binary-dunno,
div.select-binary > input[value="false"] + div > div.select-binary-yes,
div.select-binary > input[value="false"] + div > div.select-binary-dunno,
div.select-binary > input[value="null"] + div > div.select-binary-yes,
div.select-binary > input[value="null"] + div > div.select-binary-no { background-color: #1c1c1c; }

div.select-binary > input {
}
strong {
    font-weight: bold;
}

#code-block-wrapper span.token.string {
    white-space: pre-wrap !important;
}

.cancel-button {
    background-color: #ff4b4b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.cancel-button:hover {
    background-color: #e04141;
}

.cancel-button:disabled {
    background-color: #999;
    cursor: not-allowed;
}