@keyframes alex-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.alex-fade-in {
    opacity: 0;
    animation: alex-fadeIn 0.5s forwards;
}

#alex-chatbot-icon {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
    overflow: hidden;
    z-index: 9999;
    cursor: pointer;
    background-color: #212121;
    border-radius: 50%;
}
#alex-chatbot-icon .alex-icon-mask {
    position: relative;
    width: 100%;
    height: 100%;
}
#alex-chatbot-icon .alex-open-icon,
#alex-chatbot-icon .alex-close-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    transition: transform 0.5s cubic-bezier(.65, .05, 0, 1);
}
#alex-chatbot-icon .alex-open-icon {
    transform: translate(-50%, -50%);
}
#alex-chatbot-icon .alex-close-icon {
    transform: translate(-50%, calc(-50% + 37px));
}
#alex-chatbot-icon.open .alex-open-icon {
    transform: translate(-50%, -200%) scale(1);
}
#alex-chatbot-icon.open .alex-close-icon {
    transform: translate(-50%, -50%);
}
#alex-chatbot-icon .alex-close-icon .alex-line1,
#alex-chatbot-icon .alex-close-icon .alex-line2 {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #f2f3f8;
    top: 50%;
    left: 0;
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(.65, .05, 0, 1);
}
#alex-chatbot-icon .alex-close-icon .alex-line1 {
    transform: rotate(45deg);
}
#alex-chatbot-icon .alex-close-icon .alex-line2 {
    transform: rotate(-45deg);
}

@keyframes alex-rotateLine1 {
    from { transform: rotate(45deg); }
    to { transform: rotate(-45deg); }
}
@keyframes alex-rotateLine2 {
    from { transform: rotate(-45deg); }
    to { transform: rotate(45deg); }
}
#alex-chatbot-icon .alex-close-icon.alex-rotate-animation .alex-line1 {
    animation: alex-rotateLine1 0.5s cubic-bezier(.65, .05, 0, 1) forwards;
}
#alex-chatbot-icon .alex-close-icon.alex-rotate-animation .alex-line2 {
    animation: alex-rotateLine2 0.5s cubic-bezier(.65, .05, 0, 1) forwards;
}

#alex-chatbot-mask {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    overflow: hidden;
    z-index: 9999;
    display: none;
}
@media(max-width:767px) {
  #alex-chatbot-mask {
    right: 16px;
    width: calc(100% - 32px);
  }
}

#alex-chatbot-container {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f2f3f8;
    z-index: 2;
    transform: translateY(100%);
    transition: 0.7s cubic-bezier(.65, .05, 0, 1);
}
#alex-chatbot-container.open {
    transform: translateY(0);
}

#alex-chatbot-header {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #111111;
}
#alex-chatbot-header h3 {
    margin: 0;
}

#alex-chatbot-body-wrapper {
    position: relative;
}
#alex-chatbot-body {
    padding: 10px;
    height: 400px;
    overflow-y: auto;
    background-color: #fff;
}
@media(max-width:767px) {
  #alex-chatbot-body {
    height: 300px;
  }
}

#alex-chatbot-body-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.15), transparent 1%);
    pointer-events: none;
    z-index: 2;
}

#alex-chatbot-form {
    display: flex;
    border-top: 1px solid #111111;
    background-color: #fff;
}
#alex-chatbot-form textarea {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: #f2f3f8;
    resize: none;
}
#alex-chatbot-form textarea:focus { 
    outline: none; 
}
#alex-chatbot-form button {
    padding: 6px 12px;
    border: none;
    background-color: #111111;
    color: #f2f3f8;
    cursor: pointer;
}

.alex-message-wrapper {
    clear: both;
    margin-bottom: 10px;
    max-width: 80%;
    text-align: left;
}
.alex-message-wrapper.alex-user-message {
    float: right;
}
.alex-message-wrapper.alex-bot-message {
    float: left;
}
.alex-message-label {
    font-weight: bold;
    margin-bottom: 2px;
    display: block;
    padding: 0 8px;
}
.alex-bubble {
    background-color: #f1f0f0;
    color: #000;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    position: relative;
    display: block;
}
.alex-message-wrapper.alex-user-message .alex-bubble {
    background-color: #0084ff;
    color: #fff;
    margin-left: auto;
}
.alex-message-wrapper.alex-user-message .alex-message-label {
    text-align: right;
}

.alex-dot {
    display: inline-block;
    vertical-align: middle;
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 3px;
    animation: alex-blink 1s infinite;
    opacity: 0.2;
}
.alex-dot:nth-child(1) { animation-delay: 0s; }
.alex-dot:nth-child(2) { animation-delay: 0.2s; }
.alex-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes alex-blink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}
.alex-message-wrapper.alex-bot-loading {
    max-width: none;
}
.alex-message-wrapper.alex-bot-loading .alex-bubble {
    display: inline-block;
    max-width: 50px;
    max-height: 41px;
    white-space: nowrap;
    width: auto;
}

#alex-chatbot-faq-container {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 0 10px 10px 10px;
    z-index: 3;
}
.alex-faq-title {
    font-weight: bold;
    margin-bottom: 2px;
    display: block;
    padding: 0 8px;
    text-align: left;
    opacity: 0;
    animation: alex-fadeIn 0.5s forwards;
    animation-delay: 0.5s;
}
#alex-chatbot-suggestions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.alex-suggestion-bubble {
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 8px 12px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    opacity: 0;
    animation: alex-fadeIn 0.5s forwards;
}
#alex-chatbot-suggestions .alex-suggestion-bubble:nth-child(1) {
    animation-delay: 0.5s;
}
#alex-chatbot-suggestions .alex-suggestion-bubble:nth-child(2) {
    animation-delay: 0.6s;
}
#alex-chatbot-suggestions .alex-suggestion-bubble:nth-child(3) {
    animation-delay: 0.7s;
}
.alex-suggestion-bubble:hover {
    background-color: #f2f3f8;
}

#alex-chatbot-bubble {
    position: fixed;
    bottom: 78px;
    right: 16px;
    background-color: #f2f3f8;
    color: #212121;
    padding: 6px 10px;
    border: 1px solid #212121;
    border-radius: 20px;
    font-size: 14px;
    z-index: 9998;
    white-space: nowrap;
}
#alex-chatbot-bubble::before {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 17px;
    border-width: 7px 7px 0 7px;
    border-style: solid;
    border-color: #212121 transparent transparent transparent;
}
#alex-chatbot-bubble::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 18px;
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #f2f3f8 transparent transparent transparent;
}
#alex-chatbot-icon.open + #alex-chatbot-bubble {
    display: none;
}
.alex-hide-bubble {
    display: none !important;
}

/* Gør links i chatbotten tydelige og klikbare */
#alex-chatbot-body a {
    color: #007BFF; /* eller brug din brand-farve */
    text-decoration: underline;
    transition: color 0.2s ease;
}

#alex-chatbot-body a:hover {
    color: #0056b3;
}

/* Skjul tomme p-tags (som <p></p> eller <p> </p>) */
.alex-bot-text p:empty,
.alex-bot-text p:empty + br,
.alex-bot-text p:empty + br + br {
    display: none;
}

/* Skjul dobbelte br-tags */
.alex-bot-text br + br {
    display: none;
}

/* Justér spacing mellem p-tags */
.alex-bot-text p {
    margin-bottom: 0.6em;
    margin-top: 0;
}


/* Fjern margin-top hvis for meget luft der */
.alex-bot-text p:first-child {
    margin-top: 0;
}


