
/* smart-text-box */

smart-text-box,
smart-input {
    display: inline-block;
    border: none;
    width: var(--smart-text-box-default-width);
    height: var(--smart-text-box-default-height);
    overflow: visible;
    background: var(--smart-background);
}

    smart-text-box.smart-element,
    smart-input.smart-element {
        background: var(--smart-background);
    }

smart-input {
    border: 1px solid var(--smart-border);
}

    smart-text-box .smart-container,
    smart-input .smart-container,
    .smart-text-box.smart-container,
    .smart-input.smart-container {
        width: 100%;
        height: 100%;
        color: inherit;
        font-family: inherit;
        position: relative;
        overflow: visible;
    }

    input.smart-input::selection,
    smart-text-box input::selection,
    smart-input input::selection {
        background: var(--smart-editor-selection);
        color: var(--smart-editor-selection-color);
    }


input.smart-input {
    border-width: var(--smart-border-width);
    font-family: var(--smart-font-family);
    font-size: var(--smart-font-size);
    background: var(--smart-background);
    border-style: solid;
    border-color: var(--smart-border);
    color: var(--smart-background-color);
    border-top-left-radius: var(--smart-border-top-left-radius);
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-bottom-left-radius: var(--smart-border-bottom-left-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);
    padding: var(--smart-editor-label-padding);
    outline: none;
    text-align: var(--smart-text-box-text-align);
}

.smart-input-drop-down-menu {
    display: block;
    transition: opacity 0.2s, transform 0.2s ease-out;
    transform: scaleY(0);
    transform-origin: top left;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: var(--smart-editor-drop-down-z-index);
    float: left;
    padding: 2px;
    margin: var(--smart-list-item-vertical-offset) var(--smart-list-item-horizontal-offset);
    color: var(--smart-background-color);
    background-color: var(--smart-background);
    border: 1px solid var(--smart-border);
    border-top-left-radius: var(--smart-border-top-left-radius);
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-bottom-left-radius: var(--smart-border-bottom-left-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);
    box-shadow: var(--smart-elevation-8);
    font-size: var(--smart-font-size);
    font-family: var(--smart-font-family);
    overflow: hidden;
    width: auto;
    height: auto;
    --smart-input-drop-down-menu-width: auto;
    --smart-input-drop-down-menu-height: 200px;
    max-height: var( --smart-input-drop-down-menu-height);
    /*min-width: 150px;*/
    min-height: 0;
}

    .smart-input-drop-down-menu.smart-container {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .smart-input-drop-down-menu .smart-scroll-viewer-content-container,
    .smart-input-drop-down-menu .smart-scroll-viewer-container,
    .smart-input-drop-down-menu > .smart-container {
        /*min-width: 150px;*/
        width: var(--smart-input-drop-down-menu-width);
        max-height: var( --smart-input-drop-down-menu-height);
    }

    .smart-input-drop-down-menu .smart-scroll-viewer-content-container {
        padding: 0px;
        max-height: initial;
    }


    .smart-input-drop-down-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
        height: auto;
    }

        .smart-input-drop-down-menu ul.scroll {
            width: calc(100% - var(--smart-scroll-bar-size) - 2px);
        }

    .smart-input-drop-down-menu li {
        padding-bottom: 1px;
    }

        .smart-input-drop-down-menu li a {
            display: block;
            padding: 8px 12px;
            border-top-left-radius: var(--smart-item-border-top-left-radius);
            border-top-right-radius: var(--smart-item-border-top-right-radius);
            border-bottom-left-radius: var(--smart-item-border-bottom-left-radius);
            border-bottom-right-radius: var(--smart-item-border-bottom-right-radius);
            clear: both;
            font-weight: normal;
            white-space: nowrap;
            color: var(--smart-background-color);
            text-decoration: none;
        }

            .smart-input-drop-down-menu li a:hover {
                color: var(--smart-ui-state-color-hover);
                background: var(--smart-ui-state-hover);
            }

        .smart-input-drop-down-menu li.active a {
            color: var(--smart-ui-state-color-focus);
            background: var(--smart-ui-state-focus);
            text-decoration: none;
            outline: 0;
        }

        .smart-input-drop-down-menu li a.icon {
            position: relative;
            padding-left: var(--smart-column-icon-size);
        }

            .smart-input-drop-down-menu li a.icon:after {
                content: '';
                position: absolute;
                left: 0;
                top: 0;
                width: var(--smart-column-icon-size);
                height: 100%;
                background-repeat: no-repeat;
                background-position: center;
            }

    .smart-input-drop-down-menu[open] {
        transform: scale(1);
        opacity: 1;
    }

