/*Import google fonts- Poppins*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}
#chatbot-widget * {
    box-sizing: border-box;
}

#chatbot-widget {
    font-family: "Poppins", sans-serif !important;
}

#chatbot-widget p,
#chatbot-widget span,
#chatbot-widget textarea,
#chatbot-widget button{
    all: unset;
    font-family: "Poppins", sans-serif !important;
    box-sizing: border-box;
}

#chatbot-widget h1,
#chatbot-widget h2,
#chatbot-widget h3,
#chatbot-widget p,
#chatbot-widget span {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-variant: normal !important;
}

#chatbot-widget p {
    display: block;
}

#chatbot-widget span {
    display: inline;
}

#chatbot-widget #send-btn {
    flex-shrink: 0;
}

#chatbot-widget body {
    background: #e3f2fd;
}

#chatbot-widget .chatbot-toggler {
    position: fixed;
    z-index: 99999;
    justify-content: center; 
    right: 40px;
    bottom: 35px;
    height: 50px;
    width: 50px;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: pointer;
    background: #000000;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#chatbot-widget.show-chatbot .chatbot-toggler {
  transform: rotate(90deg);
}

#chatbot-widget.chatbot-toggler span {
    position: absolute;
}

#chatbot-widget.show-chatbot .chatbot-toggler span:first-child,
#chatbot-widget .chatbot-toggler span:last-child {
  opacity: 0;
}

#chatbot-widget.show-chatbot .chatbot-toggler span:last-child {
  opacity: 1;
}

#chatbot-widget .chatbot {
    position: fixed;
    right: 40px;
    bottom: 100px;
    width: 460px !important;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    background-color: #ffffff !important;
    z-index: 9999;
    border-radius: 15px;
    transform-origin: bottom right;
    box-shadow: 0 0 128px 0 rgba(0,0,0,0.1),
                0 32px 64px -48px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
}

#chatbot-widget.show-chatbot .chatbot {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}


#chatbot-widget .chatbot header {
    background: #000000;
    padding: 20px 0 !important;
    text-align: center;
    position: relative;
}

#chatbot-widget .chatbot header h2 {
    color: #fff;
    font-size: 28px !important;
    font-family: 'Poppins', sans-serif !important;
    line-height: 1.4 !important;
    text-align: center !important;
    font-weight: 600 !important;
    margin: 0 auto !important;
    display: block !important;
    line-height: 1.4 !important;
    letter-spacing: 0.5px !important;
}

#chatbot-widget .chatbot header span {
    position: absolute;
    right: 20px;
    top: 50%;
    color: #fff;
    display: none;
    cursor: pointer;
    transform: translateY(-50%);
}

#chatbot-widget .show-chatbot .chatbot header span {
    display: block;
}

#chatbot-widget .chatbot .chatbox {
    list-style: none;
    margin: 0;
    height: calc(70vh - 120px);
    overflow-y: auto;
    padding: 30px 20px 100px 20px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    background-color: #ffffff !important;

}

#chatbot-widget .chatbox .chat {
    display: flex;
}

#chatbot-widget .chatbox {
  touch-action: pan-y;
}

#chatbot-widget .chat-input {
  background-color: #ffffff !important;
  z-index: 1;
}


#chatbot-widget .chatbox .incoming img.chat-icon {
    align-self: flex-end;
    height: 42px;
    width: 42px;
    color: #fff;
    background: #000000;
    text-align: center;
    line-height: 32px;
    border-radius: 50%;
    margin: 4px 8px 0 3px;
    flex-shrink: 0;
}

#chatbot-widget .chatbox .outgoing {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
    margin: 20px 3px 20px 20px;
}

#chatbot-widget .chatbox .chat p {
    color: #fff;
    max-width: 85%;
    white-space: pre-wrap;
    font-size: 17px !important;
    font-weight: 500 !important;
    padding: 14px 18px;
    border-radius: 10px 10px 0 10px;
    background: #000000;
}

#chatbot-widget .chatbox .chat p.error {
    color: #721c24;
    background: #f8d7da;
}

#chatbot-widget .chatbox .incoming p {
    margin: 0 20px 0 0 !important;
    color: #000;
    background: #f2f2f2;
    font-size: 17px !important;
    font-weight: 500 !important;
    border-radius: 10px 10px 10px 0;
    max-width: calc(100% - 50px);
}

#chatbot-widget .chatbox .outgoing p {
    font-size: 17px !important;
    font-weight: 500 !important;
    color: #fff !important;
    background: #000000 !important;
    border-radius: 10px 10px 0 10px !important;
}

#chatbot-widget .chatbot .chat-input {
    position: absolute;
    bottom: 0;
    flex-direction: column;
    width: 100%;
    display: flex;
    gap: 1px;
    background: #fff;
    padding: 5px 20px;
    border-top: 1px solid #ccc;
}

#chatbot-widget .input-row {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

#chatbot-widget .input-row textarea {
    flex: 1;
}

#chatbot-widget .chat-disclaimer {
    font-size: 11px !important;
    color: #555;
    opacity: 0.6;
    text-align: center;
    width: 100%;
    line-height: 1.1;
    padding: 0px 0 0 0 !important;
    display: block !important;
    visibility: visible !important;
}

#chatbot-widget .chat-input textarea {
    height: 55px;
    width: 100%;
    border: none;
    outline: none;
    max-height: 180px;
    font-size: 16px !important;
    resize: none;
    padding: 16px 15px 16px 0 !important;
    color: #000;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    font-family: "Poppins", sans-serif !important;
}

#chatbot-widget .chat-input span {
    align-items: center;
    height: 55px;
    line-height: 55px;
    color: #000000;
    font-size: 22px !important; 
    cursor: pointer;
    visibility: hidden !important;
}

#chatbot-widget .chat-input textarea:valid ~ span {
    visibility: visible !important;
}

#chatbot-widget .chatbox .incoming {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    margin: 20px 20px 20px 0;
    width: 100%;
}

#chatbot-widget .material-symbols-outlined {
  font-family: 'Material Symbols Outlined', sans-serif !important;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
  font-size: 26px; /* eller 36px för större */
  line-height: 1;
}

