@use "../utils/variables";

/**=====================
    Ticket CSS Start
==========================**/

.ticket-content {
    .created-time {
        font-size: calc(13px + (14 - 13) * ((100vw - 320px) / (1920 - 320)));
        line-height: 1.2;
        padding-bottom: 10px !important;
        margin-bottom: 0 !important;
        display: flex;
        align-items: center;

        .name {
            margin-right: 8px;
            padding-right: 8px;
            border-right: 1px solid #c5c5c5;
        }

        .badge {
            font-size: 13px;
            line-height: 1.2;
            font-weight: 400;
            width: unset;
            height: unset;
            border-radius: 5px;
            color: variables.$white;
            display: inline-block;
        }
    }

    .upload-file-container {
        label {
            font-size: 14px;
        }

        .upload-file {
            display: flex;
            align-items: center;
            gap: 12px;

            .btn {
                line-height: 1.1;

                i {
                    font-size: 20px;
                }
            }
        }
    }

    .response-form {
        border-bottom: 1px solid rgba(variables.$dark-color, 0.1);
        padding-bottom: 16px;
        margin-top: 16px;

    }
}

.ticket-contentbox {
    padding: calc(12px + (16 - 12) * ((100vw - 320px) / (1920 - 320)));
    border: 1px solid rgba(variables.$dark-color, 0.1);
    border-radius: 6px;
}

