/* ============================================================
   LMTC COMMUNITY CHAT
   public/assets/css/community-chat.css
============================================================ */


/* ============================================================
   FLOATING BUTTON
============================================================ */

.community-chat-floating-btn {
    position: fixed;
    right: 24px;
    bottom: 105px;

    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 3px solid #ffffff;
    border-radius: 20px;

    background: #1384d1;
    color: #ffffff;

    font-size: 25px;

    cursor: pointer;

    z-index: 99991;

    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}


.community-chat-floating-btn:hover {
    background: #0875bd;

    transform: translateY(-2px);

    box-shadow:
        0 11px 32px rgba(0, 0, 0, 0.28);
}


.community-chat-floating-btn:active {
    transform: scale(0.96);
}


.community-chat-floating-btn:focus-visible {
    outline: 3px solid rgba(19, 132, 209, 0.25);
    outline-offset: 3px;
}


/* ============================================================
   ONLINE DOT
============================================================ */

.community-chat-online-dot {
    position: absolute;

    top: 3px;
    right: 3px;

    width: 12px;
    height: 12px;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: #26d76f;
}


/* ============================================================
   AUTH MODAL
============================================================ */

.community-auth-modal {
    position: fixed;

    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 100000;
}


/*
 * IMPORTANT:
 * No backslash before .active
 */
.community-auth-modal.active {
    display: flex !important;
}


/* ============================================================
   AUTH BACKDROP
============================================================ */

.community-auth-backdrop {
    position: absolute;

    inset: 0;

    background: rgba(18, 31, 43, 0.50);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}


/* ============================================================
   AUTH CARD
============================================================ */

.community-auth-card {
    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 430px;

    max-height: calc(100vh - 40px);

    padding: 36px 32px 30px;

    overflow-y: auto;

    border-radius: 20px;

    background: #ffffff;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.30);

    animation:
        communityCardOpen 0.2s ease;
}


