/* EmnekLMS Chatbot Styles - EMNEK AI Assistant */

/* Floating bubble with label */
.chatbot-bubble-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.chatbot-bubble-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: chatbot-label-pulse 2s ease-in-out infinite;
    letter-spacing: 0.3px;
}

.chatbot-bubble {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.chatbot-bubble::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: chatbot-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    opacity: 0;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.7);
}

.chatbot-bubble svg {
    width: 32px;
    height: 32px;
    fill: white;
    position: relative;
    z-index: 1;
}

/* Sparkle/flash indicator */
.chatbot-sparkle {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ff6b6b;
    border-radius: 50%;
    border: 3px solid white;
    animation: chatbot-flash 1s ease-in-out infinite;
    z-index: 2;
}

@keyframes chatbot-ping {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes chatbot-flash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes chatbot-label-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7); }
}

/* Chat Panel */
.chatbot-panel {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 400px;
    height: 550px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chatbot-panel.open {
    display: flex;
    animation: chatbot-slide-up 0.3s ease-out;
}

@keyframes chatbot-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 22px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.3px;
}

.chatbot-header-icon {
    width: 26px;
    height: 26px;
    fill: white;
}

.chatbot-header-badge {
    font-size: 10px;
    background: rgba(255,255,255,0.25);
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 500;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chatbot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.chatbot-message.user {
    align-self: flex-end;
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.assistant {
    align-self: flex-start;
    background: #f0f2f5;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.chatbot-message.assistant p {
    margin: 0 0 8px 0;
}

.chatbot-message.assistant p:last-child {
    margin-bottom: 0;
}

.chatbot-message.assistant ul,
.chatbot-message.assistant ol {
    margin: 4px 0;
    padding-left: 20px;
}

.chatbot-message.assistant strong {
    font-weight: 600;
}

.chatbot-message.error {
    align-self: center;
    background: #fee;
    color: #c00;
    font-size: 13px;
    text-align: center;
}

.chatbot-typing {
    align-self: flex-start;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 14px;
    display: none;
    margin: 0 18px;
}

.chatbot-typing.visible {
    display: flex;
    gap: 5px;
    align-items: center;
}

.chatbot-typing span {
    width: 9px;
    height: 9px;
    background: #999;
    border-radius: 50%;
    animation: chatbot-bounce 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.chatbot-input-area {
    padding: 14px 18px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e8e8e8;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.chatbot-send:hover {
    background: #5a6fd6;
    transform: scale(1.05);
}

.chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 130px);
        bottom: 100px;
        right: 8px;
        border-radius: 12px;
    }

    .chatbot-bubble-wrapper {
        bottom: 16px;
        right: 16px;
    }

    .chatbot-bubble {
        width: 60px;
        height: 60px;
    }

    .chatbot-bubble-label {
        display: none;
    }
}
