/* Style for the Chatbot Widget */
#marketing-chatbot-root {
    position: fixed;
    bottom: 1.5rem;
    /* bottom-6 */
    z-index: 50;
    /* z-50 */
    max-width: 90vw;
    max-height: 95vh;
}

/* Base button style (for the toggle button) */
#marketing-chatbot-root .chatbot-toggle-button {
    position: relative;
    color: white;
    /* text-white */
    border-radius: 9999px;
    /* rounded-full */
    padding: 1rem;
    /* p-4 */
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    /* shadow-2xl */
    transition: all 0.3s ease-in-out;
    /* transition-all duration-300 */
    cursor: pointer;
}

#marketing-chatbot-root .chatbot-toggle-button:hover {
    transform: scale(1.1);
    /* hover:scale-110 */
}

/* Online indicator dot */
#marketing-chatbot-root .online-dot {
    position: absolute;
    top: -0.25rem;
    /* -top-1 */
    right: -0.25rem;
    /* -right-1 */
    width: 0.75rem;
    /* w-3 */
    height: 0.75rem;
    /* h-3 */
    background-color: #4ade80;
    /* bg-green-400 */
    border-radius: 9999px;
    /* rounded-full */
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* Tooltip on hover */
#marketing-chatbot-root .tooltip {
    position: absolute;
    top: -3rem;
    /* -top-12 */
    right: 0;
    background-color: #1f2937;
    /* bg-gray-900 */
    color: white;
    padding: 0.5rem 1rem;
    /* px-4 py-2 */
    border-radius: 0.5rem;
    /* rounded-lg */
    font-size: 0.875rem;
    /* text-sm */
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

#marketing-chatbot-root .chatbot-toggle-button:hover .tooltip {
    opacity: 1;
}

/* Chat window container */
#marketing-chatbot-root .chatbot-window {
    width: 24rem;
    /* w-96 */
    height: 600px;
    /* h-[600px] */
    background-color: white;
    border-radius: 1rem;
    /* rounded-2xl */
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    /* border border-gray-200 */
}

/* Header */
#marketing-chatbot-root .chatbot-header {
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#marketing-chatbot-root .header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* gap-3 */
}

#marketing-chatbot-root .avatar-container {
    position: relative;
}

#marketing-chatbot-root .avatar {
    width: 2.5rem;
    /* w-10 */
    height: 2.5rem;
    /* h-10 */
    background-color: white;
    border-radius: 9999px;
    /* rounded-full */
    display: flex;
    align-items: center;
    justify-content: center;
}

#marketing-chatbot-root .avatar-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #4ade80;
    border-radius: 9999px;
    border: 2px solid white;
}

#marketing-chatbot-root .header-title {
    font-weight: bold;
    font-size: 1.125rem;
    /* text-lg */
    color: white;
}

#marketing-chatbot-root .header-subtitle {
    font-size: 0.75rem;
    /* text-xs */
    opacity: 0.9;
}

#marketing-chatbot-root .header-buttons {
    display: flex;
    gap: 0.5rem;
    /* gap-2 */
}

#marketing-chatbot-root .header-buttons button {
    background: none;
    border: none;
    color: white;
    padding: 0.375rem;
    /* p-1.5 */
    border-radius: 0.5rem;
    /* rounded-lg */
    transition: background-color 0.15s;
    cursor: pointer;
}

#marketing-chatbot-root .header-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    /* hover:bg-white/20 */
}

/* Messages area */
#marketing-chatbot-root .chatbot-messages {
    flex: 1;
    /* flex-1 */
    overflow-y: auto;
    padding: 1rem;
    /* p-4 */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* space-y-4 */
    background-color: #f9fafb;
    /* bg-gray-50 */
}

#marketing-chatbot-root .message-container {
    display: flex;
}

#marketing-chatbot-root .message-user {
    justify-content: flex-end;
    /* justify-end */
}

#marketing-chatbot-root .message-assistant {
    justify-content: flex-start;
    /* justify-start */
}

#marketing-chatbot-root .message-content-wrapper {
    max-width: 80%;
    /* max-w-[80%] */
}

#marketing-chatbot-root .message-user .message-content-wrapper {
    order: 2;
    /* order-2 */
}

#marketing-chatbot-root .message-assistant .message-content-wrapper {
    order: 1;
    /* order-1 */
}

#marketing-chatbot-root .message-bubble {
    border-radius: 1rem;
    /* rounded-2xl */
    padding: 0.75rem 1rem;
    /* px-4 py-3 */
    font-size: 0.875rem;
    /* text-sm */
    line-height: 1.5;
    /* leading-relaxed */
    white-space: pre-line;
}

