.ciq-chart-history {
    border-radius: $border-radius;
    z-index: 8;
    position: relative;
    top: 0.4em;
    display: none;
    padding: 0.8rem;
    @include themify($themes) {
        background: themed('ChartHistoryBg');
    }

    &__container {
        display: flex;
        border-radius: $border-radius;
        position: relative;
        padding: 1.2rem 0.8rem;
        justify-content: center;
        align-items: center;
        width: calc(100% - 1%);
        @include themify($themes) {
            background: themed('ChartHistoryBgContainer');
        }

        > strong {
            font-family: 'IBM Plex Sans';
            font-size: 1.4em;
            font-weight: normal;
            font-style: normal;
            line-height: normal;
            white-space: nowrap;
            width: 9.2rem;
            @include themify($themes) {
                color: themed('ChartHistoryColor');
            }
        }
    }
    .datepicker-container,
    .time-picker {
        border-radius: $border-radius;
    }
    .datepicker-container {
        margin-left: 0.6rem;

        .datepicker-display-wrapper .datepicker-display {
            max-width: 9.4rem;
            font-family: $base-font;
            font-weight: normal;

            &:focus-visible {
                outline: none;
            }
        }
    }
    .time-picker {
        display: flex;
        align-items: center;
        width: 7.8rem;
        height: 3.2rem;
        margin-left: 0.8rem;
        box-sizing: border-box;
        cursor: pointer;
        @include themify($themes) {
            border: 1px solid themed('ChartHistoryPickerBorder');
            background: themed('ChartHistoryPickerBg');
        }

        &.active {
            @include themify($themes) {
                border: 1px solid themed('ChartHistoryPickerActiveBorder');
            }
        }
        &:hover {
            @include themify($themes) {
                border: 1px solid themed('ChartHistoryPickerActiveBorder');
            }
        }
        input {
            width: 100%;
            border: none;
        }
    }
}

.smartcharts-mobile .ciq-chart-history {
    position: fixed;
    bottom: 3.2rem;
    left: 0;
    top: auto;
    margin: 0;
    width: calc(100% - 1.6rem);
    border: none;
    border-radius: 0;

    &__container {
        padding: 0.8rem;
        justify-content: space-between;
        column-gap: 0.8rem;

        > strong {
            font-size: 1.2em;
            line-height: 1.8rem;
            width: 7.9rem;
        }
    }
    .time-picker {
        height: auto;
        width: auto;
        margin-left: 0;

        .time-picker-container {
            display: flex;
            align-items: center;
            column-gap: 0.2rem;
            padding: 0.7rem 0.5rem 0.7rem 0.7rem;

            .picker-time-icon {
                position: inherit;
                padding: 0;
            }
        }
        .time-picker-input {
            border: none;
            font-size: 1.2em;
            padding: 0;
            width: 7.65rem;
        }
        .time-picker-dropdown {
            position: absolute;
            top: auto !important;
            right: 0px !important;
            bottom: calc(100% + 24px);
            transform: translate(-20%, 0);

            &.active {
                bottom: calc(100% + 24px);
                @include themify($themes) {
                    border: 1px solid themed('ChartHistoryPickerDropdownBorder');
                }
            }
        }
    }
    .datepicker-container {
        height: auto;
        margin: 0;
        position: initial;

        .datepicker-display-wrapper {
            padding: 1.9rem 0.3rem 1.9rem 0.7rem;
            display: flex;
            column-gap: 0.4rem;

            .date-picker-calendar-icon {
                padding: 0;
            }
        }
        .datepicker-display-wrapper .datepicker-display {
            max-width: 7.65rem;
            font-size: 1.2em;
            line-height: 1.8rem;
            padding: 0;
        }
        .datepicker-calendar {
            > div.calendar {
                top: auto !important;
                position: absolute;
                left: 50%;
                transform: translate(-50%, 0);
            }
            &.show > div.calendar {
                bottom: calc(100% + 24px);
            }
        }
    }
}

.cq-chart-title + .ciq-chart-history {
    display: inline-flex;
}