@keyframes communityCardOpen {

    from {
        opacity: 0;

        transform:
            translateY(15px)
            scale(0.97);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* ============================================================
   AUTH CLOSE
============================================================ */

.community-auth-close {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 10px;

    background: #eaf5fc;
    color: #147dc5;

    font-size: 16px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.community-auth-close:hover {
    background: #dceef9;

    transform: scale(1.04);
}


/* ============================================================
   AUTH VIEW
============================================================ */

.community-auth-view {
    display: none;
}


/*
 * IMPORTANT:
 * Correct selector:
 * .community-auth-view.active
 */
.community-auth-view.active {
    display: block !important;
}


/* ============================================================
   AUTH LOGO
============================================================ */

.community-auth-logo {
    width: 64px;
    height: 64px;

    margin: 0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background: #eaf6fd;
    color: #0b80c9;

    font-size: 26px;
}


/* ============================================================
   AUTH TITLE
============================================================ */

.community-auth-title {
    margin-bottom: 25px;

    text-align: center;
}


.community-auth-title h2 {
    margin: 0 0 7px;

    color: #254f70;

    font-size: 27px;
    font-weight: 700;
}


.community-auth-title p {
    margin: 0;

    color: #7d93a5;

    font-size: 14px;
    line-height: 1.6;
}


/* ============================================================
   AUTH ERRORS
============================================================ */

.community-auth-errors {
    margin-bottom: 18px;

    padding: 12px 14px;

    border: 1px solid #f3b8b8;
    border-radius: 10px;

    background: #fff2f2;
    color: #c53a3a;

    font-size: 13px;
    line-height: 1.5;
}


.community-auth-errors div + div {
    margin-top: 4px;
}


/* ============================================================
   FORM
============================================================ */

.community-auth-form {
    width: 100%;
}


.community-form-group {
    margin-bottom: 17px;
}


.community-form-group label {
    display: block;

    margin-bottom: 7px;

    color: #315a79;

    font-size: 14px;
    font-weight: 700;
}


/* ============================================================
   LOGIN INPUT
============================================================ */

.community-input-box {
    height: 56px;

    display: flex;
    align-items: center;

    overflow: hidden;

    border: 1px solid #c9dce9;
    border-radius: 14px;

    background: #ffffff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.community-input-box:focus-within {
    border-color: #1480c9;

    box-shadow:
        0 0 0 3px rgba(20, 128, 201, 0.08);
}


.community-input-icon {
    width: 48px;

    flex: 0 0 48px;

    text-align: center;

    color: #88a4b7;
}


.community-input-box input {
    flex: 1;

    min-width: 0;
    height: 100%;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: #253a49;

    font-size: 15px;
}


.community-input-box input::placeholder {
    color: #9eb1bf;
}


/* ============================================================
   PASSWORD BUTTON
============================================================ */

.community-password-toggle {
    width: 48px;
    height: 100%;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;

    background: transparent;
    color: #88a4b7;

    cursor: pointer;
}


.community-password-toggle:hover {
    color: #147bc5;
}


/* ============================================================
   REMEMBER
============================================================ */

.community-remember {
    display: flex;
    align-items: center;

    gap: 9px;

    margin: 4px 0 18px;

    color: #748a9c;

    font-size: 14px;

    cursor: pointer;
}


.community-remember input {
    width: 17px;
    height: 17px;

    margin: 0;

    cursor: pointer;
}


/* ============================================================
   LOGIN BUTTON
============================================================ */

.community-login-submit {
    width: 100%;
    height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 0 18px;

    border: 0;
    border-radius: 14px;

    background: #147bc5;
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.community-login-submit:hover {
    background: #0d70b5;
}


.community-login-submit:active {
    transform: scale(0.99);
}


/* ============================================================
   DIVIDER
============================================================ */

.community-auth-divider {
    margin: 21px 0;

    display: flex;
    align-items: center;

    gap: 12px;
}


.community-auth-divider span {
    flex: 1;

    height: 1px;

    background: #d9e3ea;
}


.community-auth-divider strong {
    color: #879aa8;

    font-size: 11px;
    font-weight: 700;
}


/* ============================================================
   GOOGLE
============================================================ */

.community-google-btn {
    width: 100%;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    box-sizing: border-box;

    border: 1px solid #c8d6df;
    border-radius: 13px;

    background: #ffffff;

    color: #304456;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.community-google-btn:hover {
    background: #f7fafc;

    border-color: #aebfca;
}


.community-google-icon {
    font-size: 20px;
    font-weight: 800;

    color: #4285f4;
}


/* ============================================================
   SWITCH AUTH
============================================================ */

.community-auth-switch {
    margin-top: 22px;

    text-align: center;

    color: #788fa1;

    font-size: 13px;
}


.community-auth-switch button {
    padding: 0;

    border: 0;

    background: transparent;

    color: #087bc4;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}


.community-auth-switch button:hover {
    text-decoration: underline;
}


/* ============================================================
   REGISTER NAME ROW
============================================================ */

.community-name-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;
}


/* ============================================================
   REGISTER INPUT
============================================================ */

.community-register-input {
    position: relative;

    margin-bottom: 14px;
}


.community-register-input input {
    width: 100%;
    height: 49px;

    box-sizing: border-box;

    padding: 0 14px;

    border: 1px solid #d0d3d6;
    border-radius: 7px;

    outline: none;

    background: #ffffff;
    color: #253a49;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.community-register-input input::placeholder {
    color: #9aa7b1;
}


.community-register-input input:focus {
    border-color: #6c36a5;

    box-shadow:
        0 0 0 3px rgba(108, 54, 165, 0.08);
}


.community-register-input.password input {
    padding-right: 50px;
}


.community-register-input.password
.community-password-toggle {
    position: absolute;

    top: 0;
    right: 0;

    width: 49px;
    height: 49px;
}


/* ============================================================
   TERMS
============================================================ */

.community-terms {
    margin: 4px 0 15px;

    text-align: center;

    color: #788fa1;

    font-size: 13px;
    line-height: 1.5;
}


.community-terms a {
    color: #5788e7;

    text-decoration: none;
}


.community-terms a:hover {
    text-decoration: underline;
}


/* ============================================================
   REGISTER BUTTON
============================================================ */

.community-register-submit {
    width: 100%;
    height: 49px;

    border: 0;
    border-radius: 7px;

    background: #6c36a5;
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.community-register-submit:hover {
    background: #5c2c90;
}


.community-register-submit:active {
    transform: scale(0.99);
}


/* ============================================================
   COMMUNITY CHAT WINDOW
============================================================ */

.community-chat-window {
    position: fixed;

    right: 24px;
    bottom: 180px;

    width: 390px;
    height: 560px;

    display: none;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid #d7e3eb;
    border-radius: 22px;

    background: #ffffff;

    z-index: 99990;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25);
}


/*
 * THIS IS THE IMPORTANT FIX.
 *
 * Correct:
 * .community-chat-window.active
 *
 * Wrong:
 * .community-chat-window\.active
 */
.community-chat-window.active {
    display: flex !important;

    animation:
        communityChatOpen 0.18s ease;
}


@keyframes communityChatOpen {

    from {
        opacity: 0;

        transform:
            translateY(10px)
            scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* ============================================================
   CHAT HEADER
============================================================ */

.community-chat-header {
    min-height: 82px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 0 0 auto;

    background: #1479bf;
    color: #ffffff;
}


.community-chat-header-left {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 12px;
}


.community-chat-header-logo {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #ffffff;
    border-radius: 50%;

    font-size: 19px;
}


.community-chat-header-info {
    min-width: 0;
}


.community-chat-header-info h3 {
    margin: 0 0 4px;

    color: #ffffff;

    font-size: 17px;
    font-weight: 700;
}


.community-chat-status {
    display: flex;
    align-items: center;

    gap: 6px;

    font-size: 11px;
}


.community-chat-status span {
    width: 8px;
    height: 8px;

    flex: 0 0 8px;

    border-radius: 50%;

    background: #37df72;
}


/* ============================================================
   CHAT CLOSE
============================================================ */

.community-chat-close {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;

    font-size: 16px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.community-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);

    transform: scale(1.04);
}


/* ============================================================
   CURRENT USER
============================================================ */

.community-current-user {
    padding: 12px 16px;

    display: flex;
    align-items: center;

    gap: 11px;

    flex: 0 0 auto;

    border-bottom: 1px solid #e1e9ef;

    background: #ffffff;
}


.community-current-avatar {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    background: #147bc5;
    color: #ffffff;

    font-weight: 700;
}


.community-current-avatar img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.community-current-info {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.community-current-info strong {
    overflow: hidden;

    color: #29475f;

    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.community-current-info small {
    margin-top: 2px;

    overflow: hidden;

    color: #8297a7;

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   CHAT BODY
============================================================ */

.community-chat-body {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    background: #f5f9fc;
}


.community-chat-messages {
    min-height: 100%;

    padding: 16px;

    box-sizing: border-box;
}


/* ============================================================
   EMPTY CHAT
============================================================ */

.community-chat-empty {
    min-height: 300px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 20px;

    box-sizing: border-box;

    text-align: center;
}


.community-chat-empty-icon {
    width: 60px;
    height: 60px;

    margin-bottom: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background: #eaf6fd;
    color: #1480c8;

    font-size: 25px;
}


.community-chat-empty strong {
    color: #31536c;

    font-size: 15px;
}


.community-chat-empty p {
    margin: 6px 0 0;

    color: #8499a9;

    font-size: 12px;
    line-height: 1.5;
}


/* ============================================================
   MESSAGE FOOTER
============================================================ */

.community-chat-footer {
    padding: 12px;

    flex: 0 0 auto;

    border-top: 1px solid #dfe8ee;

    background: #ffffff;
}


/* ============================================================
   MESSAGE FORM
============================================================ */

.community-message-form {
    display: flex;
    align-items: center;

    gap: 8px;
}


.community-message-form input {
    flex: 1;

    min-width: 0;
    height: 44px;

    box-sizing: border-box;

    padding: 0 14px;

    border: 1px solid #ccdce7;
    border-radius: 12px;

    outline: none;

    background: #ffffff;
    color: #253a49;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.community-message-form input::placeholder {
    color: #9aabb8;
}


.community-message-form input:focus {
    border-color: #1480c8;

    box-shadow:
        0 0 0 3px rgba(20, 128, 200, 0.08);
}


.community-message-form button {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 12px;

    background: #147bc5;
    color: #ffffff;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.community-message-form button:hover {
    background: #0d70b5;
}


.community-message-form button:active {
    transform: scale(0.96);
}


/* ============================================================
   BODY MODAL STATE
============================================================ */

body.community-modal-open {
    overflow: hidden;
}


/* ============================================================
   TABLET / MOBILE
============================================================ */

@media (max-width: 600px) {

    .community-chat-floating-btn {
        right: 17px;
        bottom: 92px;

        width: 60px;
        height: 60px;

        border-radius: 18px;

        font-size: 23px;
    }


    .community-auth-modal {
        padding: 14px;
    }


    .community-auth-card {
        max-height: calc(100vh - 28px);

        padding:
            34px
            22px
            27px;
    }


    .community-auth-title h2 {
        font-size: 24px;
    }


    .community-chat-window {
        right: 12px;
        bottom: 165px;

        width: calc(100% - 24px);

        height: min(
            520px,
            calc(100vh - 190px)
        );

        border-radius: 18px;
    }


    .community-chat-header {
        min-height: 74px;

        padding: 0 14px;
    }


    .community-chat-header-logo {
        width: 43px;
        height: 43px;

        flex-basis: 43px;
    }


    .community-chat-header-info h3 {
        font-size: 15px;
    }

}


/* ============================================================
   SMALL MOBILE
============================================================ */

@media (max-width: 420px) {

    .community-name-row {
        grid-template-columns: 1fr;

        gap: 0;
    }


    .community-auth-card {
        padding:
            32px
            18px
            24px;

        border-radius: 17px;
    }


    .community-input-box {
        height: 52px;
    }


    .community-login-submit {
        height: 50px;
    }


    .community-google-btn {
        height: 50px;
    }


    .community-chat-window {
        right: 8px;

        width: calc(100% - 16px);
    }

}


/* ============================================================
   VERY SMALL HEIGHT
============================================================ */

@media (max-height: 650px) {

    .community-auth-card {
        max-height: calc(100vh - 20px);

        padding-top: 28px;
        padding-bottom: 24px;
    }


    .community-auth-logo {
        width: 54px;
        height: 54px;

        margin-bottom: 10px;

        font-size: 22px;
    }


    .community-auth-title {
        margin-bottom: 18px;
    }


    .community-chat-window {
        height: calc(100vh - 150px);

        bottom: 140px;
    }

}


/* ============================================================
   ACCESSIBILITY
============================================================ */

@media (prefers-reduced-motion: reduce) {

    .community-auth-card,
    .community-chat-window.active {
        animation: none;
    }


    .community-chat-floating-btn,
    .community-login-submit,
    .community-register-submit,
    .community-chat-close,
    .community-message-form button {
        transition: none;
    }

}

/* ======================================================
   LMTC COMMUNITY CHAT — COMPACT MESSAGE LAYOUT
   Paste at the VERY END of community-chat.css
   ====================================================== */

/* 1. Reduce padding around the message list */
#communityChatWindow #communityChatMessages {
    padding: 8px 10px 12px !important;
}

/* 2. Reduce the large space between messages */
#communityChatWindow .lmtc-msg-row {
    display: flex !important;
    align-items: flex-end !important;

    gap: 7px !important;

    margin: 6px 4px !important;
    padding: 0 !important;

    height: auto !important;
    min-height: 0 !important;
}

/* Own messages remain on the right */
#communityChatWindow .lmtc-msg-row.lmtc-mine {
    justify-content: flex-end !important;
}

/* 3. Message content should not occupy full width */
#communityChatWindow .lmtc-msg-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;

    width: fit-content !important;
    max-width: 78% !important;
    min-width: 0 !important;

    gap: 0 !important;
}

/* Own message content aligns right */
#communityChatWindow .lmtc-mine .lmtc-msg-content {
    align-items: flex-end !important;
}

/* 4. Smaller name spacing */
#communityChatWindow .lmtc-msg-name {
    margin: 0 0 3px !important;
    padding: 0 !important;

    font-size: 11.5px !important;
    line-height: 1.3 !important;
}

/* 5. Compact message bubble */
#communityChatWindow .lmtc-msg-bubble {
    display: block !important;

    width: fit-content !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 7px 11px !important;

    font-size: 13px !important;
    line-height: 1.5 !important;

    border-radius: 14px 14px 14px 5px !important;

    overflow-wrap: anywhere !important;
    white-space: pre-wrap !important;
    box-sizing: border-box !important;
}

/* Own message bubble */
#communityChatWindow .lmtc-mine .lmtc-msg-bubble {
    border-radius: 14px 14px 5px 14px !important;
}

