/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4BAC24, #7bdf53);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(75, 172, 36, 0.4);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(75, 172, 36, 0.6);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #2c3e50, #4BAC24);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #7bdf53;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-actions {
    display: flex;
    gap: 0.5rem;
}

.chatbot-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #4BAC24;
    border-radius: 3px;
}

/* Message Styles */
.message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #4BAC24, #7bdf53);
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 75%;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    line-height: 1.5;
}

.bot-message .message-bubble {
    background: white;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #4BAC24, #7bdf53);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble p {
    margin: 0 0 0.5rem 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    padding: 0 0.5rem;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.4s ease;
}

.quick-reply-btn {
    padding: 0.6rem 1rem;
    background: white;
    border: 2px solid #4BAC24;
    color: #4BAC24;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: #4BAC24;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(75, 172, 36, 0.3);
}

.quick-reply-btn i {
    font-size: 0.9rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.5rem;
}

.typing-dots {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #4BAC24;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chatbot Input */
.chatbot-input-container {
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chatbot-form {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
}

.attach-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover {
    background: #f0f0f0;
    color: #4BAC24;
}

.chatbot-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input:focus {
    border-color: #4BAC24;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #4BAC24, #7bdf53);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(75, 172, 36, 0.4);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-footer-text {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    padding: 0.5rem;
}

/* File Attachment Preview */
.file-preview {
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    margin: 0 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-preview-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
}

/* Error Message */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 0.5rem 1rem;
    margin: 0 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .chatbot-window {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: calc(100vh - 70px);
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .message-content {
        max-width: 85%;
    }

    .quick-reply-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        max-height: 100vh;
    }

    .chatbot-messages {
        padding: 1rem;
    }

    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .chat-badge {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-action-btn:focus,
.quick-reply-btn:focus,
.attach-btn:focus,
.chatbot-send-btn:focus {
    outline: 2px solid #4BAC24;
    outline-offset: 2px;
}

/* Smooth Scrolling */
.chatbot-messages {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .chatbot-container {
        display: none;
    }
}