#chatbot-widget .chatbot-toggler span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px; /* eller 28px om du vill ha mindre ikon */
  line-height: 1;
  pointer-events: none;
}
#chatbot-widget.show-chatbot .chatbot header span {
  display: block;
}


#chatbot-widget textarea {
  all: unset;
  display: block; /* 👈 detta behövs */
  height: 55px !important;
}


@media (max-width: 490px) {
    #chatbot-widget .chatbot {
        right: 5% !important;
        bottom: 100px !important;
        width: 80% !important;
        height: 70vh !important;
        max-height: none !important;
        border-radius: 12px !important;
    }

    #chatbot-widget .chatbot .chatbox {
        padding: 20px 10px 80px 10px !important;
    }


    #chatbot-widget .chatbox .outgoing {
        display: flex !important;
        justify-content: flex-end !important;
        width: 100% !important;
        margin: 20px 3px 20px 10px !important;
    }

    #chatbot-widget .chatbox .incoming span {
        margin-right: 5px !important;
        flex-shrink: 0 !important;
        margin-left: 0 !important;
    }

    #chatbot-widget .chatbox .incoming {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
        width: 100% !important;
    }

    #chatbot-widget .chatbot .chat-input {
        padding: 5px 10px;
    }

    #chatbot-widget .chatbot-toggler {
        right: 20px;
    }

    #chatbot-widget .chat-disclaimer {
    font-size: 8px !important;
    padding: 1px 0 0 0;
    }

    #chatbot-widget .chatbot header h2 {
        font-size: 20px !important;
        font-weight: 500 !important;
    }

    #chatbot-widget .chatbox .incoming p {
    max-width: calc(100% - 40px) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    }

    #chatbot-widget .chatbox .outgoing p {
        max-width: calc(100% - 40px) !important;
        margin: 0 10px 0 10px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }
}
