/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: var(--font-body);
    /* Ensure container is always visible */
    display: block !important;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient-saffron);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    animation: pulse 2s infinite;
    /* Ensure toggle is always visible */
    display: flex !important;
}

.chatbot-toggle-text {
    display: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-2xl);
    animation: none;
}

.chatbot-widget {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10001;
    /* Ensure widget can be visible when open */
    display: flex !important;
}

.chatbot-widget.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.chatbot-header {
    background: var(--gradient-saffron);
    color: white;
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chatbot-message {
    max-width: 80%;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: 1.4;
    animation: fadeInUp 0.3s ease-out;
}

.chatbot-message.user {
    align-self: flex-end;
    background: var(--color-saffron-light);
    color: var(--color-black);
    border-bottom-right-radius: 0;
}

.chatbot-message.bot {
    align-self: flex-start;
    background: var(--color-grey-lighter);
    color: var(--color-black);
    border-bottom-left-radius: 0;
}

.chatbot-input-container {
    padding: var(--space-md);
    border-top: 1px solid var(--color-grey-light);
    display: flex;
    gap: var(--space-sm);
}

.chatbot-input {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--color-grey-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    resize: none;
    height: 40px;
    max-height: 100px;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--color-saffron);
}

.chatbot-send {
    background: var(--gradient-saffron);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.chatbot-send:hover {
    background: var(--color-saffron-dark);
}

.chatbot-send:disabled {
    background: var(--color-grey-light);
    cursor: not-allowed;
}

.chatbot-typing {
    align-self: flex-start;
    background: var(--color-grey-lighter);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    display: none;
}

.chatbot-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--color-grey);
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) {
    animation-delay: 0s;
}

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

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 112, 32, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(243, 112, 32, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(243, 112, 32, 0);
    }
}

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

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

/* Welcome message */
.chatbot-welcome {
    text-align: center;
    padding: var(--space-lg);
    background: var(--color-grey-lighter);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    animation: fadeIn 0.5s ease-out;
}

.chatbot-welcome h4 {
    margin: 0 0 var(--space-sm) 0;
    color: var(--color-saffron);
}

.chatbot-welcome p {
    margin: 0;
    font-size: var(--text-sm);
}

/* Quick replies */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.chatbot-quick-reply {
    background: var(--color-saffron-light);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    animation: fadeIn 0.3s ease-out;
}

.chatbot-quick-reply:hover {
    background: var(--color-saffron);
    color: white;
    transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        width: 300px;
        height: 400px;
        bottom: 70px;
    }
    
    /* Adjust for language toggle position on mobile */
    .chatbot-container {
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .chatbot-widget {
        width: 280px;
        height: 350px;
        bottom: 70px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* On very small screens, adjust positioning */
    .chatbot-container {
        right: 15px;
    }
}