/* MK Asistan Chatbot Styles */
.mk-chatbot-widget {
    --chatbot-color: #6366f1;
    --chatbot-color-light: #818cf8;
    --chatbot-color-dark: #4f46e5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 9999;
}

/* Chat Button */
.mk-chatbot-button {
    position: fixed;
    width: 60px;
    height: 60px;
    background: var(--chatbot-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.mk-chatbot-button.bottom-left {
    bottom: 90px;
    left: 20px;
}

.mk-chatbot-button.bottom-right {
    bottom: 90px;
    right: 20px;
}

.mk-chatbot-button:hover {
    background: var(--chatbot-color-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.mk-chatbot-button.active {
    background: var(--chatbot-color-dark);
}

.mk-chatbot-button-icon,
.mk-chatbot-button-close {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.mk-chatbot-button-close {
    font-size: 20px;
}

/* Chat Window */
.mk-chatbot-window {
    position: fixed;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.mk-chatbot-window.bottom-left {
    bottom: 160px;
    left: 20px;
}

.mk-chatbot-window.bottom-right {
    bottom: 160px;
    right: 20px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .mk-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        max-width: 350px;
        max-height: 500px;
    }
    
    .mk-chatbot-window.bottom-left,
    .mk-chatbot-window.bottom-right {
        left: 20px;
        right: 20px;
        bottom: 90px;
    }
}

/* Chat Header */
.mk-chatbot-header {
    background: var(--chatbot-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mk-chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.mk-chatbot-info {
    flex: 1;
}

.mk-chatbot-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.mk-chatbot-status {
    font-size: 12px;
    opacity: 0.8;
}

.mk-chatbot-minimize {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.mk-chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Area */
.mk-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
}

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

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

.mk-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

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

.mk-chatbot-message.user {
    flex-direction: row-reverse;
}

.mk-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    background: var(--chatbot-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.mk-chatbot-message-content {
    max-width: 80%;
}

.mk-chatbot-message.user .mk-chatbot-message-content {
    text-align: right;
}

.mk-chatbot-message-sender {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.mk-chatbot-message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.mk-chatbot-message.user .mk-chatbot-message-text {
    background: var(--chatbot-color);
    color: white;
}

/* Chatbot Links */
.mk-chatbot-link {
    color: var(--chatbot-color);
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mk-chatbot-link:hover {
    color: var(--chatbot-color-dark);
    text-decoration: none;
}

.mk-chatbot-message.user .mk-chatbot-link {
    color: rgba(255, 255, 255, 0.9);
}

.mk-chatbot-message.user .mk-chatbot-link:hover {
    color: white;
}

.mk-chatbot-message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}

/* Typing Indicator */
.mk-chatbot-typing {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.mk-chatbot-typing span {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

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

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

/* Input Area */
.mk-chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.mk-chatbot-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mk-chatbot-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.mk-chatbot-input-container input:focus {
    border-color: var(--chatbot-color);
}

.mk-chatbot-send-btn {
    width: 40px;
    height: 40px;
    background: var(--chatbot-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-size: 14px;
}

.mk-chatbot-send-btn:hover {
    background: var(--chatbot-color-dark);
}

.mk-chatbot-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Quick Actions */
.mk-chatbot-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mk-chatbot-quick-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mk-chatbot-quick-btn:hover {
    background: var(--chatbot-color);
    color: white;
    border-color: var(--chatbot-color);
}

/* Animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Floating Animation for Chat Button */
@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.mk-chatbot-button {
    animation: floating 3s ease-in-out infinite;
}

.mk-chatbot-button:hover {
    animation: none;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mk-chatbot-window {
        background: #1e293b;
        color: white;
    }
    
    .mk-chatbot-messages {
        background: #0f172a;
    }
    
    .mk-chatbot-message-text {
        background: #334155;
        color: white;
    }
    
    .mk-chatbot-message.user .mk-chatbot-message-text {
        background: var(--chatbot-color);
    }
    
    .mk-chatbot-input-area {
        background: #1e293b;
        border-top-color: #334155;
    }
    
    .mk-chatbot-input-container input {
        background: #334155;
        border-color: #475569;
        color: white;
    }
    
    .mk-chatbot-quick-btn {
        background: #334155;
        color: #cbd5e1;
        border-color: #475569;
    }
    
    .mk-chatbot-typing {
        background: #334155;
    }
}

/* Print Styles */
@media print {
    .mk-chatbot-widget {
        display: none !important;
    }
}