:root {
    --st-font-family: 'Arial', sans-serif;
    --st-font-family-system: -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
        'Noto Color Emoji';
    --st-btn-ctrl-height: 1.5rem;
}

* {
    box-sizing: border-box;
}

html {
    background-image: url(https://images.unsplash.com/photo-1534950090086-c6c8e3fafb36?q=80&w=5370&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100%;
}

body {
    font-family: var(--st-font-family);
    margin: 0;
    padding: 20px;
}

@media screen and (min-width: 992px) {
    body {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: start;
        gap: 20px;
    }
}

.form {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
}

label {
    display: block;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    .optional {
        text-transform: lowercase;
        font-weight: 400;
        display: inline-block;
        margin-left: 0.5rem;
        font-style: italic;
        color: rgba(0, 0, 0, 0.5);
    }
}

input,
textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.3125rem;
    background: #FFF;
    border: none;
    box-shadow: 0px 0.5px 2.5px 0px rgba(0, 0, 0, 0.30), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.05);
    font-family: var(--st-font-family-system);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5rem;
    &:focus {
        box-shadow: 0px 0.5px 2.5px 0px rgba(0, 0, 0, 0.30), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.05), 0px 0px 0px 3px rgba(0, 122, 255, 0.50);
    }
}

.input-description {
    font-size: 0.6875rem;
    font-style: italic;
    font-weight: 400;
    line-height: 0.875rem;
    color: rgba(0, 0, 0, 0.5);
}

.traffic-lights {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
    span {
        display: inline-block;
        width: 0.75rem;
        height: 0.75rem;
        border-radius: 50%;
        border: 0.5px solid rgba(0, 0, 0, 0.2);
        &.red {
            background-color: #ff5f57;
        }
        &.yellow {
            background-color: #febc2e;
        }
        &.green {
            background: #28c840;
        }
    }
}

#previewsContainer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    @media screen and (min-width: 1200px) {
        flex-direction: row;
        align-items: start;
        flex-wrap: wrap;
    }
}

.st-preview-wrapper,
.generator-wrapper {
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    background: #f6f6f6;
    backdrop-filter: blur(40px);
    margin: 20px auto;
    /* border: 1px solid #ddd; */
    border-radius: 0.625rem;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15),
        0px 25px 30px 0px rgba(0, 0, 0, 0.35);
    @media screen and (min-width: 992px) {
        margin: 0;
    }
}

.generator-wrapper {
    margin: auto;
    min-width: 300px;
    max-width: 420px;
    @media screen and (min-width: 992px) {
        margin: 0;
        position: sticky;
        top: 20px;
    }
}

.st-preview-wrapper {
    @media screen and (min-width: 992px) {
        min-width: 400px;
        flex: 1 1;
    }
}

.st-preview-header {
    display: block;
    padding: 0.56rem 1.25rem;
    background: #fff;
    box-shadow: 0px -0.5px 0px 0px rgba(0, 0, 0, 0.05) inset,
        0px 0.5px 0px 0px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
    font-family: var(--st-font-family-system);
    h1, h2 {
        color: rgba(0, 0, 0, 0.85);
        font-size: 0.9375rem;
        font-style: normal;
        font-weight: 590;
        line-height: 1.25rem;
        margin: 0;
    }
    h3 {
        color: rgba(0, 0, 0, 0.5);
        font-size: 0.6875rem;
        font-style: normal;
        font-weight: 400;
        line-height: 0.875rem;
        margin: 0;
    }
}

.controls {
    display: flex;
    align-items: center;
    &:last-child {
        margin-right: -0.5rem;
    }
    button.header-button {
        text-align: center;
        font-size: 1.0625rem;
        font-style: normal;
        font-weight: 400;
        width: 2.25rem;
        height: var(--st-btn-ctrl-height);
        cursor: pointer;
        border-radius: 0.25rem;
        border: none;
        appearance: none;
        position: relative;
        background-color: transparent;
        padding: 0.125rem 0.5rem;
        svg {
            width: 1.25rem;
            height: 1.25rem;
        }
        &:hover {
            background-color: rgba(0, 0, 0, 0.1);
        }
        & + button.header-button {
            margin-right: 0.0625rem;
            &:after {
                content: '';
                display: block;
                position: absolute;
                top: 0.25rem;
                left: -0.0625rem;
                width: 0.0625rem;
                height: 0.875rem;
                border-radius: 0.03125rem;
                background: #e5e5e5;
                mix-blend-mode: plus-darker;
            }
        }
        &.copy-html {
            @media screen and (max-width: 991px) {
                display: none;
            }
        }
    }
}

