// common
.item-ai {
    .ai-btn-groups {
        display: flex;
        gap: 32px;
        align-items: center;
        padding: 0 8px;
        border-radius: 6px;

        // transition: background-color .3s ease;
        .comment-btn {
            display: flex;
            gap: 8px;
            align-items: center;
            color: #c1c1c1;
            cursor: pointer;

            .text {
                color: #3574ee;
            }
        }
    }

    .recommend-box-init {
        .recommend-box {
            padding: 0 12px;
            padding-bottom: 8px;
            // padding-left: 12px;
            flex-direction: row;
            flex-wrap: wrap;
        }
    }

    .recommend-box {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 0;
        padding-left: 46px;

        .recommend-item {
            display: flex;
            width: fit-content;
            position: relative;
            padding: 0 8px;
            padding-right: 18px;
            max-width: 80%;
            min-height: 32px;
            align-items: center;
            cursor: pointer;
            justify-content: space-between;
            border-radius: 6px;
            border: 1px solid #e7e7e7;
            color: #333;

            &:hover {
                background-color: rgba(0, 0, 0, 0.04);
            }

            .icon-box {
                position: absolute;
                top: 3px;
                right: 4px;
            }
        }
    }
}

.description-box {
    .title {
        font-size: 14px;
        font-weight: bold;
    }

    padding: 8px 12px;
}

