/* Enhanced Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 90px; /* Lowered to give more space at the top */
    right: 25px;
    width: 380px;
    height: 70vh;
    max-height: 570px; /* Set a max-height */
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.chatbot-container.active {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-title i {
    font-size: 1.2rem;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-status {
    font-size: 0.7rem;
    background: #2ecc71;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-close:hover {
    transform: scale(1.1);
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9f9f9;
}

.message {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bot-message {
    align-self: flex-start;
    background: #f1f1f1;
    border: 1px solid #f1f1f1;
    border-bottom-left-radius: 5px;
}

.user-message {
    align-self: flex-end;
    background: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-content {
    font-size: 0.9rem;
}

.message-content ul, .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 5px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
    color: #f39c12;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    transform: translateY(-2px);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 15px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
    max-width: 100px;
}

.typing-text {
    font-size: 0.8rem;
    color: #666;
}

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

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

.chatbot-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #f0f0f0;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
    background-color: #f9f9f9;
}

.chatbot-input input:focus {
    border-color: #007bff;
}

.chatbot-input button {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.floating-buttons {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.whatsapp-float {
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle:focus {
    outline: none;
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chatbot-container {
        width: 90%;
        height: 65vh;
        max-height: 500px;
        right: 5%;
        bottom: 90px; /* lifted slightly more for mobile view */
    }

    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-float, .chatbot-toggle {
        width: 50px;
        height: 50px;
    }

    .whatsapp-float img {
        width: 25px;
        height: 25px;
    }
}

/* Custom styles for voice and send buttons */
#chatbot-voice.listening {
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

@media (max-width: 480px) {
    .chatbot-input button {
        width: 35px;
        height: 35px;
        margin-left: 5px;
    }
}
