:root {
    --primary-gradient: var(--primary-color);
    --chat-width: 450px;
    --chat-height: 85%;
    --header-height: 56px;
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

#chatbot-popup {
    display: none;
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: var(--chat-width);
    height: var(--chat-height);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 18px 40px -5px rgba(0, 0, 0, 0.2),
        0 15px 20px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    transform-origin: bottom right;
    transform: scale(0.95);
    transition: all var(--transition-speed) ease-in-out;
    z-index: 999;
}

#chatbot-popup.visible {
    display: block;
    opacity: 1;
    transform: scale(1);
}

#chatbot-header {
    background: var(--primary-color);
    padding: 16px 20px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--header-textColor);

    .header-title {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 16px;
        font-weight: 500;
    }

    .header-buttons {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .icon-button {
        background: none;
        border: none;
        color: var(--header-textColor);
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .icon-button:hover {
        color: var(--header-textColor);
    }

    .icon-button:focus {
        outline: 2px solid white;
        outline-offset: 2px;
    }
}

#webchat {
    height: calc(100% - var(--header-height));
    background-color: #f9fafb;
    position: relative;
}

#webchat>div {
    position: relative;
    z-index: 2;
}

#webchat .webchat__basic-transcript__content {
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

#webchat .webchat__bubble__content {
    padding: 8px 12px !important;
}

#webchat .webchat__bubble {
    max-width: 85% !important;
    margin: 8px !important;
}

#webchat .webchat__basic-transcript__content ul,
#webchat .webchat__basic-transcript__content ol,
#webchat .webchat__bubble__content ul,
#webchat .webchat__bubble__content ol {
    padding-left: 24px !important;
    margin: 8px 0 !important;
    list-style-position: outside !important;
}

#webchat .webchat__basic-transcript__content li,
#webchat .webchat__bubble__content li {
    margin: 4px 0 !important;
    padding-left: 4px !important;
}
#webchat .webchat__suggested-action {
  font-size: 14px;
}

#open-chat {
    position: fixed;
    bottom: 32px;
    right: 20px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 9px 10px 0 #1f68a7;
    transition: all var(--transition-speed) ease-in-out;
    z-index: 998;
}

#open-chat.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    pointer-events: none;
}

#open-chat:hover {
    transform: translateY(-4px);
}

#open-chat:focus {
    outline: 3px solid black;
    outline-offset: 2px;
}

#open-chat svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: transform 0.2s ease;
}

@media (max-width: 768px) {
    #chatbot-popup {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

.cov-dots-animation {
  display: inline-flex;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
}

.cov-dots-animation span {
  width: 12px;
  height: 12px;
  background: #555;
  border-radius: 50%;
  animation: blink 1.4s infinite ease-in-out both;
}

.cov-dots-animation span:nth-child(1) { animation-delay: 0s; }
.cov-dots-animation span:nth-child(2) { animation-delay: 0.2s; }
.cov-dots-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.6); }
  40% { opacity: 1; transform: scale(1); }
}

.webchat__typing-indicator {
  display: none;
}

/* Styles to make it work with other floating buttons */
#backtotop {
    bottom: 110px;
}
