/* ===== M3GAN AI ASSISTANT CHATBOT ===== */

.m3gan-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.m3gan-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    transition: all 0.3s ease;
    animation: pulse-glow 2s ease-in-out infinite;
    position: relative;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 50px rgba(102, 126, 234, 0.8);
        transform: scale(1.05);
    }
}

.m3gan-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 0 60px rgba(102, 126, 234, 1);
}

.m3gan-trigger.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 0 60px rgba(240, 147, 251, 0.8);
}

/* M3GAN Chat Window */
.m3gan-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.95), rgba(20, 20, 50, 0.95));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5), 0 0 60px rgba(102, 126, 234, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.m3gan-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* M3GAN Header */
.m3gan-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(240, 147, 251, 0.1));
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.m3gan-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.m3gan-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.m3gan-header-title h3 {
    color: #ffffff;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.m3gan-header-title p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-size: 12px;
}

.m3gan-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.m3gan-close:hover {
    background: rgba(240, 147, 251, 0.3);
    transform: rotate(90deg);
}

/* M3GAN Messages */
.m3gan-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.m3gan-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.m3gan-message.user {
    justify-content: flex-end;
}

.m3gan-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.m3gan-message.assistant .m3gan-bubble {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(100, 200, 255, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.m3gan-message.user .m3gan-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

.m3gan-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.m3gan-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.8);
    animation: typing 1.4s infinite;
}

.m3gan-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.m3gan-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* M3GAN Input */
.m3gan-input-area {
    padding: 15px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 20px 20px;
}

.m3gan-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.m3gan-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.m3gan-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.m3gan-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

.m3gan-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.6);
}

.m3gan-send:active {
    transform: translateY(0);
}

/* Scrollbar styling for messages */
.m3gan-messages::-webkit-scrollbar {
    width: 6px;
}

.m3gan-messages::-webkit-scrollbar-track {
    background: transparent;
}

.m3gan-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

.m3gan-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .m3gan-window {
        width: calc(100% - 40px);
        height: 500px;
        bottom: 80px;
        right: -200px;
    }

    .m3gan-window.active {
        right: 0;
    }

    .m3gan-trigger {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .m3gan-bubble {
        max-width: 85%;
    }

    .m3gan-header-title h3 {
        font-size: 15px;
    }

    .m3gan-header-title p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .m3gan-assistant {
        bottom: 15px;
        right: 15px;
    }

    .m3gan-window {
        width: calc(100% - 30px);
        height: 450px;
        bottom: 65px;
    }

    .m3gan-trigger {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .m3gan-messages {
        padding: 15px;
    }

    .m3gan-input-area {
        padding: 12px;
        gap: 8px;
    }

    .m3gan-input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .m3gan-send {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Quick replies */
.m3gan-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
}

.m3gan-quick-reply {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.m3gan-quick-reply:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
    color: #ffffff;
}
