/* ===== PIPANI ADVERTISING CHATBOT THEME (CORPORATE RED & WHITE) ===== */

.chatbot-button {
    position: fixed;
    right: 22px;
    bottom: 76px;

    width: 44px;
    height: 44px;

    border: none;
    border-radius: 0;

    background: transparent;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 9999;

    box-shadow: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), filter 0.25s ease;
}

.chatbot-button:hover {
    transform: scale(1.15);
    background: transparent;
    box-shadow: none;
}

.chatbot-button:active {
    transform: scale(0.95);
}

.bot-face-svg {
    stroke: #111827;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
    transition: transform 0.25s ease, filter 0.25s ease;
    display: block;
}

.chatbot-button:hover .bot-face-svg {
    stroke: #000000;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}


/* ===== CHATBOT CONTAINER ===== */

.chatbot-container {
    position: fixed;

    right: 22px;
    bottom: 76px;

    width: 360px;
    height: 470px;
    max-height: calc(100vh - 90px);

    background: #ffffff;

    border-radius: 16px;

    overflow: hidden;

    display: none;
    flex-direction: column;

    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(230, 26, 39, 0.12);

    z-index: 10000;

    font-family: 'Inter', sans-serif;
}

.chatbot-container.active {
    display: flex;
}


/* ===== HEADER ===== */

.chatbot-header {
    background: linear-gradient(135deg, #E61A27 0%, #B3121D 100%);
    color: #ffffff;

    padding: 14px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);

    border: none;

    color: #ffffff;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;

    cursor: pointer;

    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
}


/* ===== MESSAGES AREA ===== */

.chatbot-messages {
    flex: 1;

    padding: 16px;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 12px;

    background: #F9FAFB;
}


/* Custom scrollbar */

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #E5E7EB;
    border-radius: 4px;
}


/* ===== CHAT MESSAGES ===== */

.chatbot-message {
    max-width: 84%;

    padding: 10px 14px;

    border-radius: 14px;

    font-size: 13.5px;

    line-height: 1.55;

    word-wrap: break-word;

    overflow-wrap: break-word;

    /* Preserve line breaks from chatbot response */
    white-space: pre-line;
}


/* ===== BOT MESSAGE ===== */

.bot-message {
    align-self: flex-start;

    background: #ffffff;

    color: #1F2937;

    border: 1px solid #E5E7EB;

    border-left: 3.5px solid #E61A27;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}


/* ===== USER MESSAGE ===== */

.user-message {
    align-self: flex-end;

    background: linear-gradient(135deg, #E61A27 0%, #B3121D 100%);

    color: #ffffff;

    box-shadow: 0 2px 6px rgba(230, 26, 39, 0.25);

    white-space: pre-line;
}


/* ===== TYPING INDICATOR ===== */

.typing-message {
    display: flex;

    align-items: center;

    gap: 4px;

    min-height: 18px;

    padding-top: 12px;
    padding-bottom: 12px;
}

.typing-message span {
    width: 6px;
    height: 6px;

    background: currentColor;

    border-radius: 50%;

    display: inline-block;

    animation: chatbotTyping 1.4s infinite ease-in-out;
}

.typing-message span:nth-child(1) {
    animation-delay: 0s;
}

.typing-message span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-message span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatbotTyping {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }

}


/* ===== INPUT AREA ===== */

.chatbot-input-area {
    display: flex;

    gap: 8px;

    padding: 12px;

    background: #ffffff;

    border-top: 1px solid #E5E7EB;
}

.chatbot-input-area input {
    flex: 1;

    min-width: 0;

    padding: 10px 13px;

    border: 1px solid #D1D5DB;

    border-radius: 8px;

    outline: none;

    font-size: 13.5px;

    font-family: inherit;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input-area input:focus {
    border-color: #E61A27;

    box-shadow: 0 0 0 3px rgba(230, 26, 39, 0.12);
}

.chatbot-input-area button {
    padding: 10px 16px;

    border: none;

    border-radius: 8px;

    background: linear-gradient(135deg, #E61A27 0%, #B3121D 100%);

    color: #ffffff;

    font-weight: 600;

    cursor: pointer;

    font-size: 13.5px;

    font-family: inherit;

    box-shadow: 0 2px 6px rgba(230, 26, 39, 0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.chatbot-input-area button:hover {
    opacity: 0.92;

    transform: translateY(-1px);

    box-shadow: 0 4px 10px rgba(230, 26, 39, 0.35);
}

.chatbot-input-area button:active {
    transform: translateY(0);
}

.chatbot-input-area button:disabled {
    background: #9CA3AF;

    box-shadow: none;

    cursor: not-allowed;

    opacity: 0.7;
}


/* ===== MOBILE RESPONSIVENESS ===== */

@media (max-width: 500px) {

    .chatbot-container {
        right: 12px;

        bottom: 74px;

        width: calc(100% - 24px);

        height: 72vh;

        max-height: 480px;
    }

    .chatbot-button {
        right: 18px;

        bottom: 74px;

        width: 42px;

        height: 42px;
    }

}