﻿/* Styling for the live demos on the documentation pages.
   Not part of any component; safe to change without affecting anything else. */

.example-result.example-form-field
{
    display: flex;
    flex-direction: column;
    align-items: baseline;
}

.itemid-demo
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.demo-swatch
{
    min-width: 5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--cui-border-radius);
    text-align: center;
    font-weight: 600;
}

    .demo-swatch.metal
    {
        background: #3a3f42;
    }

    .demo-swatch.warm
    {
        border: 1px solid var(--cui-border-color);
    }

.attributes-demo-box
{
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: var(--cui-border-radius);
}

.component-demo-columns
{
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;

    > div
    {
        flex: 1 1 0;
        min-width: 0;
    }

    .feedback
    {
        overflow-wrap: break-word;
    }
}

/* Styling for the Benchmark live demo.
   Not part of any component; safe to change without affecting anything else. */

.benchmark-result
{
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benchmark-controls
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.benchmark-readouts
{
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
}

    .benchmark-readouts .benchmark-readout-label
    {
        opacity: 0.6;
        margin-bottom: 0.15rem;
    }

    .benchmark-readouts .benchmark-readout-value
    {
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
        font-size: 1.1rem;
    }

    .benchmark-readouts .benchmark-readout-note
    {
        font-size: 0.8rem;
        opacity: 0.6;
        margin-top: 0.15rem;
    }

.benchmark-group
{
    border: 1px solid var(--cui-border-color);
    border-radius: var(--cui-border-radius);
    overflow: hidden;
}

    .benchmark-group + .benchmark-group
    {
        margin-top: 1rem;
    }

.benchmark-group-header
{
    background: var(--cui-column-bg-color);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--cui-border-color);
}

.benchmark-table
{
    display: grid;
    grid-template-columns: 56px 1fr 90px 90px 1fr;
    font-size: 0.85rem;
}

.benchmark-table-head
{
    display: contents;
}

    .benchmark-table-head > div
    {
        font-weight: 600;
        opacity: 0.6;
        padding: 0.4rem 0.75rem;
        border-bottom: 1px solid var(--cui-border-color);
    }

.benchmark-row
{
    display: contents;
}

    .benchmark-row > div
    {
        padding: 0.4rem 0.75rem;
        border-bottom: 1px solid var(--cui-border-color);
    }