.reply-box {
    display: flex;
    flex-direction: column;
    gap: 16px;

    li {
        gap: calc(8px + (16 - 8) * ((100vw - 320px) / (1920 - 320)));
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(variables.$dark-color, 0.1);

        &:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .user-img {
            border-radius: 100%;
            width: 40px;
            height: 40px;
        }

        .comment-div {
            display: flex;
            flex-direction: column;
            gap: 6px;
            border-top: 1px solid #eee;
            margin-top: 12px;
            padding-top: 16px;
        }

        h5 {
            font-weight: 500;
            margin-bottom: 0 !important;
            line-height: 1.1;

            span {
                font-size: 14px;
                font-weight: 400;
                color: #777;
            }
        }

        .ticket-hour {
            color: rgba(variables.$dark-color, 0.6);
            font-weight: 500;
            font-size: 12px;
            line-height: 1;
        }

        .comment {
            font-size: 13px;
            color: rgba(variables.$dark-color, 0.8);
            line-height: 1.3;

            p {
                margin-bottom: 6px;
                font-size: 13px;
                color: rgba(variables.$dark-color, 0.8);
                line-height: 1.3;

                &:last-child {
                    margin-bottom: 0;
                }
            }
        }

        .comment-text {
            max-height: 100px;
            overflow: hidden;
            position: relative;
            transition: max-height 0.3s ease;

            &.expanded {
                max-height: none;
            }

            div[contenteditable="true"] {
                background-color: #f9f9f9;
                border: 1px solid #eee;
                padding: 13px;
                font-size: 14px;
                font-weight: 500;
                color: #777777;
                margin-block: 18px;
                border-radius: 5px;
            }

            h1 {
                font-size: 38px;
                line-height: 1.2;
                text-transform: unset;
            }

            h2 {
                font-size: 30px;
                text-transform: unset;
                font-weight: 600;
            }

            h3 {
                font-weight: 600;
                margin-top: 21px;
            }

            h4 {
                margin-top: 22px;
                font-weight: 600;
                margin-bottom: 0;
            }

            h5 {
                font-size: 18px;
                margin-block: 20px 10px !important;
            }

            h6 {
                font-size: 16px;
            }

            label {
                margin-block: 4px 0;
                display: inline-flex;
                align-items: center;
                gap: 8px;
                font-weight: 500;
                font-size: 14px;

                +label {
                    margin-left: 12px;
                }

                input[type="radio"] {
                    outline: none;
                    position: relative;
                    width: 14px;
                    height: 14px;
                    border: 1px solid #b5b5b5;
                    background-color: transparent;
                    appearance: none;
                    border-radius: 100%;

                    &::before {
                        content: "";
                        position: absolute;
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, -50%) scale(0);
                        transition: transform 0.2s ease-in-out;
                        background-color: var(--primary-color);
                        border-radius: 100%;
                        width: 8px;
                        height: 8px;
                    }

                    &:checked {
                        border-color: var(--primary-color);

                        &::before {
                            transform: translate(-50%, -50%) scale(1);
                        }
                    }
                }
            }

            ol,
            ul {
                display: block;

                +p {
                    display: none;
                }

                +ol,
                +ul {
                    margin-top: 15px;
                }

                ol,
                ul {
                    padding-left: 0;
                    display: list-item;
                    list-style-type: disc;

                    li {
                        display: block;
                        list-style-type: circle;
                    }
                }
            }

            table {
                border: 1px solid #eee;
                width: 100%;
                text-align: center;
                margin-top: 14px;

                tbody {
                    tr {
                        +tr {
                            border-top: 1px solid #eee;
                        }

                        td {
                            padding: 9px;
                            font-size: 15px;

                            &:first-child {
                                background-color: #eeeeee4a;
                            }

                            &:last-child {
                                font-weight: 500;
                            }

                            +td {
                                border-left: 1px solid #eee;
                            }
                        }
                    }
                }
            }

            p {
                &:first-child {
                    &:has(strong) {
                        margin-bottom: 6px;
                        font-size: 13px;
                        margin-top: 0;
                        margin-bottom: 0;
                    }
                }

                &:has(strong) {
                    margin-top: 22px;
                    font-size: 16px;
                }

                em {
                    background-color: #f9f9f9;
                    border: 1px solid #eee;
                    padding: 13px;
                    font-size: 14px;
                    font-weight: 500;
                    color: #777777;
                    margin-top: 18px;
                    border-radius: 5px;
                    display: block;
                }
            }

            button {
                background-color: var(--primary-color);
                border: 1px solid var(--primary-color);
                padding: calc(8px + 2*(100vw - 320px) / 1600) 22px;
                font-size: 16px;
                font-weight: 600;
                color: #eee;
                margin-block: 18px;
                border-radius: 5px;
                display: block;
            }

            >ul {
                margin-top: 10px;

                li {
                    border: none;
                    padding: 0;
                    width: 100%;
                    font-size: 14px;
                    font-weight: 500;

                    +li {
                        border-top: 1px solid #eee;
                        margin-top: 7px;
                        padding-top: 7px;
                    }

                    strong {
                        font-weight: 600;
                    }
                }
            }
        }

        .read-more,
        .read-less {
            display: block;
            color: var(--primary-color);
            cursor: pointer;
            margin-top: 14px;
            border-top: 1px solid #eee;
            font-size: 15px;
            padding-top: 14px;
            font-weight: 600;
        }

        .attachment-box {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;

            &:empty {
                display: none;
            }

            .d-flex {
                align-items: center;
                gap: 15px;

                small {
                    font-size: 14px !important;
                    font-weight: 400;
                }
            }
        }

        .dropdown {
            &.ticket-dropdown {
                position: relative;

                .dropdown-menu {
                    min-width: 10rem;
                    width: auto !important;
                }
            }

            .dropdown-toggle {
                padding: 0;
                border: none;

                i {
                    font-size: 18px;
                }
            }
        }

        .profile-box {
            .profile-img {
                .initial-letter {
                    span {
                        width: 40px;
                        min-width: 40px;
                        height: 40px;
                        border-radius: 100%;
                        display: inline-flex;
                        color: rgba(variables.$dark-color, 0.7);
                        align-items: center;
                        justify-content: center;
                        background-color: rgba(variables.$dark-color, 0.08);
                        font-size: 20px;
                        text-transform: uppercase;
                    }
                }
            }
        }
    }
}

.note-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #fff3cd;
    padding: 10px;
    width: -webkit-fill-available;
}

.sorting {
    margin-bottom: 24px;

    .select-sorting {
        display: flex;
        align-items: center;
        justify-content: end;
        flex-wrap: nowrap;
        gap: 12px;
        background-color: variables.$gray-color-1;
        border-radius: 5px;
        padding: 8px;

        .select-form {
            min-width: calc(180px + (280 - 180) * ((100vw - 320px) / (1920 - 320)));
        }

        >label {
            margin-bottom: 0;
            font-size: calc(14px + (16 - 14) * ((100vw - 320px) / (1920 - 320)));
        }
    }
}