// pc - start
.ai-tool-drawer.fl-modal.ant-modal {


    .ant-modal-header {
        background-color: transparent !important;

        .ant-modal-title {
            .dialog-title {
                position: relative;
                padding: 0 16px !important;
                box-sizing: border-box;
                height: 68px;
                font-size: 14px;
                line-height: 20px;
                background-color: transparent !important;

                .disabled-move-title {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex: 1;
                    font-size: 14px;

                    .icon {
                        cursor: auto;
                    }

                    .table-icon-box {
                        margin-right: 2px;
                        display: inline-flex;
                        align-items: flex-start;
                        justify-content: center;
                        width: 16px;
                        height: 16px;
                        font-size: 14px;
                        border-radius: 3px;
                        background-color: #3574ee;
                        color: #fff;
                    }
                }

                .fixed-hover-title {
                    .table-icon-box {
                        display: none;
                    }
                }

                .tools-bar {
                    position: absolute;
                    right: 18px;
                }
            }
        }
    }

    .ant-modal-content {
        background-image: linear-gradient(180deg, rgba(53, 116, 238, 0.16) 0%, rgba(255, 255, 255, 0.3) 130px);
        // border-radius: 8px;
    }

    .ant-drawer-header {
        border-bottom: none;
        background: transparent !important;
    }

    .ant-modal-body {
        &.isMinWidth {
            .chat-list {
                .ant-list-item-meta-avatar {
                    display: none;
                }
            }

            .footer-box {

                .ai-model-selector {
                    min-width: unset !important;

                    .current-label {
                        .label-text {
                            display: none;
                        }
                    }
                }

                .icon-prefix-box {
                    margin: 0 6px !important;
                }
            }
        }
    }

    .ai-tool-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        height: 100%;
        user-select: none;

        .chat-footer {
            // position: fixed;
            // bottom: 18px;
            margin-bottom: 18px;
            padding: 0 16px;
            width: 100%;
            max-width: 1200px;

            .footer-box {
                display: flex;
                flex-direction: column;
                align-items: center;
                box-sizing: border-box;
                padding: 8px 12px;
                width: 100%;
                min-height: 48px;
                background-color: #fff;
                box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d;
                border-radius: 8px;

                .word-inp {
                    padding: 4px 20px 0 0;

                    &::-webkit-scrollbar {
                        width: 4px;
                        height: 4px;
                    }

                    &::-webkit-scrollbar-track {
                        box-shadow: inset 0 0 0 rgba(240, 240, 240, 0.5);
                        border-radius: 10px;
                        background-color: rgba(50, 50, 50, 0.1);

                    }

                    &::-webkit-scrollbar-thumb {
                        border-radius: 10px;
                        box-shadow: inset 0 0 0px rgba(240, 240, 240, 0.5);
                        background-color: rgba(50, 50, 50, .1);
                    }
                }

                .bottom-box {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding-top: 4px;
                    width: 100%;

                    .ai-model-selector {
                        min-width: 180px;
                        max-width: 300px;
                        padding: 4px;
                        border-radius: 6px;
                        background-color: #f7f8fa;
                        cursor: pointer;

                        .current-label {
                            display: flex;
                            gap: 8px;
                            align-items: center;

                            .label-text {
                                max-width: 180px;
                                white-space: nowrap;
                                text-overflow: ellipsis;
                                overflow: hidden;

                            }
                        }
                    }

                    .icon-send {
                        padding: 0;
                        height: 28px;

                        &.disabled {
                            color: #e6e6e6;
                        }
                    }
                }

                .icon-prefix-box {
                    margin: 0 6px 0 20px;
                    font-size: 14px;
                    color: #706e6b;

                    .icon-send-prefix {
                        cursor: auto;
                    }
                }

            }

            .ant-input:focus {
                box-shadow: none;
            }
        }

        .chat-list {
            width: 100%;
            height: 100%;
            max-width: 1200px;
            flex: 1;
            overflow: auto;
            padding: 16px;
            padding-bottom: 20px;

            &::-webkit-scrollbar {
                width: 6px;
                height: 6px;
            }

            &::-webkit-scrollbar-track {
                box-shadow: inset 0 0 0 rgba(240, 240, 240, 0.5);
                border-radius: 10px;
                background-color: rgba(50, 50, 50, 0.1);

            }

            &::-webkit-scrollbar-thumb {
                border-radius: 10px;
                box-shadow: inset 0 0 0px rgba(240, 240, 240, 0.5);
                background-color: rgba(50, 50, 50, .1);
            }

            // .ant-list-items li:nth-of-type(2) {
            //     margin-top: 0;
            // }

            .ant-list-item {
                display: block;
            }




            .meta-ai {

                .ant-list-item-meta-avatar {
                    margin-right: 14px;
                    margin-left: 0px;

                    .ant-avatar.ant-avatar-icon {
                        border-radius: 4px;
                    }
                }

                .ant-list-item-meta-content {
                    border-radius: 6px;
                    // padding: 8px 12px;
                    margin-right: 55px;
                    background-color: transparent;
                    border: 1px solid #e6e8eb;
                    user-select: text;

                    .ant-list-item-meta-title {
                        word-break: break-all;
                        font-weight: 550;
                    }

                    .ant-list-item-meta-description {
                        color: black;
                    }
                }
            }

            .meta-user {

                .ant-list-item-meta-avatar {
                    margin-left: 14px;
                    margin-right: 0px;

                    .ant-avatar.ant-avatar-icon {
                        border-radius: 4px;
                    }
                }

                .ant-list-item-meta-content {
                    border-radius: 6px;
                    // padding: 8px 12px;
                    margin-left: 55px;
                    text-align: left;
                    background-color: #f7f8fa;
                    flex: unset;
                    width: auto;
                    user-select: text;

                    .ant-list-item-meta-title {
                        word-break: break-all;
                        font-weight: 550;
                    }

                    .ant-list-item-meta-description {
                        color: black;
                    }
                }
            }

            &-wrapper {
                box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d;
                border-radius: 4px;
                background-color: white;
                width: 500px;
                height: calc(100vh - 100px);
                position: absolute;
                z-index: 99999;
                display: flex;
                flex-direction: column;
            }

            &-header {
                padding: 16px 20px;
                border-bottom: 1px solid rgba(0, 0, 0, .06);
                display: flex;
                align-items: center;
                cursor: move;

                &-title {
                    margin: 0;
                    color: #000000d9;
                    font-weight: 500;
                    font-size: 16px;
                    line-height: 22px;
                    word-wrap: break-word;
                    flex: 1;
                }
            }

            &-content {
                flex: 1;
                overflow: auto;
                padding: 12px 24px;
            }

            &-footer {
                display: flex;
                padding: 10px 16px;

            }

            ol ol,
            ul ul,
            ol ul,
            ul ol {
                list-style-position: inside;
            }
        }

    }

    .dialog-fix-right.dialog-pin-right {
        .ant-modal-content {
            background-image: unset;
            box-shadow: 0 3px 6px -4px rgba(0,0,0,0),0 6px 16px 0 rgba(0,0,0,0),0 0 3px 0px rgba(0,0,0,0.1);
        }
    }
}

.aitool-dialog-wrapper {
    padding: 0;
    position: relative;
    box-sizing: border-box;
    height: 50px;
    border-radius: 50%;
    cursor: move;
    overflow: hidden;

    .disabled-move-title {
        display: none;
    }

    .tools-bar {
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        background-color: #3574ee;

        .btn-hide {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-top: -6px;
            width: 50px;
            height: 50px;
            color: #fff;
            font-size: 26px !important;
            cursor: pointer;

            &:active {
                cursor: move !important;
            }
        }

        .btn-close {
            display: none;
        }
    }
}

