celestin-setup {
    overflow:hidden;
    height: 100%;
}

#setup-component {
    display: flex;
    flex-direction: row;
    height: 100%;
    container-type: inline-size;
    container-name: setup;
    
    .sideNav {
        display: flex;
        flex-direction: row;
        gap: 0.25em;
        flex-shrink: 0;
        transition: transform 0.3s ease-in-out;
    }

    celestin-game-manager {
        padding-inline: 0.25em;
        margin-right: 0.25em;
        min-width: 3.125rem;
        max-width: 20em;
    }

    #setupForm {
        margin-left: 0.5em;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100%;
    }
    
    .button-group {
        display: flex;
        justify-content: center;
        gap: 1em;
        margin-top: 1em;
        button {
            padding: 0.5em;
            flex: 1;
        }
    }
    .promptPreview {
        height:10em;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        div {
            white-space: pre-wrap;
            padding: 1em;
            overflow-y: auto;
            color: var(--pico-muted-color);
            flex-grow: 1;
        }
        small {
            margin-left: 1em;
            color: var(--pico-muted-color)
        }
    }

    .form-content {
        overflow-y: auto;
        padding-right: 1em;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;

    }

    input:not([type="checkbox"]) {
        padding: 0.5em;
        height: 2.5em;
    }

    .help-text {
        color: var(--pico-muted-color);
        margin-bottom: 1em;
    }

    .tabs {
        display: flex;
        margin-bottom: 1em;
        border-bottom: 1px solid var(--pico-secondary-border);
        overflow-x: auto;
        flex-shrink: 0;
    }
    .tabs button {
        flex: 1;
        padding: 0.5em;
        background: none;
        border: 0;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        box-shadow: none;
        /* Square corners avoid Safari subpixel hairline on the curved edge */
        border-radius: 0;
    }
    .tabs button.active {
        border-bottom-color: var(--pico-primary);
    }
    .tab-content {
        display: none;
        flex-direction: column;
        height: 100%;
    }
    .tab-content.active {
        display: flex;
        height: 100%;
    }

    .setup-fields {
        margin-bottom: 0;
    }

    label[for="enableSuggestedActions"] + small {
        color: var(--pico-muted-color);
    }

    label[for="scenario"] {
        flex-grow: 1;
        display: flex;
        flex-direction: column;

        enhanced-textarea {
            margin-top: 0.25em;
        }

        small {
            color: var(--pico-muted-color);
        }
    }

    #scenario {
        flex-grow: 1;
        resize: none;
    }

    @container setup (max-width: 768px) {
        #setupForm {
            padding-left: 2em;
        }
        .sideNav {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            background: var(--pico-background-color);
            z-index: 10;
            transform: translateX(-100%);
        }

        .sideNav::after {
            content: '>'; /* Right-pointing triangle */
            position: absolute;
            right: -1.5em;
            top: 1em;
            background: var(--pico-background-color);
            padding: 0.5em;
            border: 1px solid var(--pico-secondary-border);
            border-left: none;
            border-radius: 0 0.25em 0.25em 0;
            cursor: pointer;
        }

        .sideNav:hover,
        .sideNav:focus-within {
            transform: translateX(0);
        }

        .sideNav:hover::after,
        .sideNav:focus-within::after {
            content: '<'; /* Left-pointing triangle */
        }
    }
}