/* BTNL Chatbot Styles */
#btnl-chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#btnl-chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2575fc 0%, #0a2540 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(10, 37, 64, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: idleBounce 3s infinite;
}

@keyframes idleBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

#btnl-chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(10, 37, 64, 0.5);
    animation: none;
}

#btnl-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.btnl-chat-open #btnl-chat-window {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.btnl-chat-closed #btnl-chat-window {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.btnl-chat-open #btnl-chat-toggle-btn {
    transform: rotate(90deg) scale(0.9);
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
    animation: none;
}

.btnl-chat-header {
    background: linear-gradient(135deg, #0a2540 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btnl-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.btnl-chat-header .status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btnl-chat-header .status::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
}

#btnl-chat-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#btnl-chat-close-btn:hover {
    opacity: 1;
}

#btnl-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.bot-message {
    background: white;
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.user-message {
    background: linear-gradient(135deg, #0a2540 0%, #2575fc 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(10, 37, 64, 0.2);
}

.btnl-chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

#btnl-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

#btnl-chat-input:focus {
    border-color: #2575fc;
}

#btnl-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2575fc;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

#btnl-chat-send-btn:hover {
    background: #0a2540;
}

#btnl-chat-send-btn:active {
    transform: scale(0.95);
}

/* Scrollbar styles */
#btnl-chat-messages::-webkit-scrollbar {
    width: 6px;
}
#btnl-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#btnl-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 480px) {
    #btnl-chat-window {
        width: calc(100vw - 40px);
        right: -10px; /* Adjust for container padding */
        height: 450px;
    }
}

/* 
 * Overrides for third-party WhatsApp widgets.
 * Forces the WhatsApp logo to go ABOVE the Chatbot so both are accessible.
 */
.joinchat {
    bottom: 110px !important;
    z-index: 999998 !important;
}

.wa__btn_popup {
    bottom: 110px !important;
    z-index: 999998 !important;
}

#whatsapp-chat-widget {
    bottom: 110px !important;
}
