.theme-light {
    --color1: rgb(23, 23, 23);
    --color2: rgb(245, 245, 245);
    --color3: rgb(151, 151, 151);
}

.theme-dark {
    --color1: rgb(245, 245, 245);
    --color2: rgb(23, 23, 23);
    --color3: rgb(151, 151, 151);
}

:root {
    font-size: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font: inherit;
    vertical-align: baseline;
    font-family: 'Work Sans', 'Vazirmatn', sans-serif;
    font-weight: 400;
    line-height: 1.5rem;
    color: var(--color1);
}

img {
    width: 100%;
    height: auto;
}

input, textarea {
    width: 100%;
    resize: none;
    padding: 0.5rem;
    border: 1px solid var(--color1);
    border-radius: 4px;
    background-color: var(--color2);
    transition: background-color 150ms;
}

input[type=”range”] {
    padding: 0;
}

.label-margin {
    margin-bottom: 0.5rem;
}

button {
    min-width: 6rem;
    padding: 0.5rem;
    background-color: var(--color2);
    color: var(--color1);
    border: 1px solid var(--color1);
    border-radius: 4px;
    box-shadow: none;
    cursor: pointer;
    overflow-wrap: normal;
    transition: background-color 150ms, color 150ms;
}

button:hover, button:disabled {
    background-color: var(--color1);
    color: var(--color2);
}

button:disabled {
    color: var(--color3);
    cursor: default;
}

.mobile-hide {
    color: inherit;
}

.copy-button {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
}

header {
    width: 100%;
    padding: 1rem 1rem 0;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 2rem;
    font-style: italic;
    text-align: center;
    margin-bottom: 0.5rem;
}

h2 {
    font-style: italic;
    text-align: center;
    margin-bottom: 0.5rem;
}

body, html {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 100vh;
    background-color: var(--color2);
    transition: background-color 150ms;
}

main {
    display: flex;
    width: 100%;
    height: calc(100% - 5rem);
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
}

.main-controls {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    max-width: 50rem;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--color1);
    border-radius: 4px;
    overflow: auto;
}

.main-controls__row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.main-controls__linebreak {
    position: relative;
    width: 100%;
}

.main-controls__linebreak::after {
    content: '';
    position: absolute;
    top: -50%;
    left: 0;
    height: 1px;
    width: 100%;
    opacity: 0.6;
    background: var(--color1);
}

.main-controls__col {
    width: 100%;
}

.main-controls__control {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0rem;
    width: 100%;
}

.main-output {
    width: 100%;
    max-width: 50rem;
    height: 100%;
    min-height: 20rem;
    padding: 1.5rem;
    word-break: break-word;
    border: 1px solid var(--color1);
    border-radius: 4px;
    overflow: auto;
}

/* EXPORT STYLES */

.notbr-text {
    white-space: pre-wrap;
    font-size: var(--fixation-size);
    letter-spacing: var(--fixation-spacing);
}

.notbr-text p {
    font-weight: var(--fixation-weight2);
    line-height: var(--fixation-height);
}

.notbr-fixation {
    font-weight: var(--fixation-weight1);
    opacity: var(--fixation-opac);
}

/*  */

.code-output {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.5rem;
    width: 100%;
    max-width: 50rem;
    height: 100%;
    min-height: 20rem;
    padding: 1.5rem;
    word-break: break-word;
    border: 1px solid var(--color1);
    border-radius: 4px;
    overflow: auto;
}

.md-output {
    width: 100%;
    max-width: 50rem;
    height: 100%;
    min-height: 20rem;
    padding: 2rem;
    word-break: break-word;
    border: 1px solid var(--color1);
    border-radius: 4px;
    overflow: auto;
}

.code-output>div, .md-output>div {
    position: relative;
    height: 100%;
    width: 100%;
}

#css-output, #html-output, #md-output {
    font-family: monospace;
    padding: 1rem;
    padding-top: 2.5rem;
    border: 1px solid var(--color1);
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1rem;
    width: 100%;
}

#css-output {
    height: 8rem;
    overflow: auto;
}

#html-output {
    height: 100%;
    overflow: auto;
}

#md-output {
    height: 100%;
    overflow: auto;
}

.fixed-controls {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    position: fixed;
    bottom: 0;
    right: 0;
    width: fit-content;
    height: fit-content;
    padding: 1rem;
    min-height: 5rem;
}

.fixed-controls.top {
    top: 0;
}

.toggle-display {}

.toggle-theme {
    position: relative;
    width: 4rem;
    height: 2.5rem;
    border-radius: 12px;
    overflow: hidden;
}

.toggle-theme::after, .toggle-theme::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: calc(50% - 8px);
    height: calc(100% - 10px);
    background-color: var(--color2);
    border: 1px solid var(--color1);
    border-radius: 8px;
    transition: transform 150ms ease-in-out, background-color 100ms;
}

.toggle-theme::before {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 1px;
    background-color: transparent;
    border: none;
    content: '🌞';
}

.toggle-theme:hover::after, .toggle-theme:hover::before {
    background-color: var(--color1);
    border-color: var(--color2);
}

.toggle-theme:hover::before {
    background-color: transparent;
}

.toggle-theme.light::after {
    transform: translateX(0%);
}

.toggle-theme.light::before {
    content: '🌞';
    padding-left: 2px;
    transform: translateX(100%);
}

.toggle-theme.dark::after {
    transform: translateX(100%);
}

.toggle-theme.dark::before {
    content: '🌙';
    padding-right: 2px;
    transform: translateX(0%);
}

footer {
    padding: 0 1rem 2rem;
}

@media (max-width: 600px) {
    html, body {
        height: fit-content;
    }

    header {
        padding: 1rem 5rem 0 1rem;
    }

    h1 {
        text-align: left;
    }

    h2 {
        text-align: left;
    }

    main {
        display: block;
        height: 100%;
    }

    button {
        min-width: 3rem;
    }

    .mobile-hide {
        display: none;
    }

    .main-controls, .main-output, .code-output {
        margin-bottom: 1rem;
    }

    footer {
        padding: 0 1rem 6rem;
    }
}