.st-preview-body {
    #previewsContainer & {
        font-family: initial;
    }
    padding: 50px 1.25rem 1.25rem;
}

.custom-dialog {
    width: 16.25rem;
    padding: 1.25rem 1rem 1rem 1rem;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin: auto;
    border: none;
    border-radius: 0.625rem;
    background: rgba(246, 246, 246, 0.6);
    box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.6),
        0px 0px 2px 0px rgba(0, 0, 0, 0.05),
        0px 38px 90px 0px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(40px);
    font-family: var(--st-font-family-system);
    overflow: hidden;
    &:-internal-dialog-in-top-layer::backdrop {
        background: linear-gradient(
                0deg,
                rgba(0, 0, 0, 0.2) 0%,
                rgba(0, 0, 0, 0.2) 100%
            ),
            rgba(255, 255, 255, 0.5);
    }
    &[open] {
        display: flex;
    }
    .app-icon {
        width: 4rem;
        height: 4rem;
        img {
            width: 100%;
        }
    }
    button {
        display: flex;
        width: 14.25rem;
        padding: 0.375rem 0.4375rem;
        justify-content: center;
        align-items: flex-start;
        gap: 0.625rem;
        margin: 0;
        border: none;
        appearance: none;
        border-radius: 0.3125rem;
        background: linear-gradient(
                180deg,
                rgba(255, 255, 255, 0.17) 0%,
                rgba(255, 255, 255, 0) 100%
            ),
            #007aff;
        font-size: 0.8125rem;
        font-style: normal;
        font-weight: 400;
        line-height: 1rem;
        color: white;
        cursor: pointer;
    }
}

.title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    align-self: stretch;
    text-align: center;
    h1 {
        font-size: 0.8125rem;
        font-style: normal;
        font-weight: 700;
        line-height: 1rem;
        margin: 0;
    }
    p {
        font-size: 0.6875rem;
        font-style: normal;
        font-weight: 400;
        line-height: 0.875rem;
        margin: 0;
    }
}

.dialog-content p {
    font-size: 16px;
    color: #333;
}

.dialog-content button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.dialog-content button:hover {
    background-color: #0056b3;
}

*:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(0, 122, 255, 0.50);
    border-color: rgb(0, 122, 255);
}


body.blur-active .generator-wrapper,
body.blur-active #previewsContainer {
    filter: blur(4px);
    pointer-events: none; /* Prevent interaction while blurred */
}


.dock {
    &:not(.show) {
        display: none;
    }
    &.show {
        display: flex;
    }
    position: fixed;
    bottom: calc(0.3rem + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(26, 26, 26, 0.46);
    background: rgba(246, 246, 246, 0.36);
    mix-blend-mode: luminosity;
    box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(68px);
    z-index: 1000;
}

.macos-dock-button {
    appearance: none;
    background: transparent;
    border: none;
    display: flex;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0.1875rem;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0.625rem;
    &:hover {
        background: rgba(0, 0, 0, 0.1);
    }
    img {
        width: 3.125rem;
        height: 3.125rem;
    }
}

.toggle-button {
    background-color: #38b6ab;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
}

.toggle-button:hover {
    background-color: #2d928e;
}

#customDisclaimer {
    margin-top: 8px;
    width: 100%;
    resize: vertical;
}

.sr-only {
    display: none;
}

.dropdown-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(var(--st-btn-ctrl-height) + 0.5rem);
    right: 0;
    z-index: 1000;
    min-width: 150px;
    display: inline-flex;
    padding: 0.3125rem;
    flex-direction: column;
    align-items: flex-start;
    border-radius: 0.375rem;
    background: #F6F6F699, rgba(246, 246, 246, 0.60);
    box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.40), 0px 0px 1.5px 0px rgba(0, 0, 0, 0.30), 0px 7px 22px 0px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(40px);
}

.menu-button {
    background: none;
    appearance: none;
    border: none;
    color: #333;
    text-align: left;
    padding: 0.25rem 0.625rem;
    border-radius: 0.3125rem;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    color: rgba(0, 0, 0, 0.85);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--st-font-family-system);
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 510;
    line-height: 1rem;
}

.dropdown-menu button:hover {
    background: linear-gradient(0deg, rgba(10, 130, 255, 0.75) 0%, rgba(10, 130, 255, 0.75) 100%), #0A82FF;
    background-blend-mode: normal, soft-light;
    color: white;
}