/*
 * This css code fixes css framework conflicts between MUI and Joomla (Bootstrap/Atum/Cassiopeia).
 */

/* MUI components get top/bottom margin from Bootstrap's `p { margin-bottom: 1rem }` — reset it */
#nexttask-root p {
    margin: 0;
}

/* In admin, the component renders its own toolbar and controls — hide Joomla's subhead */
body.com_nexttask #subhead-container {
    display: none;
}

/* Cassiopeia and Atum ship `[role="tooltip"]:not(.show) { display: none; ... }` (Bootstrap convention).
   MUI never adds Bootstrap's `.show` class to its poppers, so that rule would hide every MUI
   tooltip and overwrite its styling. We restore MUI's behaviour for popper portals only. */
.MuiPopper-root[role="tooltip"] {
    display: block !important;
    z-index: 1500 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    right: auto !important;
    max-width: none !important;
    text-align: inherit !important;
}

/*
 * Colour scheme for native UI and controls.
 */
#nexttask-root[data-bs-theme='dark'],
#nexttask-root [data-bs-theme='dark'],
[data-bs-theme='dark'] #nexttask-root {
    color-scheme: dark;
}

#nexttask-root[data-bs-theme='light'],
#nexttask-root [data-bs-theme='light'],
[data-bs-theme='light'] #nexttask-root {
    color-scheme: light;
}

/*
 * Fullscreen (?tmpl=component): the app is the whole page, so the template's component-page body
 * padding goes. Static CSS rather than script, so the first frame is already right (an effect ran
 * after the first paint: the page jumped, and the board measured itself before the jump).
 * Only the component page that holds the app: `contentpane component` is the body class of both
 * Atum's and Cassiopeia's component.php.
 */
body.contentpane.component:has(#nexttask-root) {
    margin: 0;
    padding: 0;
}