.email-template-box {
    border-radius: 14px;
    border: 1px solid #eee;
    box-shadow: none;
    background-color: #f9f9f996;

    &.email-send {
        h5 {
            font-size: 18px;
            font-weight: 500;
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
            margin-bottom: 20px;
            letter-spacing: unset;
        }

        .email-template-contain {
            p {
                font-size: 15px;
                font-weight: 400;
                margin-bottom: 20px;
                letter-spacing: unset;
                color: variables.$dark-font;
            }

            ul {
                padding-left: 40px;
                margin-top: unset;
                margin-bottom: 20px;

                li {
                    display: list-item;
                    list-style-type: disc;
                    border-top: unset;
                    font-weight: 400;

                    strong {
                        font-size: 16px;
                        font-weight: 500;
                    }
                }

                +p {
                    display: block;

                    +p {
                        margin-bottom: 0;
                    }
                }
            }
        }
    }

    .email-template-contain {
        &.expanded {
            max-height: none;
        }

        div[contenteditable="true"] {
            background-color: #f9f9f9;
            border: 1px solid #eee;
            padding: 13px;
            font-size: 14px;
            font-weight: 500;
            color: #777777;
            margin-block: 18px;
            border-radius: 5px;
        }

        h1 {
            font-size: 34px;
            margin: 0;
            line-height: 1.2;
            text-transform: unset;
        }

        h2 {
            font-size: 30px;
            text-transform: unset;
            font-weight: 600;
            margin-top: 20px;
            margin-bottom: 4px;
        }

        h3 {
            font-weight: 600;
            margin-top: 21px;
        }

        h4 {
            margin-top: 22px;
            font-weight: 600;
            margin-bottom: 0;
        }

        h5 {
            font-size: 18px;
            margin-block: 20px 10px !important;
        }

        h6 {
            font-size: 16px;
        }

        label {
            margin-block: 4px 0;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
            font-size: 14px;

            +label {
                margin-left: 12px;
            }

            input[type="radio"] {
                outline: none;
                position: relative;
                width: 14px;
                height: 14px;
                border: 1px solid #b5b5b5;
                background-color: transparent;
                appearance: none;
                border-radius: 100%;

                &::before {
                    content: "";
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%) scale(0);
                    transition: transform 0.2s ease-in-out;
                    background-color: var(--primary-color);
                    border-radius: 100%;
                    width: 8px;
                    height: 8px;
                }

                &:checked {
                    border-color: var(--primary-color);

                    &::before {
                        transform: translate(-50%, -50%) scale(1);
                    }
                }
            }
        }

        ol,
        ul {
            display: block;

            +p {
                display: none;
            }

            +ol,
            +ul {
                margin-top: 15px;
            }

            ol,
            ul {
                padding-left: 0;
                display: list-item;
                list-style-type: disc;

                li {
                    display: block;
                    list-style-type: circle;
                }
            }
        }

        table {
            border: 1px solid #eee;
            width: 100%;
            text-align: center;
            margin-top: 14px;

            tbody {
                tr {
                    +tr {
                        border-top: 1px solid #eee;
                    }

                    td {
                        padding: 9px;
                        font-size: 15px;

                        &:first-child {
                            background-color: #eeeeee4a;
                        }

                        &:last-child {
                            font-weight: 500;
                        }

                        +td {
                            border-left: 1px solid #eee;
                        }
                    }
                }
            }
        }

        p {
            margin-bottom: 0;

            &:first-child {
                &:has(strong) {
                    margin-bottom: 6px;
                    font-size: 13px;
                    margin-top: 0;
                    margin-bottom: 0;
                }
            }

            &:has(strong) {
                margin-top: 6px;
                font-size: 16px;
            }

            em {
                background-color: #f9f9f9;
                border: 1px solid #eee;
                padding: 13px;
                font-size: 14px;
                font-weight: 500;
                color: #777777;
                margin-top: 18px;
                border-radius: 5px;
                display: block;
            }
        }

        button {
            background-color: var(--primary-color);
            border: 1px solid var(--primary-color);
            padding: calc(8px + 2*(100vw - 320px) / 1600) 22px;
            font-size: 16px;
            font-weight: 600;
            color: #eee;
            margin-block: 18px;
            border-radius: 5px;
            display: block;
        }

        >ul {
            margin-top: 10px;

            li {
                border: none;
                padding: 0;
                width: 100%;
                font-size: 14px;
                font-weight: 500;

                +li {
                    border-top: 1px solid #eee;
                    margin-top: 7px;
                    padding-top: 7px;
                }

                strong {
                    font-weight: 600;
                }
            }
        }
    }
}

/**=====================
    Ticket CSS End
==========================**/