/* 6. Compact quoted reply */
#communityChatWindow .lmtc-msg-quote {
    max-width: 220px !important;

    margin: 0 0 5px !important;
    padding: 5px 7px !important;

    font-size: 11px !important;
    line-height: 1.4 !important;
}

#communityChatWindow .lmtc-msg-quote-text {
    max-width: 200px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

/* 7. Time, React and Reply on one compact line */
#communityChatWindow .lmtc-msg-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    flex-wrap: nowrap !important;
    gap: 5px !important;

    margin: 3px 0 0 !important;
    padding: 0 !important;

    min-height: 20px !important;
    line-height: 1.2 !important;
}

#communityChatWindow .lmtc-mine .lmtc-msg-meta {
    justify-content: flex-end !important;
}

/* 8. Smaller time */
#communityChatWindow .lmtc-msg-time {
    font-size: 10px !important;
    line-height: 1.2 !important;

    margin: 0 4px 0 0 !important;
    padding: 0 !important;

    white-space: nowrap !important;
}

/* 9. Compact React and Reply buttons */
#communityChatWindow .lmtc-react-toggle,
#communityChatWindow .lmtc-msg-reply-btn {
    min-height: 22px !important;
    height: 22px !important;

    margin: 0 !important;
    padding: 2px 6px !important;

    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1 !important;

    border-radius: 7px !important;
    white-space: nowrap !important;
}

