/* ========================================
   AI CHATBOT - AIRY ASSISTANT
   ======================================== */

#chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

#chatbot-button {
    position: relative;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(53, 118, 89, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

#chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(53, 118, 89, 0.5);
}

#chatbot-button.active {
    background: var(--primary-green);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(53, 118, 89, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(53, 118, 89, 0.6), 0 0 0 15px rgba(53, 118, 89, 0.1);
    }
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar svg {
    width: 100%;
    height: 100%;
    animation: wave 2.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
}

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(53, 118, 89, 0.3);
    min-width: 200px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.4s ease;
}

.chatbot-notification::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.chatbot-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.chatbot-notification span {
    color: var(--dark-gray);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 160px);
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid rgba(53, 118, 89, 0.2);
}

.chatbot-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-avatar-small {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 5px;
}

.chatbot-avatar-small svg {
    width: 100%;
    height: 100%;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
}

.chatbot-status {
    font-size: 0.85rem;
    opacity: 0.95;
    margin: 0;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(53, 118, 89, 0.3);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(53, 118, 89, 0.5);
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    gap: 0.8rem;
    animation: messageSlideIn 0.4s ease;
}

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

.bot-message {
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(53, 118, 89, 0.3);
    padding: 6px;
}

.message-avatar svg {
    width: 100%;
    height: 100%;
}

.message-content {
    max-width: 75%;
    padding: 1rem 1.3rem;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.bot-message .message-content {
    background: white;
    border-bottom-left-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 3px 10px rgba(53, 118, 89, 0.3);
}

.message-content p {
    margin: 0;
    word-wrap: break-word;
}

/* Contact Prompt Buttons */
.contact-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.contact-yes-btn,
.contact-no-btn {
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.contact-yes-btn {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    color: white;
    box-shadow: 0 4px 15px rgba(53, 118, 89, 0.3);
}

.contact-yes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(53, 118, 89, 0.4);
}

.contact-no-btn {
    background: transparent;
    color: var(--dark-gray);
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.contact-no-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.contact-prompt {
    animation: messageSlideIn 0.5s ease;
}

/* Typing Indicator */
.typing-indicator .message-content {
    padding: 1rem 1.5rem;
}

.typing-dots {
    display: flex;
    gap: 0.4rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

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

/* Input Area */
.chatbot-input-area {
    display: flex;
    gap: 0.8rem;
    padding: 1.2rem;
    background: white;
    border-top: 2px solid rgba(0, 0, 0, 0.08);
}

#chatbot-input {
    flex: 1;
    padding: 1rem 1.3rem;
    border: 2px solid rgba(53, 118, 89, 0.2);
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

#chatbot-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(53, 118, 89, 0.1);
}

#chatbot-send {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(53, 118, 89, 0.3);
}

#chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(53, 118, 89, 0.4);
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    #chatbot-widget {
        bottom: 20px;
        right: 20px;
    }

    #chatbot-button {
        width: 60px;
        height: 60px;
    }

    .chatbot-avatar {
        font-size: 2rem;
    }

    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 100px;
        right: 20px;
    }

    .chatbot-notification {
        min-width: 180px;
        bottom: 70px;
    }
    
    .contact-buttons {
        flex-direction: column;
    }
}
