/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 160px;
    right: 30px;
    z-index: 1000;
    font-family: var(--font-primary);
}

/* Consolidated Floating Actions Bar */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
}

.float-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 8px; /* Offset for pill shape */
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.float-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.icon-wrap {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Harmonized Colors */
.gift-btn {
    background: linear-gradient(135deg, var(--accent2) 0%, #047857 100%);
}
.gift-btn .icon-wrap { color: var(--accent2); }

.consult-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    position: relative;
}
.consult-btn .icon-wrap { color: #F59E0B; }

/* Subtle pulse for the main CTA */
.consult-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50px;
    background: #F59E0B;
    z-index: -1;
    animation: pill-ping 3s infinite;
    opacity: 0;
}

@keyframes pill-ping {
    0% { transform: scaleX(1) scaleY(1); opacity: 0.5; }
    100% { transform: scaleX(1.1) scaleY(1.3); opacity: 0; }
}

.zalo-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #1D4ED8 100%);
}
.zalo-btn .icon-wrap { color: var(--accent); }

/* Chatbot notification badge on the new button */
.consult-btn .notification-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background-color: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--border);
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--accent) 0%, #1D4ED8 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header .avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header-info h4 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.chatbot-header-info p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.chatbot-close {
    margin-left: auto;
    cursor: pointer;
    font-size: 24px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 1;
}

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

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
}

.message.bot {
    background-color: white;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.message.user {
    background-color: var(--accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    opacity: 0.4;
    animation: typing 1s 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%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); opacity: 0.8; }
}

.chatbot-options {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: #fcfcfc;
    flex-shrink: 0;
}

.chatbot-footer {
    padding: 12px 15px;
    background-color: #fff !important;
    border-top: 1px solid var(--border);
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 60px;
    position: relative;
    z-index: 10;
}

.chatbot-input-wrap {
    flex: 1;
    position: relative;
}

.chatbot-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color 0.2s;
    background-color: #f8fafc;
}

.chatbot-input:focus {
    border-color: var(--accent);
    background-color: #fff;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.chatbot-send-btn svg {
    margin-left: 2px;
}

.option-btn {
    background: white;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.option-btn:hover {
    background-color: var(--accent);
    color: white;
}

.option-btn.primary {
    background-color: var(--accent2);
    border-color: var(--accent2);
    color: white;
}

.option-btn.primary:hover {
    background-color: #047857;
    border-color: #047857;
}

@media (max-width: 768px) {
    .floating-actions {
        right: 15px;
        left: 15px;
        bottom: 20px;
        justify-content: center;
        gap: 8px;
    }
    
    .float-btn {
        padding: 6px 12px 6px 6px;
        font-size: 0.8rem;
    }
    
    .icon-wrap {
        width: 32px;
        height: 32px;
    }

    .float-btn span {
        display: none; /* Hide text on very small screens to maintain row layout */
    }
}

/* Show text on slightly larger mobiles/tablets */
@media (min-width: 480px) and (max-width: 768px) {
    .float-btn span {
        display: block;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 30px);
        height: 70vh;
        bottom: 80px;
        right: 15px;
    }
}
