/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6);
}

.chatbot-toggle.active {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.chatbot-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: all 0.3s ease;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

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

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

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

.message {
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease-out;
}

.message.bot {
    text-align: left;
}

.message.user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-bottom-right-radius: 8px;
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 5px;
    display: block;
}

.chatbot-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

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

.chatbot-input input:focus {
    border-color: #4CAF50;
}

.chatbot-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.chatbot-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.typing-indicator {
    display: none;
    align-items: center;
    margin: 10px 0;
}

.typing-indicator.show {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
    margin-left: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: typing 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.6s;
}

.forward-option {
    margin-top: 10px;
    text-align: center;
}

.forward-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.forward-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

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

@keyframes typing {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: 300px;
        height: 450px;
        bottom: 70px;
        right: -10px;
    }
    
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }
}

/* Chat Link Styles */
.chat-link {
    color: #4CAF50 !important;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.chat-link:hover {
    color: #45a049 !important;
    border-bottom-color: #4CAF50;
    text-decoration: none;
}

.message.bot .message-bubble .chat-link {
    color: #2e7d32 !important;
}

.message.bot .message-bubble .chat-link:hover {
    color: #1b5e20 !important;
    border-bottom-color: #2e7d32;
}

.message.user .message-bubble .chat-link {
    color: #ffffff !important;
    text-decoration: underline;
}

.message.user .message-bubble .chat-link:hover {
    color: #f1f8e9 !important;
}

/* Enhanced message formatting */
.message-bubble strong {
    font-weight: 600;
}

.message-bubble br + strong {
    margin-top: 8px;
    display: inline-block;
}

/* Better spacing for formatted messages */
.message-bubble br + strong {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
}

.message-bubble strong:first-child {
    margin-top: 0;
}

/* Step formatting */
.message-bubble strong[text*="Step"] {
    color: #2e7d32;
    display: block;
    margin: 8px 0 4px 0;
}

.message.bot .message-bubble {
    line-height: 1.5;
}

/* Link spacing */
.chat-link + .chat-link::before {
    content: " | ";
    color: #666;
    margin: 0 4px;
}
