/**
 * myID Africa AI Chatbot Styles
 * Professional, modern chatbot interface
 */

.myid-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

/* Toggle Button */
.chatbot-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16424a 0%, #1d5661 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22, 66, 74, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(22, 66, 74, 0.5);
}

.chatbot-avatar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF5722;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chat Window */
.chatbot-window {
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #16424a 0%, #1d5661 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header-info {
    flex: 1;
    color: white;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.chatbot-status {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-close-btn:hover {
    opacity: 1;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Message */
.chatbot-message {
    display: flex;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message--user {
    justify-content: flex-end;
}

.chatbot-message--bot {
    justify-content: flex-start;
}

.message-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.chatbot-message--bot .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.chatbot-message--user .message-bubble {
    background: #16424a;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message-bubble strong {
    font-weight: 600;
    color: #16424a;
}

.chatbot-message--user .message-bubble strong {
    color: #FFF;
}

.message-bubble code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message-bubble ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 4px 0;
}

/* Typing Indicator */
.typing-indicator .message-bubble {
    padding: 12px 20px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Message Feedback */
.message-feedback {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.feedback-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    font-size: 12px;
}

.feedback-btn:hover {
    background: #16424a;
    color: white;
    border-color: #16424a;
}

.feedback-thanks {
    color: #4CAF50;
    font-weight: 500;
}

/* Related Questions */
.related-questions {
    margin-top: 12px;
}

.related-questions p {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
}

.related-question-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #16424a;
    transition: all 0.2s;
}

.related-question-btn:hover {
    background: #16424a;
    color: white;
    border-color: #16424a;
}

.related-question-btn i {
    font-size: 10px;
    margin-right: 6px;
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.chatbot-quick-actions::-webkit-scrollbar {
    height: 4px;
}

.chatbot-quick-actions::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.quick-action-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    color: #333;
}

.quick-action-btn:hover {
    background: #16424a;
    color: white;
    border-color: #16424a;
}

.quick-action-btn i {
    font-size: 10px;
    margin-right: 4px;
}

/* Input Area */
.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #16424a;
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #16424a;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send-btn:hover {
    background: #1d5661;
    transform: scale(1.05);
}

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

/* Footer */
.chatbot-footer {
    padding: 8px 16px;
    background: #f9f9f9;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.chatbot-footer small {
    color: #999;
    font-size: 11px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        right: 16px;
        bottom: 16px;
    }

    .message-content {
        max-width: 85%;
    }
}
