/* ==========================================================================
   HONDU SHIPPING - Interactive Virtual Assistant / Chatbot Styles
   ========================================================================== */

:root {
    --hs-chat-primary: #002b49;
    --hs-chat-primary-dark: #001a2c;
    --hs-chat-accent: #ff6b00;
    --hs-chat-whatsapp: #25d366;
    --hs-chat-whatsapp-dark: #128c7e;
    --hs-chat-bg: #f5f7fb;
    --hs-chat-bubble-bot: #ffffff;
    --hs-chat-text: #22324d;
    --hs-chat-muted: #6c7a89;
    --hs-chat-radius: 18px;
    --hs-chat-shadow: 0 12px 40px rgba(0, 35, 71, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Back-to-top adjustment to prevent overlap */
.pbmit-backtotop.active {
    bottom: 95px !important;
}

/* Floating Launcher Container */
#hs-chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Floating Trigger Button */
.hs-chat-launcher {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, #001f3f 0%, #003366 50%, #004b87 100%);
    box-shadow: 0 8px 25px rgba(0, 35, 71, 0.45), 0 3px 8px rgba(0, 0, 0, 0.15);
    border: 3.5px solid #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    position: relative;
    user-select: none;
    padding: 0;
}

.hs-chat-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(0, 51, 102, 0.6);
}

.hs-chat-launcher:active {
    transform: scale(0.96);
}

.hs-bot-icon-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.hs-bot-launcher-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.hs-chat-launcher:hover .hs-bot-launcher-img {
    transform: scale(1.06);
}

.hs-launcher-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    background: #25d366;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

.hs-chat-launcher svg#hs-icon-close {
    width: 30px;
    height: 30px;
    display: block;
    fill: #ffffff;
    transition: transform 0.25s ease;
}

.hs-header-bot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Main Chat Window */
.hs-chat-window {
    display: none;
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--hs-chat-bg);
    border-radius: 20px;
    box-shadow: var(--hs-chat-shadow);
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.25s;
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 1000000;
}

.hs-chat-window.hs-open {
    display: flex !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.hs-chat-header {
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

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

.hs-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    position: relative;
    font-size: 22px;
    flex-shrink: 0;
}

.hs-chat-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #25d366;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.hs-chat-title-group h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hs-chat-title-group p {
    margin: 2px 0 0;
    font-size: 11.5px;
    color: #a8d5e5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hs-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hs-chat-btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease;
}

.hs-chat-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Container */
.hs-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.hs-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.hs-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

/* Message Item */
.hs-msg-wrap {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: hsMsgFade 0.25s ease-out;
}

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

.hs-msg-bot {
    align-self: flex-start;
}

.hs-msg-user {
    align-self: flex-end;
}

.hs-msg-bubble {
    padding: 12px 14px;
    border-radius: var(--hs-chat-radius);
    word-break: break-word;
    font-size: 13.5px;
    line-height: 1.5;
}

.hs-msg-bot .hs-msg-bubble {
    background: var(--hs-chat-bubble-bot);
    color: var(--hs-chat-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 20, 50, 0.06);
    border: 1px solid rgba(0, 43, 73, 0.06);
}

.hs-msg-user .hs-msg-bubble {
    background: linear-gradient(135deg, #002b49 0%, #004070 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 43, 73, 0.2);
}

.hs-msg-time {
    font-size: 10px;
    color: var(--hs-chat-muted);
    margin-top: 4px;
    padding: 0 4px;
}
.hs-msg-user .hs-msg-time {
    text-align: right;
}

/* Typing Indicator */
.hs-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    width: fit-content;
}

.hs-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #003366;
    animation: hsTypingDot 1.4s infinite ease-in-out;
}
.hs-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.hs-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes hsTypingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Question Menu / Chips */
.hs-chat-quick-section {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hs-quick-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: #556980;
    margin: 4px 0 2px;
    letter-spacing: 0.5px;
}

.hs-quick-btn {
    background: #ffffff;
    color: #002b49;
    border: 1px solid #dce4ec;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    line-height: 1.35;
}

.hs-quick-btn:hover {
    background: #eef5fc;
    border-color: #003366;
    color: #003366;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 43, 73, 0.1);
}

.hs-quick-btn span.emoji {
    font-size: 15px;
    flex-shrink: 0;
}

/* Country Menu Buttons for WhatsApp Redirection */
.hs-country-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.hs-country-btn {
    background: #ffffff;
    border: 1.5px solid #25d366;
    color: #075e54;
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hs-country-btn:hover {
    background: #25d366;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.hs-country-btn span.flag {
    font-size: 20px;
}

/* Direct Action Buttons inside message */
.hs-chat-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.hs-chat-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.5);
    color: #ffffff !important;
}

.hs-btn-secondary-action {
    background: #eef2f7;
    color: #002b49;
    border: 1px solid #ccd7e4;
    border-radius: 16px;
    padding: 7px 12px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.hs-btn-secondary-action:hover {
    background: #dbe4ef;
}

/* Chat Footer / Input */
.hs-chat-footer {
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #e7ecf2;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.hs-chat-input {
    flex: 1;
    border: 1px solid #d4dde7;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13.5px;
    outline: none;
    background: #f8fafc;
    color: #22324d;
    transition: border-color 0.2s, background 0.2s;
}

.hs-chat-input:focus {
    border-color: #003366;
    background: #ffffff;
}

.hs-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #003366;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.hs-chat-send-btn:hover {
    background: #25d366;
    transform: scale(1.05);
}

.hs-chat-send-btn:active {
    transform: scale(0.95);
}

.hs-chat-send-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    margin-left: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    #hs-chatbot-widget {
        bottom: 16px;
        right: 16px;
    }
    .hs-chat-window {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    .pbmit-backtotop.active {
        bottom: 85px !important;
        right: 16px !important;
    }
}