/* Smaller reply arrow */
#communityChatWindow .lmtc-msg-reply-btn::before {
    font-size: 12px !important;
}

/* 10. Reaction count closer to message */
#communityChatWindow .lmtc-reaction-summary {
    margin: 3px 0 0 !important;
    padding: 3px 7px !important;

    font-size: 10.5px !important;
    line-height: 1.2 !important;
}

/* 11. Avatar size and position */
#communityChatWindow .lmtc-msg-avatar {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;

    margin: 0 0 21px !important;

    font-size: 11px !important;
}

/* 12. Smaller emoji picker */
#communityChatWindow .lmtc-react-picker {
    margin-top: 4px !important;
    padding: 4px 6px !important;
    gap: 4px !important;
}

#communityChatWindow .lmtc-react-btn {
    width: 31px !important;
    height: 31px !important;
    font-size: 18px !important;
}

/* Keep hidden picker hidden */
#communityChatWindow .lmtc-react-picker[hidden] {
    display: none !important;
}

/* 13. Mobile */
@media (max-width: 440px) {
    #communityChatWindow .lmtc-msg-content {
        max-width: 83% !important;
    }

    #communityChatWindow .lmtc-msg-meta {
        gap: 3px !important;
    }

    #communityChatWindow .lmtc-react-toggle,
    #communityChatWindow .lmtc-msg-reply-btn {
        padding: 2px 4px !important;
        font-size: 10px !important;
    }
}