.smart-input .smart-input {
    border: none;
    padding: var(--smart-editor-label-padding);
    height: 100%;
    width: 100%;
}

smart-input > .smart-container,
.smart-input.smart-container {
    display: flex;
}

smart-input[drop-down-button-position="left"] .smart-input,
smart-input[drop-down-button-position="right"] .smart-input,
.smart-input[drop-down-button-position="left"] .smart-input,
.smart-input[drop-down-button-position="right"] .smart-input {
    width: calc(100% - var(--smart-editor-addon-width));
}

.smart-input[readonly] input.smart-input {
    background: var(--smart-surface);
    color: var(--smart-surface-color);
    padding: 0;
    cursor: pointer;
    padding-left: var(--smart-editor-label-padding);
    outline: none;
}

.smart-input .smart-drop-down-button {
    display: none;
    width: var(--smart-editor-addon-width);
    height: 100%;
    flex-direction: column;
    color: var(--smart-surface-color);
    border-left: 1px solid var(--smart-border);
    background: var(--smart-surface);
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);
}

.smart-input[drop-down-button-position="left"] .smart-drop-down-button,
.smart-input[drop-down-button-position="right"] .smart-drop-down-button {
    display: flex;
}

.smart-input[drop-down-button-position="right"] .smart-input {
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
}

.smart-input[drop-down-button-position="left"] .smart-drop-down-button {
    order: -1;
    border-right: 1px solid var(--smart-border);
    border-left: none;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border-top-left-radius: var(--smart-border-top-left-radius);
    border-bottom-left-radius: var(--smart-border-bottom-left-radius);
}

.smart-input[drop-down-button-position="left"] .smart-input {
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}

.smart-input[focus] .smart-drop-down-button {
    border-color: var(--smart-outline);
}

.smart-input[readonly] .smart-drop-down-button {
    border-left: none;
}

.smart-input[drop-down-button-position="left"][readonly] .smart-drop-down-button {
    border-right: none;
}

.smart-input .smart-drop-down-button .arrow {
    display: flex;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    font-family: var(--smart-font-family-icon);
    justify-content: center;
    align-items: center;
    font-size: var(--smart-arrow-size);
    outline: none;
}


    .smart-input .smart-drop-down-button .arrow:after {
        content: var(--smart-icon-arrow-down);
    }

    .smart-input .smart-drop-down-button .arrow:after {
        transition: opacity 0.2s, transform 0.2s ease-out;
    }



.smart-input .smart-drop-down-button[open] .arrow:after {
    transform: rotate(-180deg);
}

.smart-input[readonly]:hover .smart-input,
.smart-input[readonly]:hover .smart-drop-down-button,
.smart-input .smart-drop-down-button:hover {
    background: var(--smart-ui-state-hover);
    color: var(--smart-ui-state-color-hover);
}

.smart-input[readonly][open] .smart-input,
.smart-input[readonly][open] .smart-drop-down-button,
.smart-input[readonly]:active .smart-input,
.smart-input[readonly]:active .smart-drop-down-button,
.smart-input .smart-drop-down-button[open],
.smart-input .smart-drop-down-button:active {
    background: var(--smart-ui-state-active);
    color: var(--smart-ui-state-color-active);
}

    .smart-input[readonly][open] .smart-input::-webkit-input-placeholder,
    .smart-input[readonly]:active .smart-input::-webkit-input-placeholder {
        color: var(--smart-ui-state-color-active);
    }

    .smart-input[readonly][open] .smart-input::-moz-placeholder,
    .smart-input[readonly]:active .smart-input::-moz-placeholder {
        color: var(--smart-ui-state-color-active);
    }

.smart-text-box input,
.smart-text-box .smart-content > div {
    width: 100%;
    height: 100%;
    outline: none;
    border-width: var(--smart-border-width);
    border-style: solid;
    border-color: var(--smart-border);
    border-top-left-radius: var(--smart-border-top-left-radius);
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-bottom-left-radius: var(--smart-border-bottom-left-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);
    padding: var(--smart-editor-label-padding);
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    background-color: transparent;
    font-weight: inherit;
    font-style: inherit;
    overflow: hidden;
}

    .smart-text-box .smart-content > div:first-of-type {
        position: absolute;
        display: flex;
        width: initial;
        height: initial;
        user-select: none;
        pointer-events: none;
        min-height: initial;
        max-height: initial;
        align-items: center;
        padding-top: 1px;
        padding-bottom: 1px;
        opacity: 0.5;
        text-overflow: ellipsis;
        white-space: nowrap;
        border: var(--smart-border-width);
        border-style: solid;
        border-color: transparent;
    }

    .smart-text-box .smart-content > div > label {
        color: transparent;
    }

