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

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Ensure icon content stays centered */
.chatbot-toggle i,
.chatbot-toggle svg,
.chatbot-toggle::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* If you're using text content for the icon */
.chatbot-toggle span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.chatbot-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modern Close Button */
.chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    opacity: 0.8;
}

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

.chatbot-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Alternative modern close button with icon */
.chatbot-close i {
    font-size: 16px;
}

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

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease;
}

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

.user-message {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    margin-left: auto;
    text-align: right;
    border-radius: 18px 18px 4px 18px;
}

.bot-message {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-content {
    line-height: 1.4;
}

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

/* Modern Input Container */
.chatbot-input-container {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input-container input {
    flex: 1;
    border: 2px solid #f0f0f0;
    border-radius: 25px;
    padding: 12px 18px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.chatbot-input-container input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-input-container input::placeholder {
    color: #999;
}

/* Modern Send Button */
#chatbotSend {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    font-size: 16px;
}

#chatbotSend:hover {
    transform: scale(1.05) rotate(15deg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#chatbotSend:active {
    transform: scale(0.95) rotate(15deg);
}

#chatbotSend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Send button icon animation */
#chatbotSend i {
    transition: transform 0.2s ease;
}

#chatbotSend:hover i {
    transform: translateX(2px);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typingDots 1.4s infinite ease-in-out;
}

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

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        width: 90vw;
        height: 70vh;
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        bottom: 80px;
    }
    
    /* Override desktop animations for mobile */
    .chatbot-widget.opening {
        animation: slideInUpMobile 0.3s ease;
    }

    .chatbot-widget.closing {
        animation: slideOutDownMobile 0.3s ease;
    }
    
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .chatbot-input-container {
        padding: 12px;
    }
    
    .chatbot-input-container input {
        padding: 10px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #chatbotSend {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Mobile-specific animations that preserve the translateX(-50%) */
@keyframes slideInUpMobile {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes slideOutDownMobile {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }
}

/* Move desktop animations after mobile to prevent conflicts */
/* Smooth animations for widget opening/closing - Desktop only */
@media (min-width: 769px) {
    .chatbot-widget.opening {
        animation: slideInUp 0.3s ease;
    }

    .chatbot-widget.closing {
        animation: slideOutDown 0.3s ease;
    }
}

/* Desktop animation keyframes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-widget {
        background: #2d3748;
        border: 1px solid #4a5568;
    }
    
    .chatbot-messages {
        background: #1a202c;
    }
    
    .bot-message {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .chatbot-input-container {
        background: #2d3748;
        border-top-color: #4a5568;
    }
    
    .chatbot-input-container input {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .chatbot-input-container input:focus {
        background: #2d3748;
        border-color: #667eea;
    }
}

/* Pulse animation for new messages */
.message.new-message {
    animation: messagePulse 0.6s ease;
}

@keyframes messagePulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Add this CSS to your chatbot styles */
.verification-message {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    background-color: #f9f9f9;
}

.recaptcha-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.verification-message .message-content {
    text-align: center;
}

.verification-message p {
    margin: 0 0 10px 0;
    color: #555;
    font-weight: 500;
}