/* --- Chat Popup Styles (Gemma Design) --- */

.chat-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
}

.chat-popup-header {
    background: #00666B;
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-header-left button:hover,
.chat-header-left button:focus,
.chat-header-left button:active,
.chat-header-left button:focus-visible {
    background: unset;
    border: unset;
    color: inherit;
    box-sizing: unset;
}

.chat-header-right button:hover,
.chat-header-right button:focus,
.chat-header-right button:active,
.chat-header-right button:focus-visible {
    background: unset;
    border: unset;
    color: inherit;
    box-sizing: unset;
}

.chat-back-btn,
.chat-menu-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
}

.chat-header-title {
    font-size: 16px;
    font-weight: 700;
}

.chat-header-subtitle {
    font-size: 12px;
    color: #FFF;
}

.chat-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.chat-popup-body::-webkit-scrollbar {
    width: 6px;
}

.chat-popup-body::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 3px;
}

.messages {
    display: flex;
    flex-direction: column;
}

.bot-msg-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-self: flex-start;
}

.user-msg-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-avatar,
.bot-avatar-g {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.bot-avatar-g img,
.user-avatar img {
    width: 20px;
    height: 20px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #00666B;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    font-size: 12px;
}

.bot-msg-bubble {
    background: #fff;
    border: 1px solid #eee;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    position: relative;
    min-width: 0;
    /* Flexbox + Slick fix */
}

.bot-msg-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.bot-msg-bubble p:last-child {
    margin-bottom: 0;
}

.bot-msg-bubble .bot-more-content-text {
    margin-bottom: 10px;
}

.bot-msg-bubble .follow-ups {
    display: inline-block;
    width: 100%;

    span.label {
        display: inline-block;
        width: 100%;
        margin: 0 0 10px;
    }

    button.suggestion-btn {
        display: inline-block;
        text-align: left;
        margin: 0 0 10px;
        font-size: 12px;
        font-weight: 400;
    }
}

.msg-time {
    font-size: 11px;
    color: #FFF;
    display: block;
    margin-top: 4px;
}

/* User Message */
.user-msg {
    background: #f0f0f0;
    color: #333;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    border: none;
    text-align: left;
}

/* System Message */
.system-message {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.system-message::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #eee;
    z-index: 1;
}

.system-message span {
    background: #fff;
    padding: 0 12px;
    position: relative;
    z-index: 2;
    font-size: 12px;
    color: #000;
}

.chat-popup-footer {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
}

.input-container {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

#messageInput {
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 14px;
    padding: 8px;
    font-family: inherit;
    color: #333;

    &:focus {
        box-shadow: unset;
    }
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.action-icons {
    display: flex;
    align-items: center;
    width: 30px;
}

.footer-logo {
    width: 24px;
    height: 24px;
}

.attachment-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.send-btn {
    border: none;
    color: #000;
    width: 40px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;

    &:hover,
    &:focus,
    &:active,
    &:focus-visible {
        border: unset;
        color: inherit;
        box-sizing: unset;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .chat-popup-container {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    height: 18px;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #00666B;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
    animation: typing-bounce 1.3s infinite ease-in-out;
}

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

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

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

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Product Results in Popup */
#chat-popup .product-list {
    margin: 15px 0 35px;
    width: 100%;
    max-width: 100%;
    display: block;
    padding-bottom: 20px;
}

#chat-popup .product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-width: 100%;
    margin: 0;
}

#chat-popup .product-list:not(.slick-initialized) {
    display: flex;
    overflow: hidden;
    gap: 10px;
}