/* ==========================================
   LMTC — MODERN REACTION ICONS
   Replace visual emojis with clean icons
   ========================================== */

/* Picker container */
#communityChatWindow .lmtc-react-picker {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    padding: 8px 10px !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    border: 1px solid #e6edf5 !important;

    box-shadow:
        0 8px 24px rgba(26, 65, 105, 0.12) !important;
}

#communityChatWindow .lmtc-react-picker[hidden] {
    display: none !important;
}

/* All 3 reaction buttons */
#communityChatWindow .lmtc-react-picker .lmtc-react-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;

    padding: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;

    background: transparent !important;

    /* Hide the original emoji visually */
    font-size: 0 !important;

    box-shadow: none !important;
    cursor: pointer !important;

    transition:
        background-color .18s ease,
        transform .18s ease !important;
}

/* Icon style */
#communityChatWindow .lmtc-react-btn::before {
    display: inline-block !important;

    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    font-size: 19px !important;
    line-height: 1 !important;

    -webkit-font-smoothing: antialiased;
}

/* 1. LIKE — Blue */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn:nth-of-type(1)::before {
    content: "\f164" !important;
    color: #1683c9 !important;
}

/* 2. LOVE — Pink */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn:nth-of-type(2)::before {
    content: "\f004" !important;
    color: #ef476f !important;
}

