/*
    MerchStudio version 0.01 - Core File
    Copyright (c) 2025 Michael Lewis White and MerchStudio Inc.
    Live Chat Widget CSS.

    @author      Khushi Mishra <khushimishra8521@gmail.com>
    @version     client/css/chat.css - 0.01 - 07-01-2026 - totaltec

   # included by client/css_load.tpl
*/

.merch_chat_widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.merch_chat_widget .floating_btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--bg);
    border: none;
    box-shadow: 0 4px 12px var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.merch_chat_widget .floating_btn:hover {
    transform: scale(1.05);
}

.merch_chat_widget .chat_panel {
    display: none; /* Hidden by default */
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background-color: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 25px var(--shadow);
    flex-direction: column;
    margin-bottom: 15px;
    overflow: hidden;
}

/* Toggled via JS */
.merch_chat_widget.is_open .chat_panel {
    display: flex;
}
.merch_chat_widget.is_open .floating_btn {
    display: none; /* Hide the floating button when panel is open */
}

.chat_header {
    background-color: var(--header_bg);
    padding: 15px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat_header h4 {
    margin: 0;
    color: var(--highlight);
}

.chat_body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--base);
}

.chat_footer {
    padding: 15px;
    border-top: 1px solid var(--line);
    background-color: var(--bg);
    display: flex;
    gap: 10px;
}

.chat_footer #chat_in {
    flex-grow: 1;
}

/* Chat Bubbles */
.chat_body .msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat_body .msg.is_admin {
    align-self: flex-start;
    background-color: var(--info_bg);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat_body .msg.is_client {
    align-self: flex-end;
    background-color: var(--accent);
    color: var(--bg);
    border-bottom-right-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .merch_chat_widget .chat_panel {
        width: calc(100vw - 40px);
    }
}