/* Chatbot Styles */
:root {
    --chat-primary: #1a265a;
    --chat-secondary: #00a3b6;
    --chat-accent: #f47920;
    --chat-bg: #ffffff;
    --chat-text: #333333;
}

#j2e-chatbot-container {
    font-family: 'Segoe UI', sans-serif;
    position: fixed;
    bottom: 25px;
    right: 90px;
    /* Left of WhatsApp button */
    z-index: 9999;
}

/* Chat Search Bubble */
.chat-launcher {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 2px solid white;
}

.chat-launcher i {
    color: white;
    font-size: 28px;
}

.chat-launcher:hover {
    transform: scale(1.1);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary), #0d1636);
    padding: 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title h4 {
    margin: 0;
    font-size: 1rem;
}

.chat-title small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-close {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Body */
.chat-body {
    flex: 1;
    background: #f4f7fa;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    background: white;
    color: #333;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user {
    background: var(--chat-secondary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Options/Buttons */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.chat-option-btn {
    background: white;
    border: 1px solid var(--chat-secondary);
    color: var(--chat-secondary);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    font-weight: 500;
}

.chat-option-btn:hover {
    background: var(--chat-secondary);
    color: white;
}

/* Input Area (Hidden typically, used for forms) */
.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.chat-form button {
    width: 100%;
    padding: 10px;
    background: var(--chat-accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Scrollbar */
.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        right: -60px;
        /* Align slightly better on small screens */
        bottom: 70px;
    }
}