/* Add here all your CSS customizations */

/* popup för chat */
            


:root {
    
    --message-reply-bg: #ffe5e4;
    --message-request-bg: #f38282;
    --message-bot-avatar: #d67e78;
    --button-send-message: #bb4942;
    --message-input-border-hover: #cd7373;
    --message-input-border: #e24444;
    --chatbot-toggler-icon: #FB7A7A;
}

.chatbot-popup{
    margin: 25px;
    display: ;
}

.chatbot-popup {
    position: fixed;
    right: 10px;
    bottom: 90px;
    width: 420px;
    background: #fff;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), 0 32px 64px -48px rgba(0,0,0,0.5);
    font-size: 1.4em;
    font-family: "DINPro-Regular", Arial, Verdana, sans-serif;
    line-height: 20px;
    opacity: 0;  
    pointer-events: none;
    z-index: 1101;
    transition: all 0.1s ease;
}

body.show-chatbot .chatbot-popup {
    opacity: 1;
    pointer-events: auto;
}
.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Toning */
    z-index: 1100; 
    display: none; 
}
.chat-header {
    display: flex;
    align-items: center;
    background: #f78a87;
    padding: 15px 22px;
    justify-content: space-between;
}

.chat-header .header-info {
    display: flex;
    gap: 10px;
    align-items: center;
}            

.header-info .chatbox-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    background: #fff;
    border-radius: 50%;
    color: coral;
    flex-shrink: 0;
    padding-top: 10px;
    font-size: 0.7em;
}


.header-info .logo-text {
    color: #fff;
    font-weight: 600;
    font-size: 1.1em;
    position: relative;
    top:-3px;
}


.chat-header #close-chatbot {
    border: none;
    color: #fff;
    height: 40px;
    width: 40px;
    font-size: 15px;
    cursor:pointer;
    border-radius: 50%;
    background: #ce6771;
    transition: 0.2s ease;
}


.chat-header #close-chatbot:hover {
    background: #c1515c;
}

.chat-body {
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    height: 460px;
    margin-bottom: 82px;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 transparent;
}

.chat-body .message {
    display: flex;
    gap: 11px;
    align-items: center;
}

.chat-body .message {
    display: flex;
    gap: 11px;
    align-items: center;
}

.chat-body .bot-message .bot-avatar {
    height: 35px;
    width: 35px;
    padding: 6px;      
    background: var(--message-bot-avatar);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
    padding-top: 8px;   
    margin-bottom: 2px; 
    font-size: 0.7em;
    align-self: flex-end;
    flex-shrink: 0;
}

.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .user-message .img-attachment {
    width: 50%;
    margin-top: 7px;
    border-radius: 13px;
} 

.chat-body .message .message-text {
    padding: 12px 16px !important;
    max-width: 75%;
    font-size: 0.95rem;
    color: #000;
}

.chat-body .bot-message.thinking .message-text {
    padding: 2px 16px;  
}

.chat-body .bot-message .message-text {
    background: var(--message-reply-bg);
    border-radius: 13px 13px 13px 3px;
}

 .chat-body .user-message .message-text {
     color: #fff;
    background: var(--message-request-bg);
    border-radius: 13px 13px 3px 13px;
}


.chat-body .bot-message .thinking-indicator {
    display: flex;
    gap: 4px;
    padding-block: 15px;   
    padding: 6px 6px;      
}

.chat-body .bot-message .thinking-indicator .dot {
    height: 7px;
    width: 7px;
    border-radius: 50%;
    background: #6e6bc2;
    opacity: 0.7;
    animation: dotPulse 1.8s ease-in-out infinite;
}


.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {animation-delay: 0.2s}
.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {animation-delay: 0.3s}
.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {animation-delay: 0.4s}


@keyframes dotPulse {
    0%, 44% {transform: translateY(0);}
    28% {opacity: 0.4; transform: translateY(-4px);}
    44% {opacity: 0.2;}
}


.chat-form .file-upload-wrapper {
    height: 35px;
    width: 35px;
    position: relative;
}

.chat-form .file-upload-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-form .file-upload-wrapper #file-cancel { 
    color: #ff0000;
    background: #ffffffc4;
    position: relative;
    top: -35px;
}

.chat-form .file-upload-wrapper :where(img, #file-cancel), 
.chat-form .file-upload-wrapper.file-uploaded #file-upload {
    display: none;
}

.chat-form .file-upload-wrapper.file-uploaded img, 
.chat-form .file-upload-wrapper.file-uploaded:hover #file-cancel { 
    display: block;
}

.chat-footer {
    position: absolute;
    bottom: 0;
    width: 100%;  
    background: #fff;
    padding: 15px 22px 20px;
}
.chat-footer .chat-form {
    display: flex;
    position: relative;
    align-items: center;
    background: #fff;
    outline: 1px solid #cccce5;
    border-radius: 32px;
}

.chat-form .message-input {
    border: none;
    outline: none;
    height: 47px;
    width: 100%;
    resize: none;
    max-height: 180px;
    white-space: pre-line;
    font-size: 0.95rem; 
    padding: 14px 0 13px 18px;
    border-radius: inherit;
    background: transparent;
    color: black;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.chat-form .message-input:hover {
    scrollbar-color: var(--message-input-border-hover) transparent;
}


.chat-form .chat-controls {
    display: flex;
    align-items: center;
    align-self: flex-end;
    padding-right: 6px;
    height: 47px;
    gap: 3px;
}
.chat-form .chat-controls button {
    height: 35px;
    width: 35px;
    border: none;
    font-size: 15px;
    padding-left: 6px;
    cursor: pointer;
    color: #706db0;
    background:  none;
    border-radius: 50%;
    transition: 0.2s ease;
}

.chat-form .chat-controls button:hover {
    background:  #f1f1ff;
}

.chat-form:focus-within {
    outline: 2px solid var(--message-input-border-hover);
}


.chat-form .chat-controls #send-message {
    background: var(--button-send-message);
    color: #fff;  
    display: none;
} 

.chat-form .message-input:valid~.chat-controls #send-message {
    display: block;
}

.chat-form .chat-controls #send-message:hover {
    background: ##9e9bf1;
}

#chatbot-toggler {
    position: fixed;
    bottom: 20px;
    right: 25px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    background: var(--chatbot-toggler-icon);
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 50px;
    z-index: 1000;
}

#chatbot-toggler span {
    color: #fff;
    position: absolute;
    left: 14px;
    top:  14px;
}
#chatbot-toggler span:last-child {
    opacity: 0;

}

em-emoji-picker {
    position: absolute;
    left: 50%;
    top: -367px;
    width: 100%;
    max-width: 350px;
    max-height: 350px;
    visibility: hidden; 
    transform: translateX(-50%);
}

/* denna kod borde göra att fönstret med emoji visas men det gör det inte, varför? */
body.show-emoji-picker em-emoji-picker {
    visibility: visible;
}


@media (max-width: 475px) {
    .chatbot-popup {
        width: 85%;
        z-index: 10000;
        bottom: 0px;
    }
    .chat-body {
        height: 400px;
    }
    .chat-form .chat-controls button {
        padding-left: 12px;
    }
}


@media (min-width: 991px) {
    #chatbot-toggler {
        bottom: 55px;
        right: 12px;
    }
}
                

