/*
 * TPSTA UI fixes — Moodle Boost theme shims.
 *
 * 2026-05-11: Course-edit activity action menus get clipped/covered by
 * sibling activity tiles, making it hard to click "Delete". Two root
 * causes: parents set overflow:hidden, and the open .dropdown-menu sits
 * at the same z-index as later activity tiles. Force overflow:visible on
 * the relevant ancestors and lift the open menu above the rest.
 */

.course-content,
.course-content > ul.section,
.course-content > ul.section > li.section,
.course-content > ul.section > li.section .content,
.course-content > ul.section > li.section .summary,
.course-content ul.section,
.course-content ul.section > li.activity,
.course-content ul.section > li.activity > div,
.course-content li.activity .actions {
    overflow: visible !important;
}

/* Lift the action-menu dropdown above every adjacent activity tile.
   1080 sits above .modal-backdrop's 1040 but below modals' 1050+. */
.action-menu .dropdown-menu,
.action-menu .dropdown-menu.show,
.course-content .action-menu .dropdown-menu,
.course-content .activity .action-menu .dropdown-menu,
.course-content .section .action-menu .dropdown-menu {
    z-index: 1080 !important;
}

/* Ensure the action-menu trigger itself can claim a stacking context so
   its dropdown isn't ambushed by hover targets in adjacent tiles. */
.course-content .activity .actions,
.course-content .activity .action-menu {
    position: relative;
    z-index: 1;
}

/* When the menu is open, raise the whole activity row so the dropdown
   doesn't fight pointer events with the next activity. */
.course-content .activity:has(.action-menu .dropdown-menu.show),
.course-content .activity.action-menu-shown {
    z-index: 100;
    position: relative;
}

/*
 * 2026-05-28: Hide the "Get the mobile app" footer link.
 *
 * Boost renders <a class="mobilelink" href="https://download.moodle.org/mobile?...">
 * Get the mobile app</a> in the page footer. The link text + href both
 * leak the underlying product name "Moodle" on every page (login,
 * dashboard, course view, ...), which contradicts the brand rule
 * (memory: project_lms_brand — Classroom is "TPSTA Classroom" in UI).
 * Hiding it client-side via this shim is the lowest-risk path; no
 * core Moodle edits, no theme fork.
 */
a.mobilelink,
.footer-section a[href*="download.moodle.org"] {
    display: none !important;
}


/*
 * 2026-06-09: Security courses (25/26) seat-time countdown banner.
 * Rendered by local_tpsta_uifix_before_standard_top_of_body_html. Tells the
 * student how much course time remains before the customcert (requiredtime) unlocks.
 */
.tpsta-seattime {
    max-width: 1100px;
    margin: 12px auto;
    padding: 12px 16px;
    border-radius: 8px;
    background: #001124;
    color: #f8fafc;
    border-left: 5px solid #f2b70a;
    font-size: 14px;
}
.tpsta-seattime-head { font-weight: 700; color: #f2b70a; margin-bottom: 6px; }
.tpsta-seattime-detail { color: #cbd5e1; margin-top: 6px; font-size: 13px; }
.tpsta-seattime-bar { height: 10px; background: #11233a; border-radius: 6px; overflow: hidden; }
.tpsta-seattime-bar > span { display: block; height: 100%; background: #f2b70a; border-radius: 6px; transition: width .3s ease; }
.tpsta-seattime-done { border-left-color: #1f9d57; }
.tpsta-seattime-done .tpsta-seattime-head { color: #7fdca0; }
.tpsta-seattime-done .tpsta-seattime-bar > span { background: #1f9d57; }


/*
 * 2026-06-09: keep the seat-time banner visible while scrolling the course overview.
 * Pin it to the bottom-center of the viewport. (marker: tpsta-seattime-fixed)
 */
.tpsta-seattime {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 1100px;
    margin: 0;
    z-index: 1030;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
