/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

@keyframes pulse {
    0% { transform: scale(1); }
    10% { transform: scale(1.1); }
    20% { transform: scale(1); }
    100% { transform: scale(1); }
}

.wechatbot-chat-toggle {
    position: fixed;
    width: 75px;
    height: 75px;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    right: 2%;
    bottom: 6%;
    background-color: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    overflow: hidden;
    transition: all 0.5s ease;
    animation: pulse 5s infinite;
}

.wechatbot-chat-toggle:hover{
    width: 220px;
    border-radius: 37.5px;
    animation: none;
}


.wechatbot-chat-toggle-link{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.wechatbot-chat-toggle-link img{
    width: 50px;
    height: 50px;
}


.wechatbot-chat-toggle-link__text{
    text-decoration: none;
    opacity: 0;
    width: 0;
    transition: width 0.5s ease;
    white-space: nowrap;
}

.wechatbot-chat-toggle:hover .wechatbot-chat-toggle-link__text {
    opacity: 1;
    width: auto;
}

.wechatbot-chat-toggle:hover .wechatbot-chat-toggle-link{
    gap: 1rem;
}

.wechatbot-chat-toggle-link__text strong{
    color: #000;
    font-weight: bold;
    font-size: 1.125rem;
}

.wechatbot-chat-toggle-link__text span{
    color: #333;
    display: block;
    text-align: right;
    font-size: 15px;
    font-weight: 400;
}
.wechatbot-chat{
    display: none;
    position: fixed;
    right: 5%;
    bottom: 0;
    max-width: 650px;
    width: 100%;
    height: 500px;
    border: 2px solid #C6CECD;
    border-bottom: 0;
    font-size: 1.15rem;
    border-top-right-radius: 12px;
    border-top-left-radius: 12px;
    overflow: hidden;
}

@media (max-width: 720px){
    .wechatbot-chat{
        right: 0;
    }
}

.wechatbot-chat-overlay{
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wechatbot-context p{
    font-size: 15px;
    margin-bottom: 4px;
}

.wechatbot-chat-overlay-header{
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: #5a666a;
}

.wechatbot-chat-overlay-header-close-link img{
    height: 100%;
}

.wechatbot-chat-overlay-header-title{
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wechatbot-chat-overlay-header-title img{
    width: 30px;
    height: 30px;
}

.wechatbot-chat-overlay-body {
    padding: 0.5rem 1rem;
    background-color: #EBEFEB;
    flex: 1;
    overflow: auto;
}

.wechatbot-chat-overlay-body p {
    margin-top: 0;
}

.wechatbot-chat-overlay-body p:not(.wechatbot-chat-overlay-body-content-welcome-text) {
    text-align: left;
}

.wechatbot-chat-overlay-footer{
    background-color: #D7DDDB;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    border-top: 2px solid #C6CECD;
}

.wechatbot-chat-overlay-footer .wechatbot-chat-overlay-footer-input{
    padding: 8px 10px;
    flex: 1;
    background-color: #98A4A9;
    border: 0;
    border-radius: 4px;
    color: #474D4F;
    font-weight: 700;
    font-size: 14px;
}

.wechatbot-chat-overlay-footer .wechatbot-chat-overlay-footer-input::placeholder{
    color: #474D4F;
}

.wechatbot-chat-overlay-footer .wechatbot-chat-overlay-footer-send{
    background-color: transparent;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 6px 10px;
}

.wechatbot-chat-overlay-footer-send img{
    width: 25px;
    height: 25px;
}

.wechatbot-chat-overlay-footer-send:disabled{
    pointer-events: none;
    opacity: 0.6;
}

.selection-wrapper{
   display: flex;
    align-items: center;
    gap: 1rem;
}

.selection-wrapper > img{
    width: 60px;
    height: 60px;
}

.selection-wrapper .wrapper{
    width: fit-content;
    background-color: #fff;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    max-width: 100%;
    font-weight: 400;
    word-break: break-word;
    white-space: normal;
}

.selection-wrapper .wrapper > p{
    font-style: italic;
}

.selection-wrapper .wrapper .wechatbot-chat-overlay-body-content-answer{
    margin: 0.5rem 0;
    font-style: italic;
}

.buttons-wrapper{
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wechatbot-chat-overlay-body-content-button{
    background-color: #FFF198;
    border: 1px solid #FFF198;
    color: #121212;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: all 0.3s ease;
    word-break: break-word;
    white-space: normal;
    width: fit-content;
    max-width: 100%;
    padding: 0 0.25rem;
}

.wechatbot-chat-overlay-body-content-button.active{
    background-color: #FFF198;
    border: 1px solid #FFF198;
}


.wechatbot-chat-overlay-body-content-button.disabled{
    opacity: 0.6;
}

.wechatbot-chat-overlay-body-content-button-back.disabled{
    opacity: 0.6;
    pointer-events: none;
}

.wechatbot-chat-overlay-body-content-button:hover{
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: #FFF198;
    border: 1px solid #FFF198;
    color: #121212;
}

.wechatbot-chat-overlay-body-content-button:focus{
    transform: translateY(0px);
    box-shadow: none;
    cursor: default;
    background-color: #FFF198;
    border: 1px solid #FFF198;
    color: #121212;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wechatbot-chat-overlay-body-content-button:focus-within{
    outline: none;
}

.wechatbot-chat-overlay-body-content-button.active:hover{
    transform: translateY(0px);
    box-shadow: none;
    cursor: default;
    background-color: #FFF198;
    border: 1px solid #FFF198;
    color: #121212;
}


.wechatbot-chat-overlay-body-content-button-back{
    margin-top: 0.75rem;
    background-color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    display: block;
    padding: 0 0.25rem;
}

.wechatbot-chat-overlay-body-content-button-back:hover{
    background-color: #d13242;
    border-color: #d13242;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wechatbot-chat-overlay-body-content-answer-wrapper a{
    color: #0000EE;
}

.wechatbot-chat-overlay-body-content-answer-wrapper{
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wechatbot-chat-overlay-body-content-answer-wrapper > img{
    width: 60px;
    height: 60px;
}

.wechatbot-chat-overlay-body-content-answer-wrapper .wrapper{
    text-align: left !important;
    color: #121212;
    font-weight: 400;
    word-break: break-word;
    white-space: normal;
    background-color: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.wechatbot-chat-overlay-body-content-user-question {
    max-width: 100%;
    overflow-wrap: break-word;
    display: flex;
    margin-bottom: 1rem;
}

.wechatbot-chat-overlay-body-content-user-question p{
    margin-left: auto;
    padding: 1rem;
    border-radius: 12px;
    background-color: #E3CECD;
    color: #121212;
    max-width: 100%;
    text-align: left !important;
    display: inline-block;
    margin-bottom: 0;
    font-weight: 400;
}

.wechatbot-chat-overlay-body-content-answer-wrapper span{
    color: #111111;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.wechatbot-chat-overlay-body-content-welcome-text{
    color: #121212;
    font-weight: 600;
}

.wechatbot-chat-overlay-body-content-start{
    text-align: center !important;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #525c5d;
}

#wechatbot-chat-overlay-body-loader{
    margin-top: 12px;
    justify-content: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-left-color: #121212;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    text-align: center;
}

.wechatbot-chat-overlay-header-actions{
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wechatbot-chat-overlay-header-info-link,
.wechatbot-chat-overlay-header-close-link{
    display: flex;
    align-items: center;
}

.wechatbot-chat-overlay-header-info-link img,
.wechatbot-chat-overlay-header-close-link img{
    height: 100%;
    width: 30px;
}

.wechatbot-info-modal {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wechatbot-modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: #333;
    max-height: 75%;
    overflow-y: auto;
}

.wechatbot-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    padding: 0;
}

.wechatbot-modal-close:hover {
    color: #000;
    background-color: transparent;
}

.wechatbot-modal-start-btn {
    display: block;
    width: 100%;
    padding: 8px 20px;
    margin-top: 25px;
    background-color: #809197;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.wechatbot-modal-start-btn:hover {
    background-color: #6A7A80;
}