/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */

.wtai-feedback-visibility {
    display: contents;
}

.wtai-text-feedback {
    float: right;

    .wtai-like {
        padding: 0;
        background: none;
        border: none;

        &.wtai-active {
            &::before {
                background-image: url("../WriteTextAI_WriteTextAI/images/liked.png");
            }
        }

        &.wtai-liked {
            & ~ .wtai-dropdown-dialog {
                left: ~"calc(50% - 10px)";
            }
        }

        &::before {
            content: '';
            display: block;
            width: 20px;
            height: 20px;
            background-image: url("../WriteTextAI_WriteTextAI/images/like.png");
        }
    }

    .wtai-dislike {
        padding: 0;
        background: none;
        border: none;

        &.wtai-active {
            &::before {
                background-image: url("../WriteTextAI_WriteTextAI/images/disliked.png");
            }
        }

        &.wtai-disliked {
            & ~ .wtai-dropdown-dialog {
                left: ~"calc(50% + 10px)";
            }
        }

        &::before {
            content: '';
            display: block;
            width: 20px;
            height: 20px;
            content: '';
            background-image: url("../WriteTextAI_WriteTextAI/images/dislike.png");
        }
    }

    .wtai-text-feedback-content {
        position: relative;
        margin-top: 10px;
    
        &.wtai-liked {
            .wtai-text-feedback-popup {
                left: -20px;
            }
        }
    
        &.wtai-disliked {
            .wtai-text-feedback-popup {
                left: 5px;
            }
        }
    }

    .wtai-dropdown-dialog {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
        position: absolute;
        z-index: 2;
        bottom: 125%;
        box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
        width: 300px;
        left: 50%;
        transform: translateX(-50%);

        &::before {
            height: 0;
            width: 0;
            content: '';
            display: block;
            position: absolute;
            top: 100%;
            z-index: -1;
            border: 2.8rem solid transparent;
            bottom: -36px;
            left: 50%;
            transform: translate(-50%);
            top: auto;
            border-top-color: #fff;
            border-bottom-color: transparent;
            pointer-events: none;
        }
        
        .ui-dialog-buttonpane {
            position: absolute;
            top: 0;
            right: 0;
            padding: 0;

            .ui-button.wtai-feedback-close {
                background: none;
                color: #000;
                border: 0;
                text-shadow: none;
                padding: 5px;

                &:hover {
                    box-shadow: none;
                }

                &::before {
                    content: '\e62f';
                    font-family: 'Admin Icons';
                    font-style: normal;
                    font-weight: normal;
                    font-size: 11px;
                    line-height: 1;
                    speak: none;
                }
            }
        }
    }

    .wtai-text-feedback-popup {
        padding: 20px;
        position: absolute;
        display: none;
        background: #fff;
        z-index: 2;
        box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
        top: auto;
        bottom: ~"calc(100% + 10px)";

        &::after {
            border-color: #fff transparent transparent transparent;
            border-style: solid;
            border-width: 10px;
            top: 100%;
            content: "";
            left: 30px;
            transform: translate(-50%);
            position: absolute;
        }

        &.wtai-active {
            display: block;
        }

        .wtai-header {
            font-size: 12px;
            text-align: left;
        }

        .wtai-control {
            margin-top: 0;
            line-height: normal;
        }

        &.ui-dialog-content {
            width: auto;
            min-height: 0px;
            max-height: none;
            height: auto;
            padding: 2rem;
            display: block;
        }

        textarea {
            resize: vertical;
            background-color: #ffffff;
            border: 1px solid #adadad;
            line-height: 1.36;
            font-size: 12px;
        }

        .wtai-count {
            display: block;
            font-size: 11px;
        }
    }

    .wtai-actions {
        margin-top: 20px;
        text-align: right;

        .action {
            font-size: 12px;
        }
    }

    .wtai-loading-mask {
        background-color: #ffffff;
        background-image: url("../WriteTextAI_WriteTextAI/images/mage-loader.gif");
        background-position: center;
        margin: 0;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background-repeat: no-repeat;
        opacity: .5;
        background-size: 30px 30px;

        &.wtai-no-display {
            display: none;
        }
    }
}