/* =========================================================
   CHATNET RESPONSIVE CSS
   KARMA EVENTS CLUB - MOBILE OPTIMIZED
   ========================================================= */


/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 320px) {

    .messages {
        min-width: 0 !important;
        width: 100%;
    }

    .notifications-panel-card {
        min-width: 250px;
        max-width: calc(100vw - 20px);
    }

}


/* =========================================================
   MOBILE / TABLET
   ========================================================= */

@media (max-width: 768px) {

    /* -----------------------------------------------------
       MAIN MOBILE LAYOUT
       ----------------------------------------------------- */

    html,
    body {
        width: 100%;
        max-width: 100%;
        height: 100%;
        overflow: hidden;

        /* Disable browser smooth scrolling */
        scroll-behavior: auto !important;

        /* Prevent horizontal touch movement */
        overscroll-behavior-x: none;
    }


    #wrapper,
    .wrapper {
        width: 100%;
        max-width: 100%;
        height: 100%;
        overflow: hidden;
    }


    .page-content-wrapper {
        min-width: 0 !important;
        width: 100%;
        max-width: 100%;
        min-height: 0;
        overflow: hidden;
    }


    .main-panel {
        min-width: 0 !important;
        min-height: 0 !important;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }


    .main-tab-content {
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
    }


    .main-tab-pane {
        width: 100%;
        min-width: 0;
        min-height: 0 !important;
        overflow-x: hidden;
    }


    .main-tab-pane.active {
        min-height: 0 !important;
    }


    /* -----------------------------------------------------
       CHAT SCROLL CONTAINER
       ----------------------------------------------------- */

    .chat-scroll {
        width: 100%;
        min-width: 0;
        min-height: 0 !important;
        height: 100%;
        overflow: hidden !important;
    }


    /* -----------------------------------------------------
       ACTUAL MESSAGE SCROLLING AREA
       ----------------------------------------------------- */

    .messages {
        width: 100%;
        max-width: 100%;
        min-width: 0 !important;

        height: 100%;
        min-height: 0 !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        /* Native Android / iOS touch scrolling */
        -webkit-overflow-scrolling: touch;

        /* Finger movement should scroll vertically */
        touch-action: pan-y;

        /* Prevent parent containers from stealing scrolling */
        overscroll-behavior-y: contain;

        /* No animated scrolling */
        scroll-behavior: auto !important;

        /* Better mobile rendering */
        backface-visibility: hidden;
    }


    /* -----------------------------------------------------
       MESSAGE ELEMENTS
       ----------------------------------------------------- */

    .messages ul,
    .messages ul li,
    .messages .cht,
    .cht,
    .message-data,
    .message-html,
    .chat-txt {
        touch-action: pan-y;
    }


    /* Don't allow images to interfere with finger dragging */

    .messages img,
    .chat-img img,
    .chat-gif img,
    .chat-sticker img {
        max-width: 100%;

        -webkit-user-drag: none;
        user-select: none;

        touch-action: pan-y;
    }


    /* -----------------------------------------------------
       MESSAGE EDITOR
       ----------------------------------------------------- */

    .editor-wrap,
    .editor-container,
    .editor-col {
        max-width: 100%;
    }

    .editor-container {
        touch-action: manipulation;
    }


    /* -----------------------------------------------------
       RIGHT USER PANEL
       ----------------------------------------------------- */

    .rightbar-wrapper {
        display: none;
        position: absolute;

        right: 0;
        top: 0;

        /* Avoid "transition: all" on mobile */
        transition: transform 0.2s ease-out;

        will-change: transform;
    }


    body.sb-rightnav-toggled #wrapper .rightbar-wrapper {
        display: block;
        right: 0;
        margin-right: 0;
    }


    /* RTL right panel */

    .rtl body.sb-rightnav-toggled #wrapper .rightbar-wrapper {
        left: 0;
        right: auto;

        margin-left: 0;
        margin-right: auto;
    }


    /* -----------------------------------------------------
       MAIN CONTENT PADDING
       ----------------------------------------------------- */

    .main-block-padding {
        padding: 0.5rem;
    }


    /* -----------------------------------------------------
       OTHER SCROLLING PANELS
       ----------------------------------------------------- */

    .room-list,
    .sidebar-height-fix,
    .sidebar-height-fix-mt48,
    .height-scroll,
    .height-scroll-rpanel,
    .gifs,
    .sticker-list {
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        overscroll-behavior-y: contain;
        scroll-behavior: auto !important;
    }

}


/* =========================================================
   MOBILE SIDEBAR
   ========================================================= */

.sb-sidenav-toggled .room-bar {
    display: none;
}


.sb-sidenav-toggled .sidebar-wrapper {
    margin-left: -19.5rem;
}


/* RTL sidebar */

.rtl .sb-sidenav-toggled .sidebar-wrapper {
    margin-right: -19.5rem;
    margin-left: 0;
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 425px) {

    body:not(.sb-sidenav-toggled) .channel-bar {
        width: calc(100vw - 4.2rem);
        max-width: calc(100vw - 4.2rem);
    }

}


/* =========================================================
   END CHATNET RESPONSIVE MOBILE FIX
   ========================================================= */