/* 3. HAHA — Amber */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn:nth-of-type(3)::before {
    content: "\f59a" !important;
    color: #e6a321 !important;
}

/* Hover effect */
#communityChatWindow .lmtc-react-btn:hover {
    background: #f0f6fc !important;
    transform: translateY(-2px) !important;
}

/* Selected reaction */
#communityChatWindow
.lmtc-react-btn[aria-pressed="true"] {
    background: #e8f3fc !important;
    border-color: #b8ddf6 !important;
    box-shadow: none !important;
}

/* Keyboard focus */
#communityChatWindow .lmtc-react-btn:focus-visible {
    outline: 2px solid #1683c9 !important;
    outline-offset: 2px !important;
}

/* Small screens */
@media (max-width: 440px) {
    #communityChatWindow .lmtc-react-picker {
        gap: 5px !important;
        padding: 6px 8px !important;
    }

    #communityChatWindow .lmtc-react-picker .lmtc-react-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    #communityChatWindow .lmtc-react-btn::before {
        font-size: 17px !important;
    }
}
/* ==========================================
   LMTC — MODERN REACTION SUMMARY ICONS
   ========================================== */

/* Reaction badge */
#communityChatWindow .lmtc-reaction-summary {
    align-items: center !important;
    gap: 8px !important;

    padding: 4px 9px !important;

    background: #ffffff !important;
    border: 1px solid #e0eaf4 !important;
    border-radius: 999px !important;

    box-shadow: 0 2px 8px rgba(20, 75, 120, 0.08) !important;
}

/* Each icon and count */
#communityChatWindow .lmtc-summary-part {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;

    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

/* Icon size */
#communityChatWindow .lmtc-summary-icon {
    font-size: 14px !important;
    line-height: 1 !important;
}

/* Like */
#communityChatWindow .lmtc-icon-like {
    color: #1683c9 !important;
}

/* Love */
#communityChatWindow .lmtc-icon-love {
    color: #ef476f !important;
}

/* Haha */
#communityChatWindow .lmtc-icon-haha {
    color: #e6a321 !important;
}

/* Reaction number */
#communityChatWindow .lmtc-summary-count {
    color: #536e86 !important;
    font-family: "Inter", "Segoe UI", sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}

/* Highlight reaction selected by current user */
#communityChatWindow
.lmtc-summary-mine .lmtc-summary-count {
    color: #167dc2 !important;
}

/* ===================================================
   LMTC — EXTRA COMPACT REACTION UI
   Paste at the VERY END of community-chat.css
   =================================================== */

/* Small floating reaction container */
#communityChatWindow .lmtc-react-picker {
    width: max-content !important;
    min-width: 0 !important;
    max-width: 135px !important;

    gap: 3px !important;
    padding: 4px 6px !important;
    margin: 0 !important;

    border-radius: 14px !important;
    border: 1px solid #e3ebf3 !important;
    background: #ffffff !important;

    box-shadow: 0 5px 15px rgba(25, 65, 100, 0.10) !important;
}