#marketing-chatbot-root .message-user .message-bubble {
    color: white;
    border-bottom-right-radius: 0;
    /* rounded-br-none */
}

#marketing-chatbot-root .message-assistant .message-bubble {
    background-color: white;
    color: #1f2937;
    /* text-gray-800 */
    border-bottom-left-radius: 0;
    /* rounded-bl-none */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    /* shadow-md */
}

/* Markdown formatting styles */
#marketing-chatbot-root .message-bubble strong {
    font-weight: 700;
    color: inherit;
}

#marketing-chatbot-root .message-bubble em {
    font-style: italic;
    color: inherit;
}

#marketing-chatbot-root .message-bubble code {
    background-color: #f3f4f6;
    color: #dc2626;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

#marketing-chatbot-root .message-user .message-bubble code {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

#marketing-chatbot-root .message-bubble a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

#marketing-chatbot-root .message-bubble a:hover {
    color: #1d4ed8;
}

#marketing-chatbot-root .message-user .message-bubble a {
    color: #fff;
    text-decoration: underline;
}

#marketing-chatbot-root .message-user .message-bubble a:hover {
    opacity: 0.8;
}

#marketing-chatbot-root .message-timestamp {
    font-size: 0.75rem;
    /* text-xs */
    color: #6b7280;
    /* text-gray-500 */
    margin-top: 0.25rem;
    /* mt-1 */
}

#marketing-chatbot-root .message-user .message-timestamp {
    text-align: right;
}

#marketing-chatbot-root .message-assistant .message-timestamp {
    text-align: left;
}

/* Typing indicator */
#marketing-chatbot-root .typing-indicator .dot {
    width: 0.5rem;
    /* w-2 */
    height: 0.5rem;
    /* h-2 */
    background-color: #9ca3af;
    /* bg-gray-400 */
    border-radius: 9999px;
    animation: bounce 1.4s infinite ease-in-out both;
}

#marketing-chatbot-root .typing-indicator .dot:nth-child(2) {
    animation-delay: -0.16s;
}

#marketing-chatbot-root .typing-indicator .dot:nth-child(3) {
    animation-delay: -0.32s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* Quick Actions */
#marketing-chatbot-root .quick-actions-container {
    padding: 0.75rem 1rem;
    /* px-4 py-3 */
    background-color: white;
    border-top: 1px solid #e5e7eb;
    /* border-t border-gray-200 */
}

#marketing-chatbot-root .quick-actions-label {
    font-size: 0.75rem;
    /* text-xs */
    color: #4b5563;
    /* text-gray-600 */
    margin-bottom: 0.5rem;
    /* mb-2 */
    font-weight: 500;
    /* font-medium */
}

#marketing-chatbot-root .quick-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    /* gap-2 */
}

#marketing-chatbot-root .quick-action-button {
    font-size: 0.75rem;
    /* text-xs */
    padding: 0.375rem 0.75rem;
    /* px-3 py-1.5 */
    border-radius: 9999px;
    /* rounded-full */
    transition: background-color 0.15s, color 0.15s;
    border: 1px solid;
    cursor: pointer;
}

/* Input Area */
#marketing-chatbot-root .chatbot-input-area {
    padding: 1rem;
    /* p-4 */
    background-color: white;
    border-top: 1px solid #e5e7eb;
    /* border-t border-gray-200 */
    display: flex;
    gap: 0.5rem;
    /* gap-2 */
}

#marketing-chatbot-root .chatbot-input {
    flex: 1;
    /* flex-1 */
    padding: 0.75rem 1rem;
    /* px-4 py-3 */
    border: 1px solid #d1d5db;
    /* border border-gray-300 */
    border-radius: 0.75rem;
    /* rounded-xl */
    outline: none;
    /* focus:outline-none */
    font-size: 0.875rem;
    /* text-sm */
    color: #0c1521;
    /* Custom focus style to replicate focus:ring-2 focus:border-transparent */
}

#marketing-chatbot-root .chatbot-input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--primary-color, #9333ea);
}


#marketing-chatbot-root .send-button {
    color: white;
    padding: 0.75rem;
    /* p-3 */
    border-radius: 0.75rem;
    /* rounded-xl */
    transition: all 0.3s ease-in-out;
    border: none;
    cursor: pointer;
}

#marketing-chatbot-root .send-button:hover:not(:disabled) {
    transform: scale(1.05);
    /* hover:scale-105 */
}

#marketing-chatbot-root .send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Utility for hiding */
.hidden {
    display: none !important;
}

/* Utility for dynamic positioning */
.position-right {
    right: 1.5rem;
    /* right-6 */
}

.position-left {
    left: 1.5rem;
    /* left-6 */
}
