/* Native Live Chat Styling - Banglar Bhumi Print */
#live-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999990;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f2fe 0%, #9d4edd 50%, #ff007f 100%);
    box-shadow: 0 8px 32px rgba(0, 242, 254, 0.4), 0 4px 16px rgba(157, 78, 221, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#live-chat-launcher:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 242, 254, 0.6), 0 6px 20px rgba(255, 0, 127, 0.4);
}

#live-chat-launcher svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
    stroke: #ffffff;
    transition: transform 0.3s ease;
}

#live-chat-launcher .badge-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff007f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #030308;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
}

/* Chat Widget Drawer Container */
#live-chat-box {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 999991;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: rgba(10, 10, 25, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 242, 254, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#live-chat-box.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.95), rgba(25, 25, 55, 0.95));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00f2fe, #9d4edd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    position: relative;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.chat-avatar .status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #0a0a19;
}

.chat-header-title h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.chat-header-title p {
    font-size: 11px;
    color: #94a3b8;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-title p span.online-text {
    color: #10b981;
    font-weight: 600;
}

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

.chat-header-actions button {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-header-actions button:hover {
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
}

/* Chat Body / Messages Area */
.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(3, 3, 8, 0.4);
    scroll-behavior: smooth;
    position: relative;
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Message Item */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeInMsg 0.25s ease-out forwards;
}

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

.chat-msg.msg-visitor {
    align-self: flex-end;
}

.chat-msg.msg-agent {
    align-self: flex-start;
}

.chat-msg.msg-system {
    align-self: center;
    max-width: 90%;
}

.chat-msg .sender-tag {
    font-size: 11px;
    font-weight: 700;
    color: #00f2fe;
    margin-bottom: 3px;
    padding: 0 4px;
}

.chat-msg.msg-visitor .sender-tag {
    text-align: right;
    color: #94a3b8;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.msg-visitor .msg-bubble {
    background: linear-gradient(135deg, #00f2fe 0%, #3b82f6 100%);
    color: #030308;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}

.msg-agent .msg-bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.msg-system .msg-bubble {
    background: rgba(157, 78, 221, 0.15);
    border: 1px solid rgba(157, 78, 221, 0.3);
    color: #e2e8f0;
    font-size: 11px;
    text-align: center;
    border-radius: 12px;
}

/* Embedded Media / Attachments in Messages */
.chat-msg-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    margin-top: 4px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease;
}
.chat-msg-img:hover {
    transform: scale(1.02);
}

.chat-msg-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-top: 4px;
    text-decoration: none;
    color: #00f2fe;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(0, 242, 254, 0.2);
}
.chat-msg-file:hover {
    background: rgba(0, 242, 254, 0.15);
}

.msg-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
    text-align: right;
    font-weight: 500;
}

.msg-visitor .msg-time {
    color: rgba(0, 0, 0, 0.65);
}

/* Typing Indicator Animation Bubble */
.typing-indicator-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    margin-bottom: 6px;
    animation: fadeInMsg 0.2s ease-out;
}

.typing-indicator-box span.typing-label {
    font-size: 11px;
    color: #94a3b8;
    margin-right: 4px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.typing-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dots .dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Emoji Picker Popover */
.chat-emoji-picker {
    position: absolute;
    bottom: 75px;
    right: 14px;
    left: 14px;
    background: rgba(15, 15, 35, 0.98);
    border: 1px solid rgba(0, 242, 254, 0.35);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 8px;
    animation: fadeInMsg 0.2s ease-out;
}

.chat-emoji-picker.active {
    display: flex;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.emoji-grid span {
    font-size: 20px;
    text-align: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.emoji-grid span:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Chat Footer / Input area with Embedded Action Buttons */
.chat-footer {
    padding: 12px 14px;
    background: rgba(10, 10, 25, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Input Container Wrapper with Embedded SVG Action Buttons */
.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(0, 242, 254, 0.45);
    border-radius: 100px;
    padding: 2px 8px 2px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    gap: 6px;
}

.chat-input-wrapper:focus-within {
    border-color: #00f2fe;
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
    background: rgba(255, 255, 255, 0.09);
}

.chat-input-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.chat-input-action-btn:hover {
    color: #00f2fe;
    background: rgba(0, 242, 254, 0.15);
}

.chat-input-action-btn svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    fill: none;
}

.chat-input-wrapper input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 4px;
    font-size: 13.5px;
    color: #ffffff;
    outline: none;
    min-width: 0;
}

.chat-footer button.btn-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f2fe, #9d4edd);
    border: none;
    color: #000000;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.chat-footer button.btn-send svg {
    width: 18px;
    height: 18px;
    stroke: #000000;
    fill: none;
}

.chat-footer button.btn-send:hover {
    transform: scale(1.06);
    box-shadow: 0 0 18px rgba(0, 242, 254, 0.5);
}

@media (max-width: 480px) {
    #live-chat-launcher {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
    #live-chat-box {
        bottom: 76px;
        right: 8px;
        left: 8px;
        width: auto;
        height: calc(100vh - 90px);
        max-height: calc(100vh - 90px);
        border-radius: 16px;
    }
    .chat-footer {
        padding: 8px 10px;
    }
    .chat-input-wrapper {
        padding: 2px 6px;
    }
    .chat-footer button.btn-send {
        width: 38px;
        height: 38px;
    }
}
