/**
 * MenStyle AI Chatbot Styles
 */

/* Floating Chat Button - Always Visible */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 15px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 99999;
    transition: all 0.3s ease;
    border: none;
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.chatbot-toggle i {
    color: white;
    font-size: 22px;
}

/* Chat Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    display: none;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 60px);
    height: 500px;
    max-height: calc(100vh - 150px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.chatbot-window.active {
    display: flex;
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar i {
    color: #667eea;
    font-size: 20px;
}

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

.chatbot-title p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

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

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

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message.bot {
    flex-direction: row;
}

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

.chatbot-avatar-mini {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-message.bot .chatbot-avatar-mini {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chatbot-message.user .chatbot-avatar-mini {
    background: #ddd;
    color: #666;
}

.chatbot-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.chatbot-message.bot .chatbot-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    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);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background: white;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: #667eea;
    color: white;
}

/* Chat Input */
.chatbot-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive - FORCE VISIBLE */
@media (max-width: 768px) {
    .chatbot-toggle {
        position: fixed !important;
        bottom: 15px !important;
        right: 10px !important;
        width: 50px !important;
        height: 50px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 99999 !important;
    }
    
    .chatbot-toggle i {
        font-size: 20px !important;
    }

    .chatbot-window {
        bottom: 75px !important;
        right: 10px !important;
        left: 10px !important;
        width: calc(100% - 20px) !important;
        height: 70vh !important;
        max-height: 450px !important;
        z-index: 99998 !important;
    }

    .chatbot-message-content {
        max-width: 85% !important;
        font-size: 14px !important;
    }
    
    .chatbot-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .chatbot-toggle {
        width: 48px !important;
        height: 48px !important;
        bottom: 10px !important;
        right: 8px !important;
    }
    
    .chatbot-toggle i {
        font-size: 18px !important;
    }
    
    .chatbot-window {
        height: 75vh !important;
        bottom: 65px !important;
    }
    
    .chatbot-header h3 {
        font-size: 14px !important;
    }
    
    .chatbot-message-content {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
}

/* Ensure chatbot is never hidden */
.chatbot-toggle {
    display: flex !important;
    visibility: visible !important;
}
