/* ***************************************************************** */
/* REMOVES EXCESS WHITESPACE
/* ***************************************************************** */
html {
    max-height: fit-content !important;
}


/* HIDE SHIT UNLESS SHOWN VIA JAVASCRIPT (by adding class "loaded") */
body:not(.factorysettings):not(.loaded) .drawer-toggler {
    display: none;
}

body:not(.factorysettings):not(.loaded) .drawer {
    display: none;
}



/* ***************************************************************** */
/* HIDE ALL DEFAULT BLOCKS (EXCEPT EXCEPTIONS) 
/* ***************************************************************** */
body:not(.factorysettings) .drawer [class*="block_"].block:not(.show) {
    display: none;
}


/* ***************************************************************** */
/* EXCEPTIONS TO BLOCK HIDING 
/* ***************************************************************** */
body:not(.factorysettings) .drawer #mod_assign_timelimit_block,
body:not(.factorysettings) .drawer .block_fake,
/*e.g., timelimit block*/
body:not(.factorysettings) .drawer .block_calendar_upcoming,
body:not(.factorysettings) .drawer .block_calendar_month,
body:not(.factorysettings) .drawer .block_news_items,
body:not(.factorysettings) .drawer .block_online_users,
body:not(.factorysettings) .drawer .block_search_forums,
body:not(.factorysettings) .drawer .block_html,
body:not(.factorysettings) .drawer .block_accessreview {
    display: block !important;
}

/* ***************************************************************** */
/* ADDING NEW BLOCKS 
/* ***************************************************************** */
body:not([user-id="21433x"]).editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock"] {
    display: none;
}

body[user-id="21433"].editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock"] {
    opacity: .5;
}

body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=calendar_upcoming"],
body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=calendar_month"],
body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=news_items"],
body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=online_users"],
body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=search_forums"],
body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=html"],
body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock=accessreview"] {
    display: block !important;
    opacity: 1 !important;
}

body.editing:not(.factorysettings) .modal .list-group a.list-group-item.list-group-item-action[href*="bui_addblock"] {
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: 0.5em;
    margin: 1px;
}