.ai-tool-models-overlay {
    .ant-popover-inner {
        border-radius: 8px;
        padding: 0;
    }

    .ant-popover-inner-content {
        padding: 12px;
        min-height: 300px;
        max-height: 500px;
        overflow-y: auto;
    }

    .model-list-wrapper {
        border-radius: 6px;

        // padding: 6px 0;
        .filter-box {
            margin-bottom: 6px;

            .filter-inp {
                background-color: #f7f8fa;
            }
        }

        .model-list-box {
            padding: 6px;
            border: 1px solid #e6e8eb;
            border-radius: 6px;
            min-width: 242px;
            min-height: 340px;
            max-height: 400px;
            overflow-y: auto;

            &::-webkit-scrollbar {
                width: 7px;
                height: 7px;
            }

            &::-webkit-scrollbar-track {
                box-shadow: inset 0 0 0 rgba(240, 240, 240, 0.5);
                border-radius: 10px;
                background-color: rgba(50, 50, 50, 0.1);

            }

            &::-webkit-scrollbar-thumb {
                border-radius: 10px;
                box-shadow: inset 0 0 0px rgba(240, 240, 240, 0.5);
                background-color: rgba(50, 50, 50, .1);
            }
        }
    }

    .model-item-box {
        font-size: 14px;
        line-height: 22px;
        border-bottom: 1px solid #f1f1f1;

        &:nth-last-child(1) {
            border-bottom: 0;
        }

        .item-provider {
            color: rgba(0, 0, 0, 0.26);
            padding: 0 10px;
        }

        .model-item {
            color: rgba(0, 0, 0, .6);
            cursor: pointer;

            .current-label {
                display: flex;
                height: 32px;
                align-items: center;
                padding: 0 10px;
                gap: 8px;

            }

            &.active {
                color: #3574ee;
                background-color: rgb(230, 247, 255);
            }

            &:hover {
                color: #3574ee;
            }
        }
    }
}

// # pc - end

// mobile - start
.ai-tool-drawer {
    .ant-drawer-wrapper-body {
        background-image: linear-gradient(180deg, rgba(53, 116, 238, 0.16) 0%, rgba(255, 255, 255, 0.3) 60px);
    }

    .ant-drawer-content-wrapper {
        overflow: hidden;
        border-radius: 8px 8px 0 0;
        transition: unset;
    }

    .ant-drawer-header {
        position: sticky;
        // position: fixed;
        top: 0;
        width: 100%;
        height: 54px;
        padding: 16px;
        border-bottom: 0;
        background-color: transparent !important;

        // background-image: linear-gradient(180deg, rgba(53, 116, 238, 0.16) 0%, rgba(255, 255, 255, 0.3) 54px);
        .ant-drawer-title {
            color: rgba(0, 0, 0, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;

            .title-text {
                max-width: 50vw;
                font-size: 15px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;

            }

            .table-icon-box {
                margin-right: 2px;
                display: inline-flex;
                align-items: flex-start;
                justify-content: center;
                width: 16px;
                height: 16px;
                font-size: 14px;
                border-radius: 3px;
                background-color: #3574ee;
                color: #fff;
            }
        }

        .ant-drawer-extra {
            font-size: 14px;

            .chat-mode-box {
                display: flex;
                align-items: center;

                .chat-mode-switch {
                    margin-right: 2px;
                }
            }
        }
    }

    .ant-drawer-body {
        padding: 0;
        z-index: 0;
    }

    .ai-tool-mobile-wrapper {
        height: 100%;

        .ai-tool-container {
            display: flex;
            flex-direction: column;
            min-height: 60vh;
            height: 100%;
            transition: all .3s ease;
        }

        .chat-list {
            height: 100%;
            // height: calc(100vh - 130px);
            flex: 1 1 0%;
            padding: 0 16px;
            padding-bottom: 20px;
            overflow: auto;

            .ant-list-item {
                .ant-list-item-meta-avatar {
                    display: none;
                }

                &.item-ai {
                    .ant-list-item-meta-content {
                        border-radius: 6px;
                        // padding: 8px 12px;
                        margin-right: 55px;
                        background-color: transparent;
                        border: 1px solid #e6e8eb;
                        user-select: text;

                        .ant-list-item-meta-title {
                            word-break: break-all;
                            font-weight: 550;
                        }

                        .ant-list-item-meta-description {
                            color: black;
                        }
                    }
                }

                &.item-user {
                    .ant-list-item-meta-content {
                        border-radius: 6px;
                        // padding: 8px 12px;
                        margin-left: 55px;
                        text-align: left;
                        background-color: #f7f8fa;
                        flex: unset;
                        width: auto;
                        user-select: text;

                        .ant-list-item-meta-title {
                            word-break: break-all;
                            font-weight: 550;
                        }

                        .ant-list-item-meta-description {
                            color: black;
                        }
                    }
                }
            }
        }

        .chat-footer {
            // position: fixed;
            // bottom: 24px;
            width: 100%;
            padding: 0 16px;
            display: flex;
            z-index: 1;
            margin-bottom: 30px;

            .footer-box {
                display: flex;
                align-items: center;
                justify-content: space-between;
                background-color: #fff;
                padding: 0 14px;
                width: 100%;
                min-height: 54px;
                border-radius: 27px;
                box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.16);

                .icon {
                    color: #706e6b;
                    font-size: 18px;
                }

                .word-inp {
                    padding: 10px 20px 10 0;
                }
            }

            .icon-send {
                padding: 0;
                height: 28px;
                font-size: 16px;

                &.disabled {
                    color: #e6e6e6;
                }
            }
        }
    }
}

// mobile - end