﻿9.73 KB •505 lines
•
Formatting may be inconsistent from source
/* ChatBot Styles - Clean and Mobile-First */
/* Base chatbot widget container */
.chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    bottom: 20px;
    right: 20px;
    max-width: calc(100vw - 40px);
}

/* Toggle button */
.chatbot-toggle {
    width: 66px;
    height: 66px;
    background: #e53e3e;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

    .chatbot-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(229, 62, 62, 0.6);
    }

/* Speech bubble */
.speech-bubble {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #e53e3e;
    border-radius: 18px;
    padding: 8px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
    white-space: nowrap;
    animation: speechPulse 3s ease-in-out infinite;
}

    .speech-bubble.show {
        opacity: 1;
        visibility: visible;
    }

.speech-content {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.speech-tail {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #e53e3e;
}

    .speech-tail::after {
        content: '';
        position: absolute;
        right: 2px;
        top: -6px;
        width: 0;
        height: 0;
        border: 6px solid transparent;
        border-left-color: white;
    }

/* Chat window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom right;
}

    .chatbot-window.open {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

/* Header */
.chatbot-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-title {
    display: flex;
    flex-direction: column;
}

.chatbot-name {
    font-weight: 600;
    font-size: 14px;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-minimize {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

    .chatbot-minimize:hover {
        background: rgba(255, 255, 255, 0.1);
    }

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    .chatbot-messages::-webkit-scrollbar {
        width: 4px;
    }

    .chatbot-messages::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .chatbot-messages::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }

.message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-in;
}

    .message.user {
        justify-content: flex-end;
    }

    .message.bot {
        justify-content: flex-start;
    }

.message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.message.user .message-content {
    background: #e53e3e;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: #f1f3f5;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chatbot-typing {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #e53e3e;
        animation: typing 1.4s infinite ease-in-out;
    }

        .typing-indicator span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: -0.16s;
        }

/* Input area */
.chatbot-input-area {
    padding: 16px;
    border-top: 1px solid #eee;
}

.chatbot-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

    .chatbot-input:focus {
        border-color: #e53e3e;
    }

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .chatbot-send-btn:hover:not(:disabled) {
        background: #c53030;
        transform: scale(1.05);
    }

    .chatbot-send-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        transform: none;
    }

/* Utility classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes speechPulse {
    0%, 70%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    75%, 85% {
        opacity: 0.7;
        transform: translateY(-50%) scale(1.05);
    }
}

/* Alex avatar animations */
.alex-avatar-toggle {
    animation: alexToggleBounce 2s ease-in-out infinite;
}

.alex-toggle-head {
    animation: alexToggleNod 3s ease-in-out infinite;
    transform-origin: 60px 45px;
}

.alex-toggle-dots circle {
    animation: alexToggleBlink 2s ease-in-out infinite;
}

    .alex-toggle-dots circle:nth-child(1) {
        animation-delay: 0s;
    }

    .alex-toggle-dots circle:nth-child(2) {
        animation-delay: 0.4s;
    }

    .alex-toggle-dots circle:nth-child(3) {
        animation-delay: 0.8s;
    }

    .alex-toggle-dots circle:nth-child(4) {
        animation-delay: 1.2s;
    }

    .alex-toggle-dots circle:nth-child(5) {
        animation-delay: 1.6s;
    }

@keyframes alexToggleBounce {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-3px) scale(1.05);
    }
}

@keyframes alexToggleNod {
    0%, 90%, 100% {
        transform: rotate(0deg);
    }

    45% {
        transform: rotate(2deg);
    }
}

@keyframes alexToggleBlink {
    0%, 80%, 100% {
        opacity: 1;
    }

    85%, 90% {
        opacity: 0.3;
    }
}

/* Thinking animations */
.alex-thinking {
    animation: alexThinking 2s ease-in-out infinite;
}

.thinking-eye {
    animation: thinkingEyeMove 3s ease-in-out infinite;
}

.thinking-dots circle {
    animation: thinkingDotsPulse 1.5s ease-in-out infinite;
}

    .thinking-dots circle:nth-child(1) {
        animation-delay: 0s;
    }

    .thinking-dots circle:nth-child(2) {
        animation-delay: 0.3s;
    }

    .thinking-dots circle:nth-child(3) {
        animation-delay: 0.6s;
    }

@keyframes alexThinking {
    0%, 100% {
        transform: rotate(-2deg) scale(1);
    }

    50% {
        transform: rotate(2deg) scale(1.02);
    }
}

@keyframes thinkingEyeMove {
    0%, 70%, 100% {
        transform: translateX(0px);
    }

    35% {
        transform: translateX(1px);
    }
}

@keyframes thinkingDotsPulse {
    0%, 60%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }

    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* RESPONSIVE DESIGN - Mobile First */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
        max-width: calc(100vw - 30px);
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        max-width: 350px;
        height: calc(100vh - 150px);
        max-height: 500px;
        right: 0;
    }

    .speech-bubble {
        left: 50px; /* Now positioned to the right of the bot */
        right: auto; /* Cancels the right positioning */
        font-size: 11px;
        padding: 6px 10px;
        width: fit-content; /* keep it readable */
    }
}

/* Move chatbot much further left on small phones */
@media (max-width: 768px) {
    .chatbot-widget {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90%; /* keep it readable */
    }

    .chatbot-window {
        right: -10px; /* Extends slightly beyond toggle */
        width: calc(100vw - 10px); /* Adjust width accordingly */
    }
}