/* ***************************************************************** */
/* CALENDAR 
/* ***************************************************************** */
body:not(.factorysettings) .drawer .block_calendar_month .card-text .header.p-1 {
    display: none !important;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .calendarwrapper tr {
    display: flex;
    max-height: 40px;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .calendarwrapper td {
    border: 1px dotted #dee2e6
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .calendarwrapper td>div {
    max-height: 30px;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .header {
    overflow: hidden;
    background: #1a365d;
    color: white;
    padding: 5px 0;
    text-align: center;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .footer {
    display: none !important;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .calendar-controls a {
    text-decoration: none !important;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .calendar-controls .current:before {
    display: none;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text td {
    padding: 2px;
    text-align: center !important;
}

body:not(.factorysettings) .drawer .block_calendar_month .card-text .maincalendar .calendarmonth td.hasevent .day-number-circle {
    background: #FF5722;
    border-radius: 50%;
    color: white !important;
    font-weight: 600;
}



/* ***************************************************************** */
/* ANNOUNCEMENTS 
/* ***************************************************************** */
body:not(.factorysettings) .drawer .block_news_items .newlink,
body:not(.factorysettings) .drawer .block_news_items .name {
    display: none;
}

body:not(.factorysettings) .drawer .block_news_items li.post {
    display: flex;
    margin: 2px 0;
    border: 1px dotted #dee2e6;
    font-size: 10pt;
    color: #262626;
}

body:not(.factorysettings) .drawer .block_news_items li.post .head {
    max-width: 120px;
    background: #f2f2f2;
}

body:not(.factorysettings) .drawer .block_news_items li.post>div {
    flex: 1;
    padding: 5px;
}

body:not(.factorysettings) .drawer .block_news_items li.post .info a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
}

body:not(.factorysettings) .drawer .block_news_items li.post .info:hover {
    background: #2196f3;
    color: white;
}





/* ***************************************************************** */
/* CARD SCROLLING & MAX HEIGHT 
/* ***************************************************************** */
body:not(.factorysettings) .drawer .block {
    overflow: auto
}

body:not(.factorysettings) .drawer .block .card-body {
    padding: 0 0 1rem 0 !important;
}

body:not(.factorysettings) .drawer .block .card-body h5 {
    padding: .5rem 1rem !important;
    background: #404a56;
    color: white;
    display: block !important;
    width: 100%;
    margin: 0 !important;
}

body:not(.factorysettings) .drawer .block .card-text {
    max-height: 300px;
    overflow: auto;
    padding: 1rem;
    margin: 0 !important;
}

/*Tool Tip: Prevent from fucking with Button*/




/* ***************************************************************** */
/* CLOSE BUTTON 
/* ***************************************************************** */
body:not(.factorysettings) .drawer.drawer-right .drawertoggle {
    width: 100%;
    display: flex;
    background: rgb(169, 0, 0);
    border-radius: 0;
    color: white;
    display: flex;
    align-items: center;
    height: 100%;
}

body:not(.factorysettings) .drawer.drawer-right .drawertoggle:hover {
    background: #940001 !important;
}

body:not(.factorysettings) .drawer.drawer-right .drawertoggle i {
    width: 100%;
    display: flex;
    align-items: center;
}

body:not(.factorysettings) .drawer.drawer-right .drawertoggle i:after {
    content: "Close Drawer";
    font-weight: 700;
    display: block;
    width: 100%;
    font-size: 14pt;
    text-align: left;
    margin-left: 10px;
}



/* ***************************************************************** */
/* FIX CARD BORDER ON SMALL SCREENS 
/* ***************************************************************** */
body:not(.factorysettings) .drawer.drawer-right .block.card {
    border: 1px solid rgba(0, 0, 0, .125) !important;
}



/* ***************************************************************** */
/* BLOCK CONTROLS
/* ***************************************************************** */
body.editing:not(.factorysettings) .drawer.drawer-right .block-controls {
    position: absolute;
    top: 0;
    right: 0;
    margin: 5px;
}

body.editing:not(.factorysettings) .drawer.drawer-right .block-controls :is(.moodle-core-dragdrop-draghandle, .dropdown-toggle) {
    color: white;
}


/* ***************************************************************** */
/* OTHER */
/* ***************************************************************** */

@media (max-width: 768px) {
    body:not(.factorysettings) .drawer.drawer-right {
        max-width: 100vw !important;
    }

    body:not(.factorysettings) .drawer.drawer-right.show .drawerheader,
    body:not(.factorysettings) .drawer.drawer-right.show .drawercontent {
        width: calc(100% - 65px) !important;
    }
}

body:not(.factorysettings) .drawer.drawer-right {
    z-index: 1050 !important;
    background: rgba(0, 0, 0, .5);
    max-width: calc(100vw - 84px);
    top: 0;
    height: 100vh;
    pointer-events: all;
}

body:not(.factorysettings) .drawer.drawer-right.show {
    width: 100vw !important;
}

body:not(.factorysettings) .drawer.drawer-right.show .drawerheader,
body:not(.factorysettings) .drawer.drawer-right.show .drawercontent {
    width: 100%;
    max-width: 100%;
    right: 0;
    position: absolute;
    pointer-events: all;
}





body:not(.factorysettings) .drawer.drawer-right.show .drawercontent {
    background: #f8f8f8;
    padding: 10px;
    top: 60px;
}

body:not(.factorysettings) .drawer.drawer-right.show .drawercontent aside {
    display: flex;
    flex-wrap: wrap;
}

body:not(.factorysettings) .drawer.drawer-right .drawercontent aside section {
    flex: 300px;
    margin: 10px;
    background: white;
}

@media (min-width: 1000.1px) {
    body:not(.factorysettings) .drawer.drawer-right .drawercontent aside section {
        flex: 400px;
    }
}

body:not(.factorysettings) .drawer.drawer-right .drawertoggle {
    width: 100%;
    height: 100%;
    margin: 0;
    color: white;
    text-align: right;
}