/* Preserve hidden behavior */
#communityChatWindow .lmtc-react-picker[hidden] {
    display: none !important;
}

/* Small reaction buttons */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    min-height: 29px !important;

    padding: 0 !important;
    margin: 0 !important;

    border-radius: 9px !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
}

/* Smaller Font Awesome icons */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn::before {
    font-size: 15px !important;
    line-height: 1 !important;
}

/* Small hover effect */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn:hover {
    transform: translateY(-1px) !important;
    background: #f1f7fd !important;
}

/* Selected reaction */
#communityChatWindow
.lmtc-react-picker .lmtc-react-btn[aria-pressed="true"] {
    background: #e8f3ff !important;
    border-color: #c6e2f7 !important;
}

/* Compact reaction count badge */
#communityChatWindow .lmtc-reaction-summary {
    gap: 4px !important;
    padding: 2px 7px !important;
    margin-top: 3px !important;
    border-radius: 999px !important;
}

/* Small icons inside count badge */
#communityChatWindow .lmtc-summary-icon {
    font-size: 12px !important;
}

/* Small number */
#communityChatWindow .lmtc-summary-count {
    font-size: 10px !important;
}

/* Compact React and Reply text */
#communityChatWindow .lmtc-react-toggle,
#communityChatWindow .lmtc-msg-reply-btn {
    min-height: 23px !important;
    height: 23px !important;
    padding: 2px 6px !important;
    font-size: 10.5px !important;
}

/* Mobile */
@media (max-width: 440px) {
    #communityChatWindow .lmtc-react-picker {
        padding: 4px 5px !important;
        gap: 2px !important;
    }

    #communityChatWindow
    .lmtc-react-picker .lmtc-react-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }

    #communityChatWindow
    .lmtc-react-picker .lmtc-react-btn::before {
        font-size: 14px !important;
    }
}


/* ផ្ទាំង Chat: ទទឹង 380px និងកម្ពស់ 520px */
#communityChatWindow {
    position: fixed;
    top: auto !important;
    left: auto !important;
    right: 24px !important;
    bottom: 178px !important;

    width: min(380px, calc(100vw - 32px)) !important;
    height: min(520px, calc(100vh - 194px)) !important;
    height: min(520px, calc(100dvh - 194px)) !important;
    min-height: 0 !important;

    box-sizing: border-box;
    border-radius: 18px;
    overflow: hidden;
}

/* Header តូចល្មម */
#communityChatWindow .community-chat-header {
    min-height: 68px;
    padding: 10px 14px;
    gap: 10px;
}

#communityChatWindow .community-chat-header-left {
    gap: 9px;
}

#communityChatWindow .community-chat-header-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 17px;
}

#communityChatWindow .community-chat-header-info h3 {
    font-size: 15px;
    line-height: 1.35;
}

#communityChatWindow .community-chat-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

/* Profile */
#communityChatWindow .community-current-user {
    padding: 9px 14px;
}

#communityChatWindow .community-current-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

/* Scroll តែកន្លែងសារ */
#communityChatBody {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* ប្រអប់សរសេរសារ */
#communityChatWindow .community-chat-footer {
    padding: 10px;
}

#communityMessageInput {
    height: 42px;
    font-size: 16px;
}

#communityMessageSend {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}

/* Mobile */
@media (max-width: 600px) {
    #communityChatWindow {
        right: 12px !important;
        bottom: 158px !important;

        width: min(380px, calc(100vw - 24px)) !important;
        height: min(480px, calc(100vh - 174px)) !important;
        height: min(480px, calc(100dvh - 174px)) !important;
    }

    #communityChatWindow .community-chat-header-info h3 {
        font-size: 14px;
    }
}

/* អេក្រង់កម្ពស់ទាប / បង្វិលទូរស័ព្ទ */
@media (max-height: 500px) {
    #communityChatWindow {
        bottom: 12px !important;
        height: calc(100vh - 24px) !important;
        height: calc(100dvh - 24px) !important;
    }
}