.benchmark-num
{
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.benchmark-status
{
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: var(--cui-border-radius);
    font-size: 0.75rem;
    border: 1px solid var(--cui-border-color);
}

.demo-settings
{
    display: flex;
    flex-direction: column;
    font-size: 13px !important;

    > small
    {
        word-break: break-word;
        font-size: 12px;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    > div
    {
        border-bottom-style: solid;
        margin-bottom: 1rem;

        > div.form-field
        {
            min-width: min(240px, 100%);
            margin-bottom: 1rem !important;
        }
    }
}

aside > nav > .demo-settings
{
    div.form-field
    {
        min-width: 120px;
    }
}


.dialog.event-log > .dialog-box
{
    height: clamp(300px, 60vh, 480px) !important;
    margin-right: 2rem;
    margin-top: 48px;

    .content-holder
    {
        font-size: 13px;
        max-height: none !important;
        scrollbar-width: thin;
        scrollbar-color: var(--cui-app-skin-menu-text-color) transparent;

        a
        {
            margin-left: 0.5rem;
        }
    }
}

.view-container.demo
{
    .app-skin-container
    {
        width: clamp(300px, 50vw, 100%);
        height: 500px;
    }

    .button.theme.event-log
    {
        margin-bottom: 1rem;
    }

    .bookmark-content
    {
        height: 220px;
        overflow-y: auto;
        border-style: solid;
        padding: 10px;

        h3, h5
        {
            margin: 0px !important;
            padding: 0px !important;
        }

        &.horizontal
        {
            display: flex;
            overflow-x: auto;
            overflow-y: hidden;
            height: auto;

            section
            {
                flex: 0 0 auto;
                width: 300px;
            }
        }
    }

    .bookmark-navigation
    {
        min-width: 150px;

        a
        {
            &.selected
            {
                font-weight: bold;
            }
        }

        nav
        {
            margin-left: 1rem;
        }
    }


    .carousel
    {
        .item > .carousel-panel
        {
            box-sizing: border-box;
            height: 100%;
            padding: 2rem;
        }

        .item:first-child > .carousel-panel
        {
            background-color: rgba(0,0,0,0.2);
        }

        .item:last-child > .carousel-panel
        {
            background-color: rgba(0,0,0,0.4);
        }
    }

    .grid.theme
    {
        font-size: 15px;

        table.filter
        {
            input.textbox
            {
                width: 100px;
            }
        }

        td.expand
        {
            .expand-icon::before
            {
                content: var(--cui-ico-pencil);
                font-family: 'UI';
                font-size: 12px;
                position: absolute;
                left: 5px;
                top: 50%;
                transform: translateY(-50%);
            }

            .expand-icon::after
            {
                margin-left: -7px;
            }
        }

        tr.expanded + tr > td
        {
            padding: 1rem;
        }

        .form.theme:not(.build-mode):not(.preview-mode)
        {
            margin: 0px;
        }
    }

    cui-form.theme
    {
        font-size: 15px;
    }

    .combo-box.demo.theme
    {
        font-size: 15px;

        .box
        {
            min-width: min(100vw, 600px) !important;
        }

        li.checkbox
        {
            display: none !important;
        }

        &.multi li.checkbox
        {
            display: inline-block !important;
        }

        li.col-gender
        {
            flex: 0.6 1 0%;
        }
    }

    .combo-box.demo.tags.theme
    {
        /* hide expand icon for tags combo-box */
        .button.theme.expand .content-holder > span.expand-icon
        {
            display: none;
        }
    }

    .tab-container
    {
        display: flex;
        flex-direction: column;

        > .tab-content
        {
            padding: 1rem;
        }

        &.bottom
        {
            > .tab-strip
            {
                order: 1;
            }
        }
    }

    .validator
    {
        &.feedback, &.summary
        {
            font-size: 13px;
        }
    }

    .validation-summary
    {
        margin-top: 1rem;
    }
}

/* form build demo */
.app-skin
{
    &:not(.side-menu)
    {
        .view-container.form-build
        {
            padding-left: 0;

            .app-content.form-build-example
            {
                max-width: calc(90vw) !important;
                width: calc(90vw) !important;
            }
        }
    }

    &.side-menu
    {
        .view-container.form-build
        {
            .app-content.form-build-example
            {
                max-width: calc(90vw - (330px + 2rem)) !important;
                width: calc(90vw - (330px + 2rem)) !important;
            }
        }
    }
}

.view-container.demo.form-build
{
    .demo-narrow-only
    {
        display: none;
    }
}

@media (max-width: 1365px)
{
    .form-build-example, .demo-wide-only
    {
        display: none;
    }

    .demo-narrow-only
    {
        display: block !important;
    }
}


.inline-editor
{
    position: relative;
    height: 100px;
    margin-bottom: 40px;
    overflow: auto;
    border-radius: 0px;
    padding: 10px;
    -moz-user-select: initial;
    -webkit-user-select: initial;
    -ms-user-select: initial;
    user-select: initial;

    &:focus,
    &:focus-within
    {
        outline: none;
        box-shadow: 0px 0px 5px 0px rgb(0, 0, 0, 0.2), inset 0 0 5px rgba(1, 152, 177, 0.3);
    }

    &:empty:before
    {
        content: attr(placeholder);
        pointer-events: none;
        display: block; /* For Firefox */
    }
}

/* editor pdf export */
.editor-pdf-export
{
    /* Keep the colors of the light theme when exporting to pdf */
    --cui-color-on-surface: rgba(39, 53, 55);
    --cui-color-primary-text: rgb(16,163,189);
    color: var(--cui-color-on-surface);
    font-family: Arial, Helvetica, sans-serif;
    overflow-wrap: anywhere;

    ul,
    ol
    {
        margin: 0 0 1em;
        padding-left: 1.5em;
    }

    ul
    {
        list-style-type: disc;
    }

    ol
    {
        list-style-type: decimal;
    }

    li
    {
        display: list-item;
        list-style-type: inherit;
    }
}
