/* Panda Chatbot Styles */
.panda-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; /* Ensure it's above all other elements */
    font-family: 'Arial', sans-serif;
    pointer-events: none; /* Allow clicks to pass through the container */
    display: block !important; /* Force display */
    visibility: visible !important; /* Ensure visibility */
    opacity: 1 !important; /* Ensure opacity */
}

/* But make the button and window clickable */
.panda-chatbot-toggle,
.panda-chatbot-window {
    pointer-events: auto;
}

/* Chatbot toggle button */
.panda-chatbot-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(52, 152, 219, 0.5);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    opacity: 1 !important;
    visibility: visible !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
}

.panda-chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Chatbot window */
.panda-chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
}

.panda-chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chatbot header */
.panda-chatbot-header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panda-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.panda-chatbot-header h3 span {
    margin-left: 8px;
}

.panda-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}

/* Chatbot messages area */
.panda-chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.panda-message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.panda-message.bot {
    background-color: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border-radius: 18px 18px 18px 0;
}

.panda-message.user {
    background-color: #4CAF50;
    color: white;
    align-self: flex-end;
    border-radius: 18px 18px 0 18px;
}

/* Typing indicator styles */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #888;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    opacity: 0.4;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Chatbot input area */
.panda-chatbot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

.panda-chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    outline: none;
    font-size: 14px;
}

.panda-chatbot-input input:focus {
    border-color: #3498db;
}

.panda-chatbot-send {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.panda-chatbot-send:hover {
    background-color: #2980b9;
}

/* Responsive styles */
@media (max-width: 576px) {
    .panda-chatbot-window {
        width: 300px;
        height: 400px;
        bottom: 60px;
    }
    
    .panda-chatbot-toggle {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .panda-chatbot-window {
        width: 280px;
        right: 0;
    }
}