/*
  Goftino Chat Moodle plugin styles.
  These rules keep the widget stable in LTR/RTL pages and make the opened chat box responsive on mobile.
*/
html.pafco-goftino-positioning #goftino_w,
html.pafco-goftino-positioning iframe#goftino_w {
    visibility: hidden !important;
    opacity: 0 !important;
}

html.pafco-goftino-rtl-open #goftino_w,
html.pafco-goftino-rtl-open iframe#goftino_w {
    left: var(--pafco-goftino-open-side, 65px) !important;
    right: auto !important;
    bottom: var(--pafco-goftino-open-bottom, 20px) !important;
}

html.pafco-goftino-open #goftino_w,
html.pafco-goftino-open iframe#goftino_w {
    max-width: calc(100vw - 20px) !important;
    box-sizing: border-box !important;
}

@media (max-width: 576px) {
    html.pafco-goftino-open #goftino_w,
    html.pafco-goftino-open iframe#goftino_w {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(100vh - 90px) !important;
        height: calc(100dvh - 90px) !important;
        max-height: calc(100vh - 90px) !important;
        max-height: calc(100dvh - 90px) !important;
        bottom: 20px !important;
        box-sizing: border-box !important;
    }

    html.pafco-goftino-open:not(.pafco-goftino-rtl-open) #goftino_w,
    html.pafco-goftino-open:not(.pafco-goftino-rtl-open) iframe#goftino_w {
        right: 10px !important;
        left: auto !important;
    }

    html.pafco-goftino-open.pafco-goftino-rtl-open #goftino_w,
    html.pafco-goftino-open.pafco-goftino-rtl-open iframe#goftino_w {
        left: 10px !important;
        right: auto !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    html.pafco-goftino-open #goftino_w,
    html.pafco-goftino-open iframe#goftino_w {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        height: calc(100vh - 24px) !important;
        height: calc(100dvh - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
        bottom: 12px !important;
        box-sizing: border-box !important;
    }

    html.pafco-goftino-open:not(.pafco-goftino-rtl-open) #goftino_w,
    html.pafco-goftino-open:not(.pafco-goftino-rtl-open) iframe#goftino_w {
        right: 12px !important;
        left: auto !important;
    }

    html.pafco-goftino-open.pafco-goftino-rtl-open #goftino_w,
    html.pafco-goftino-open.pafco-goftino-rtl-open iframe#goftino_w {
        left: 12px !important;
        right: auto !important;
    }
}
