﻿/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 50px;
    z-index: 9999;
    font-family: 'Roboto', sans-serif;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

    .chatbot-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(21, 101, 192, 0.5);
    }

    .chatbot-button svg {
        width: 28px;
        height: 28px;
        fill: white;
    }

.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(21, 101, 192, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.chatbot-container {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    z-index: 99;
}

    .chatbot-container.active {
        display: flex;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .chatbot-avatar svg {
        width: 24px;
        height: 24px;
        fill: #1565C0;
    }

.chatbot-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

    .chatbot-close:hover {
        transform: rotate(90deg);
    }

    .chatbot-close svg {
        width: 24px;
        height: 24px;
        stroke: white;
    }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .message-avatar.bot {
        background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    }

    .message-avatar.user {
        background: #E0E0E0;
    }

    .message-avatar svg {
        width: 18px;
        height: 18px;
    }

    .message-avatar.bot svg {
        fill: white;
    }

    .message-avatar.user svg {
        fill: #666;
    }

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.chatbot-message.bot .message-content {
    background: white;
    color: #2C2C2C;
    border-bottom-left-radius: 4px;
}

.chatbot-message.user .message-content {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #E0E0E0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #E0E0E0;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.2s;
}

    .chatbot-input:focus {
        border-color: #1565C0;
    }

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

    .chatbot-send:hover:not(:disabled) {
        transform: scale(1.1);
    }

    .chatbot-send:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .chatbot-send svg {
        width: 20px;
        height: 20px;
        fill: white;
    }

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1565C0;
    animation: typing 1.4s infinite;
}

    .typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        bottom: 60px;
        right: 20px;
        z-index: 99;
    }
}


.chatbot-header {
    position: absolute;
    z-index: 999;
    width: 100%;
    padding: 10px;
}

.chatbot-messages {
    width: 100%;
    height: 370px;
    margin-top: 60px;
    width: 100%;
    overflow-y: auto;
    margin-bottom: 50px;
}


.chatbot-message.user {
    text-align: left;
}

    .chatbot-message.user .message-content {
        background: #007bff;
        color: #fff;
        display: inline-block;
        padding: 8px 12px;
        border-radius: 10px;
        max-width: 80% !important;
    }

.chatbot-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    border-radius: unset;
}

    /* Ô input */
    .chatbot-input input {
        flex: 1;
        border: 1px solid #ddd;
        border-radius: 20px;
        padding: 10px 14px;
        outline: none;
        font-size: 14px;
        transition: all 0.2s ease;
    }

        /* focus đẹp */
        .chatbot-input input:focus {
            border-color: #007bff;
            box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
        }

    /* Button gửi */
    .chatbot-input button {
        background: #007bff;
        color: #fff;
        border: none;
        border-radius: 10px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        /* hover */
        .chatbot-input button:hover {
            background: #0056b3;
            transform: scale(1.05);
        }

        /* click */
        .chatbot-input button:active {
            transform: scale(0.95);
        }
