/* ====================================
   AI CHATBOT STYLES
   ==================================== */

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 110px;  /* Positioned above WhatsApp button */
    right: 30px;
    z-index: 1000;
}

/* Chatbot Toggle Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    animation: pulse 2s infinite;
}

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

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 190px;  /* Positioned above the chatbot button */
    right: 30px;
    width: 380px;
    height: 550px;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* Chatbot Header */
.chatbot-header {
    background: var(--gradient-1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: white;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(168, 85, 247, 0.1);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 3px;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
    background: var(--gradient-1);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.bot {
    align-self: flex-start;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: var(--text-light);
    border-bottom-left-radius: 5px;
}

.message.bot.typing {
    padding: 16px 20px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Input Container */
.chatbot-input-container {
    padding: 20px;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 25px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 16px;  /* Prevents zoom on iOS */
    outline: none;
    transition: all 0.3s;
}

.chatbot-input:focus {
    border-color: var(--accent-cyan);
    background: rgba(168, 85, 247, 0.1);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: var(--gradient-1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 110px;  /* Keep above WhatsApp on mobile */
    }

    .chatbot-window {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 190px;  /* Above chatbot button on mobile */
        height: 500px;
    }
}