.smart-text-box[disabled] input,
.smart-text-box[readonly] input {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
}

input.smart-input:hover,
smart-input:hover,
smart-text-box input:hover,
smart-text-box[hover] input,
smart-text-box:focus input.hovered,
.smart-text-box:focus.hovered input {
    border-color: var(--smart-ui-state-border-hover);
}

input.smart-input:disabled,
smart-input[disabled],
smart-text-box[disabled] {
    border-color: var(--smart-disabled);
    outline: none;
}

smart-input:focus,
smart-input[focus],
input.smart-input:focus,
smart-text-box input:focus {
    border-color: var(--smart-outline);
}

.smart-text-box .smart-label,
.smart-text-box .smart-hint {
    display: none;
    position: absolute;
}

.smart-text-box[label] .smart-label,
.smart-text-box[hint] .smart-hint {
    position: absolute;
    left: 0;
    bottom: 100%;
    font-size: 12px;
    width: 100%;
    display: block;
    padding: var(--smart-editor-label-padding);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    text-align: initial;
    line-height: initial;
    vertical-align: initial;
}

.smart-text-box[hint] .smart-hint {
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.6, 1);
}

.smart-text-box[hint][focus] .smart-hint {
    opacity: 1;
    transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.smart-text-box[hint] .smart-hint {
    top: 100%;
    bottom: initial;
}

.smart-text-box .smart-drop-down {
    font-family: inherit;
}

.smart-text-box .smart-content {
    height: 100%;
}

/* renderMode */

smart-text-box.outlined,
smart-text-box.underlined,
smart-input.outlined,
smart-input.underlined,
.smart-input.underlined:not([opened]) .smart-drop-down-button {
    background-color: transparent;
}

.smart-text-box.underlined input.smart-input,
.smart-input.underlined,
.smart-input.underlined .smart-drop-down-button {
    border-top: none;
    border-left: none;
    border-right: none;
}

    .smart-text-box.underlined input.smart-input,
    .smart-input.underlined:not([opened]),
    .smart-input.underlined:not([readonly]):not([opened]) .smart-drop-down-button {
        border-radius: initial;
    }

    .smart-input.underlined[opened][drop-down-button-position="right"]:not([readonly]),
    .smart-input.underlined[opened][drop-down-button-position="right"]:not([readonly]) input {
        border-bottom-left-radius: 0;
    }

    .smart-input.underlined[opened][drop-down-button-position="left"]:not([readonly]),
    .smart-input.underlined[opened][drop-down-button-position="left"]:not([readonly]) input {
        border-bottom-right-radius: 0;
    }

    .smart-text-box.underlined input.smart-input,
    .smart-input.underlined:not([opened]) input.smart-input,
    .smart-input.underlined:hover:not([opened]) input.smart-input {
        background: transparent;
    }

.smart-input.underlined {
    color: var(--smart-surface-color);
}

    .smart-input[readonly].underlined:active:not([opened]) .smart-input,
    .smart-input[readonly].underlined:active:not([opened]) .smart-drop-down-button,
    .smart-input.underlined:not([opened]) .smart-drop-down-button:active {
        background-color: transparent;
        color: var(--smart-surface-color);
    }

/* --- Right-to-left --- */

smart-input[right-to-left] > .smart-container {
    direction: initial;
}

smart-text-box[right-to-left] .smart-label,
smart-text-box[right-to-left] .smart-hint,
smart-input[right-to-left] .smart-input,
smart-text-box[right-to-left] > .smart-container > .smart-content {
    direction: rtl;
}

smart-input[readonly][right-to-left] .smart-input {
    padding-left: initial;
    padding-right: var(--smart-editor-label-padding);
}

.smart-input-drop-down-menu[right-to-left] ul.scroll {
    width: 100%;
}

.smart-input-drop-down-menu[right-to-left] li a.icon {
    padding-left: initial;
    padding-right: var(--smart-column-icon-size);
}

    .smart-input-drop-down-menu[right-to-left] li a.icon::after {
        left: initial;
        right: 0;
    }

smart-input[readonly][right-to-left] .smart-drop-down-button {
    border-right: none;
}
/* --- */
