/*
 * This file is part of Moodle - http://moodle.org/
 *
 * Moodle is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 */

#local-h5pquizpopup-overlay{display:none;position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,.62);padding:24px;box-sizing:border-box;align-items:center;justify-content:center}
#local-h5pquizpopup-overlay.is-open{display:flex}
#local-h5pquizpopup-modal{position:relative;width:min(1180px,96vw);height:min(900px,94vh);background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 20px 70px rgba(0,0,0,.35);display:flex;flex-direction:column}
.local-h5pquizpopup-close{position:absolute;top:8px;right:10px;z-index:120;width:38px;height:38px;border:0;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;font-size:28px;line-height:34px;font-weight:400;cursor:pointer;padding:0;text-align:center}
.local-h5pquizpopup-close:hover,.local-h5pquizpopup-close:focus{background:rgba(0,0,0,.82);outline:2px solid #fff;outline-offset:1px}
#local-h5pquizpopup-frame{width:100%;height:100%;flex:1;border:0;background:#fff}
body.local-h5pquizpopup-lock{overflow:hidden!important}

/* Loader for the initial page and every activity navigation inside the modal. */
#local-h5pquizpopup-loader{display:none;position:absolute;inset:0;z-index:110;background:rgba(255,255,255,.94);align-items:center;justify-content:center;flex-direction:column;gap:14px;font-size:16px;font-weight:600;color:#333}
#local-h5pquizpopup-modal.is-loading #local-h5pquizpopup-loader{display:flex}
.local-h5pquizpopup-spinner{width:44px;height:44px;border:4px solid rgba(0,0,0,.14);border-top-color:#333;border-radius:50%;animation:local-h5pquizpopup-spin .8s linear infinite}
@keyframes local-h5pquizpopup-spin{to{transform:rotate(360deg)}}

@media(max-width:768px){#local-h5pquizpopup-overlay{padding:0}#local-h5pquizpopup-modal{width:100vw;height:100vh;border-radius:0}.local-h5pquizpopup-close{top:6px;right:6px}}

/* v1.0.10: hide ONLY Moodle site chrome. Activity content/actions are left intact. */
html.local-h5pquizpopup-activityonly,
html.local-h5pquizpopup-activityonly body{margin:0!important;padding:0!important;background:#fff!important;min-height:100%!important}

/* Global top header/navigation. */
html.local-h5pquizpopup-activityonly body>nav.navbar,
html.local-h5pquizpopup-activityonly nav.navbar.fixed-top,
html.local-h5pquizpopup-activityonly .navbar.fixed-top,
html.local-h5pquizpopup-activityonly #page-navbar,
html.local-h5pquizpopup-activityonly .breadcrumb-nav,
html.local-h5pquizpopup-activityonly nav[aria-label="breadcrumb"],
html.local-h5pquizpopup-activityonly #nav-drawer,
html.local-h5pquizpopup-activityonly .drawer-toggles,
html.local-h5pquizpopup-activityonly [data-region="drawer"],
html.local-h5pquizpopup-activityonly [data-region="right-hand-drawer"],
html.local-h5pquizpopup-activityonly .context-header-settings-menu,
html.local-h5pquizpopup-activityonly #region-main-settings-menu,
html.local-h5pquizpopup-activityonly .settings-menu,
html.local-h5pquizpopup-activityonly #page-footer,
html.local-h5pquizpopup-activityonly footer{display:none!important}

/* Side blocks only. Never hide #region-main or any activity action area. */
html.local-h5pquizpopup-activityonly #block-region-side-pre,
html.local-h5pquizpopup-activityonly [data-region="blocks-column"]{display:none!important}

/* Let the native activity workspace fill the popup without changing its descendants. */
html.local-h5pquizpopup-activityonly #page-wrapper,
html.local-h5pquizpopup-activityonly #page,
html.local-h5pquizpopup-activityonly .main-inner,
html.local-h5pquizpopup-activityonly #page-content,
html.local-h5pquizpopup-activityonly #region-main-box,
html.local-h5pquizpopup-activityonly #region-main{max-width:none!important;width:100%!important;box-sizing:border-box!important}

html.local-h5pquizpopup-activityonly #page-wrapper,
html.local-h5pquizpopup-activityonly #page,
html.local-h5pquizpopup-activityonly .main-inner{margin:0!important;background:#fff!important}
html.local-h5pquizpopup-activityonly #page-content{margin:0!important;padding:18px 24px 24px!important}
html.local-h5pquizpopup-activityonly #region-main{margin:0!important;padding:0!important;border:0!important;background:#fff!important}

/* Activity title/description/info remain visible. */
html.local-h5pquizpopup-activityonly #page-header,
html.local-h5pquizpopup-activityonly .page-context-header,
html.local-h5pquizpopup-activityonly .activity-information,
html.local-h5pquizpopup-activityonly .activity-description,
html.local-h5pquizpopup-activityonly .feedback_description,
html.local-h5pquizpopup-activityonly .intro{visibility:visible!important;opacity:1!important}


/* v1.0.11: quiz attempt-only cleanup. The overview page is intentionally excluded. */
html.local-h5pquizpopup-quizattemptflow #page-header,
html.local-h5pquizpopup-quizattemptflow .page-context-header,
html.local-h5pquizpopup-quizattemptflow .secondary-navigation,
html.local-h5pquizpopup-quizattemptflow [data-region="secondary-navigation"],
html.local-h5pquizpopup-quizattemptflow .tertiary-navigation,
html.local-h5pquizpopup-quizattemptflow nav.moremenu,
html.local-h5pquizpopup-quizattemptflow .moremenu.navigation,
html.local-h5pquizpopup-quizattemptflow .activity-header{display:none!important}

/* Keep the actual quiz workspace full width after removing the attempt header. */
html.local-h5pquizpopup-quizattemptflow #page-content{padding-top:16px!important}
html.local-h5pquizpopup-quizattemptflow #region-main{margin-top:0!important}

/* Center Moodle Bootstrap quiz dialogs/preflight confirmations inside the activity popup. */
html.local-h5pquizpopup-quiz .modal.show,
html.local-h5pquizpopup-quiz .modal[aria-modal="true"]{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:16px!important;
}
html.local-h5pquizpopup-quiz .modal.show .modal-dialog,
html.local-h5pquizpopup-quiz .modal[aria-modal="true"] .modal-dialog{
    margin:0 auto!important;
    width:min(620px,calc(100vw - 32px))!important;
    max-width:620px!important;
}

.local-h5pquizpopup-loaded-marker {
    display: none !important;
}


/* v1.0.14: keep the activity modal above H5P when H5P itself is fullscreen. */
#local-h5pquizpopup-overlay.local-h5pquizpopup-fullscreen-host {
    z-index: 2147483647 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
}

#local-h5pquizpopup-overlay.local-h5pquizpopup-fullscreen-host #local-h5pquizpopup-modal {
    z-index: 2147483647 !important;
}
