/**
 *
 * generic stuff for each SteApp
 *
 */

:root
{
    --main-border-radius: 8px;
    --ons-col-min-width: 300px;
}

body
{
    /*
        fixing "Ignored attempt to cancel a touchmove event ..."
            when pan/zoom with map (openlayers)
    */
    touch-action: none !important;

    /* from onsen: */
    font-family: -apple-system,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;

    background-color: rgba(var(--main-bg-color), 1);
}

html, body
{
    width: 100vw;
    height: 100vh;
}

#first_page
{
    height: 100vh;
    width: 100vw;
}

#first_page .background, #first_page .content
{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

ons-page .background,
#first_page .background
{
    background-color: rgba(var(--main-bg-color), 1);
}

#first_page .content
{
    text-align: center;
}

/* add pointer for browser */
button, .button, .tabbar__button, .toolbar-button, .back-button, .alert-dialog-button, .fab, a, .clickable, [tappable], select, option, .tappable, input[type="radio"], label
{
    cursor: pointer !important;
    outline:none;
}

.button
{
    margin: 8px;
}

.hide
{
    display: none !important;
}

/**
 * outdated, migrate to fullscreen?
 */
div.fullsize
{
    position: absolute;
    height: 100%;
    width: 100%;
    text-align: center;
}
div.fullsize div.centercenter
{
    position: absolute;
    top: 50%;
    left: 50%;
    display:inline;
    transform: translate(-50%, -50%);
}

/**
 * should be the default for 1 div which fills the whole screen on mobile
 */
div.fullscreen
{
    position: relative; /* for childs to be absolute in this div */
    padding: 10px;
    max-width: 500px;
    margin: auto;
}

/**
 * round floating buttons with icon (i) in the center
 */
.roundbuttons .button, .roundbuttons .button:active, .roundbuttons .button[disabled]
{
    position: relative;
    width: 50px;
    height: 50px;
    box-shadow: 0 3px 6px rgba(var(--main-shadow-color), 0.12);

    border-width: 1px;
    border-style: solid;
    border-radius: 100%;
    border-color: rgba(var(--main-border-color), 1);

    background-color: rgba(var(--main-bg-color), 1);
    /*color: rgba(var(--main-font-color), 1);*/
}

.roundbuttons .button:active
{
    opacity: 1; /* overwrite onsen default */
    background-color: rgba(var(--second-bg-color), 1);
}

.roundbuttons .button ons-icon
{
    margin: 0.2em;
    color: black;
}
.roundbuttons .button i
{
    /*color: rgba(var(--main-font-color), 1);*/
    padding: 0;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    display:inline;
    font-size: 1.4em;
    transform: translate(-50%, -50%);
}

.roundbuttons .mini .button i
{
    font-style: normal;
}

.roundbuttons .button i.ri-fw::before, .roundbuttons .button .spinner
{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.roundbuttons .fab.button
{
    font-size: 17px;
    margin: 8px;
}

.roundbuttons .button.mini, .roundbuttons .mini .button
{
    /* with "important" the buttons will stay this size on click/press */
    height: 40px !important;
    width: 40px !important;
}

.roundbuttons .speed-dial__item--mini.button
{
    position: absolute;
    height: 40px;
    width: 40px;
    margin: 8px;
}

/**
 * mini float buttons
 */
.minibuttons .button
{
    padding: 2px;
    line-height: normal;
    /* offset-x | offset-y | blur-radius | spread-radius | color */
    box-shadow: 0 0 0 3px rgba(var(--main-bg-color), 0.6);
    margin-top: 3px;
}

.minibuttons .button i
{
    display: block;
}

.loading .spinner, #loading .spinner
{
    width: 6em;
    height: 6em;
    position: absolute;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 100%;
    background-color: rgba(var(--main-bg-color), 0.8);
}

/**
 * popover
 */
.popover .button
{
    margin: 0;
}

.popover h5
{
    font-size: 1em;
    margin: 1em;
    margin-top: -0.1em;
}

.popover, .alert-dialog
{
    --filter: drop-shadow(0px 0px 1px rgba(var(--main-shadow-color), 1));
    filter: var(--filter);
    -webkit-filter: var(--filter);
}

/**
 * allow text select
 */
.selectable:not(input):not(textarea):not(select)
{
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    user-select: all;

    width: 100%;
    overflow: hidden;
    /*text-overflow: ellipsis;*/
    word-break: break-word;
}

/**
 * close "x" for popups/modals
 */
.button.close, .button.close:active
{
    position: absolute;
}

.button.close i
{
    font-size: 1.4em;
    color: rgba(var(--main-color-red), 1);
}

.popover .button.close, .popover .button.close:active
{
    top: -0.1em;
    right: -0.2em;
}

.page .button.close, .page .button.close:active, .modal .button.close, .modal .button.close:active
{
    top: 10px;
    right: 10px;
}

/* close button on a fullscreen page, with background */
.page .fullscreen .button.close, .page .fullscreen .button.close:active
{
    margin: 0;
}

/* close button in a card */
.card .button.close, .card .button.close:active
{
    top: -10px;
    right: -12px;
}

.progress.global
{
    opacity: 0;
    position: absolute;
    top: 85%;
    width: 100%;
}

/*
 * list icons
 */
#page_settings ons-list-item .left i
{
    font-size: 1.8em;
}

#splitter_menu .logo
{
    /*
    text-align: center;
    padding: 5px
    */
    height: var(--toolbar-height);
}
#splitter_menu .logo img
{
    /*width: clamp(50px, 4vw, 200px);
     * splitter has a fixed width, so do i
     */
    width: 50px;
    display: none;
}

#splitter_menu .list
{
    border-top-left-radius: var(--main-border-radius);
    border-bottom-left-radius: var(--main-border-radius);
}

/**
 * generic listcontainer
 */
.listcontainer
{
    background: transparent;
    will-change: opacity;
}

.listcontainer .openme
{
    transition: 0.8s;
    transition-property: transform;
    transform: translateY(80px);
}
.listcontainer .openme.visible
{
    transform: translateY(0);
}

.listcontainer .list
{
    height: 100%;
    overflow: auto; /* browser: hidden */
    background-color: rgba(var(--main-bg-color), 1);

    opacity: 0;
    transition: 0.8s;
}

.listcontainer div.offscreen .button
{
    margin-top: 0;
}

.listcontainer div.offscreen div.gesture
{
    position: absolute;
    top: 50%;
    margin-left: 8px;
    border-radius: var(--main-border-radius);
    background-color: rgba(var(--main-bg-color), 1);
}

.listcontainer div.offscreen div.gesture img
{
    padding: 5px;
    padding-bottom: 0; /* there is some anying extra space below the img */
    width: 2em;
}

.listcontainer.bottom
{
    position: absolute;
    bottom: -100vh;
    display: inline-block;

    transition: 0.8s;
}

.listcontainer.bottom.visible
{
    bottom: 0;
}

.listcontainer.visible .list
{
    opacity: 1;
}

.listcontainer.left
{
    left: 0;
}

.listcontainer.right
{
    right: 0;
}

.listcontainer.left div.offscreen
{
    float: right;
}

.listcontainer.left div.offscreen .button
{
    position: absolute;
}

.listcontainer.right div.offscreen
{
    float: left;
}

.listcontainer .header
{
    text-align: center;
    text-transform: uppercase;
    font-size: 14px;
    min-height: 24px;
    line-height: 25px;
    background-color: rgba(var(--main-bg-color), 1);
}

.listcontainer.left .list, .listcontainer.left .header
{
    border-top-right-radius: var(--main-border-radius);
}

.listcontainer.right .list, .listcontainer.right .header
{
    border-top-left-radius: var(--main-border-radius);
}

.listcontainer.roundbuttons .mini .button
{
    border-width: 1px;
    border-style: solid;
    font-size: 0.7em;
    background-color: rgba(var(--second-bg-color), 1);
}

/* popover should be non-intrusive */
.popover-mask
{
    background: none;
}

/**
 * generic card
 */
.card .title
{
    margin-top: 0;
}

.card .content
{
    font-size: inherit;
    padding: 0;
    max-height: 68vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.card .content p
{
    margin: 0;
}

.card .content p:nth-child(2), .card .content p:nth-of-type(2)
{
    margin-top: 12px;
}

.card .list-item
{
    padding-left: 0;
}

.card .list-item .expandable-content
{
    line-height: 1.5em;
    text-align: justify;
    padding-right: 12px;
    padding-left: 12px;
    font-size: smaller;
    margin-bottom: 6px;

    width: 100%;

    /*
    border-width: 1px;
    border-style: solid;
    border-color: rgba(var(--main-border-color), 1);
    */
    /*background-color: rgba(var(--second-bg-color), 1);*/

    /* defined in default/onsen.css:
    border-radius: var(--main-border-radius);
    background-image: linear-gradient(to bottom, transparent 10%, rgba(var(--second-bg-color), 1) 90%);
    */
}

/* break button text if it is too large! */
.card .button
{
    white-space: inherit;
}

/**
 * max height / width of an card in a modal
 */
.card
{
    /* small screens <= 400px */
    width: 300px;
    max-height: 98vh;

    transition: 0.4s;
}

.card img
{
    width: 100%;
    transition: 0.4s;
}

@media (min-width: 400px) and (min-height: 500px)
{
    .card
    {
        width: 360px;
        max-height: 90vh;
    }
}

@media (min-width: 600px) and (min-height: 700px)
{
    .card
    {
        width: 470px;
        max-height: 90vh;
    }
}

/**
 * generic list
 * @NOTE you can still use onsen like "nodivider/longdivier"
 */
.list.rounded
{
    border-radius: var(--main-border-radius);
}

.list .list-item.transparent, .list.transparent
{
    background: none;
}

.list-item
{
    background-color: rgba(var(--main-bg-color), 1);
    pointer-events: all; /* onsen sets it to "none" */
}

.list-item .left i
{
    font-size: 1.4em;
}

/* list divider:
 *  you can set it for the whole list ons-list modifier="longdivider" or for each list-item
 */
.list:not([modifier~="nodivider"]) .list-item:not(.hide):not(:last-child):not([modifier~="nodivider"]):not([expanded])::after
{
    position: absolute;
    bottom: 1px;
    left: 20%;
    height: 2px;
    width: 70%;
    content: "";
    background-color: rgba(var(--main-border-color), 1);
    transition: background-color 100ms ease-out;
}

.list:not([modifier~="nodivider"]) .list-item:not(.hide):not(:last-child):not([modifier~="nodivider"])[modifier~="longdivider"]:not([expanded])::after,
.list[modifier~="longdivider"]:not([modifier~="nodivider"]) .list-item:not(.hide):not(:last-child):not([modifier~="nodivider"]):not([expanded])::after
{
    left: var(--main-border-radius);
    right: var(--main-border-radius);
    width: auto;
}

/*
 * fix onsen list
 * "tappable": ons-list item adds a box-shadow and a light bg color .. can fix it only with doing it myself
 */
/* leave devider color - 6.Nov.2022
.list-item.tappable:not(.hide):not(:last-child):not([modifier~="nodivider"]):not([expanded]):hover::after
{
    background-color: rgba(var(--main-bg-color), 1);
}
*/

.list-item.tappable
{
    transition: background-color 100ms ease-out, border-color 500ms ease-out;
}

/*
 * only hover the titles (which can be the whole center), not subtitles
 */
@media (any-pointer: fine), @media (any-pointer: coarse)
{
    .list-item.tappable:hover > .list-item__center:not(:has(.list-item__title)),
    .list-item.tappable:hover > div > .list-item__center:not(:has(.list-item__title)),
    .list-item.tappable:hover > .list-item__center > .list-item__title,
    .list-item.tappable:hover > div > .list-item__center > .list-item__title
    {
        text-decoration: underline;
    }
}

.list-item.ripple
{
    background-position: center;
    transition: background 0.8s, border-color 500ms ease-out;
}

.list-item.ripple:hover
{
    background: rgba(var(--main-bg-color), 1) radial-gradient(circle, transparent 1%, rgba(var(--second-bg-color), 1) 1%) center/15000%;
}

.list-item.ripple:active
{
    background-size: 100%;
    transition: background 0s;
}

.list-item .expandable-content
{
    margin-left: 3px;
    margin-right: 3px;
    width: auto; /* reset onsen 100% */

    border-radius: var(--main-border-radius);
    background-image: linear-gradient(to bottom, transparent 10%, rgba(var(--second-bg-color), 1) 90%);
}

/**
 * generic card
 */
.card > .title
{
    /* force icon=text baseline */
    display: flex;
}

.card .content .buttonrow
{
    padding-top: 12px;
    display: flex;
}

.card .content .buttonrow .button
{
    margin: 0;
    flex-basis: auto;
    flex-grow: 1;
    padding: 0;
}

/**
 * InfoPopover
 */
.InfoPopover ul
{
    text-align: left;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.InfoPopover ul li
{
    margin-bottom: 0.6em;
}

/**
 * alert dialog restrict image to width
 */
.alert-dialog-content img
{
    width: 100%;
}

/**
 * overwrite action sheet mini text
 */
.action-sheet-title:first-child
{
    font-size: 16px;
}

/*
 * absolut center/center positing
 */
.center_center
{
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/**
 * mark external links
 */
a.external
{
    text-decoration: none;
}
a.external::after, .external::after
{
    position: relative;
    top: -3px;
    left: 3px;
    font-family: 'remixicon' !important;
    content: "\ecaf";
    font-size: smaller;
    color: rgba(var(--main-font-color), 1);
}

/**
 * modal/popover/splitter background
 */
.modal, ons-splitter-mask
{
    background-color: rgba(var(--main-bg-color), 0.5);
}

/**
 * adds the default "quiet" button text color to another element and anchors
 */
.fakebutton, a, a:active
{
    color: var(--button-quiet-color);
}

/**
 * class wrapper for the colors
 */
i.green
{
    color: rgba(var(--main-color-green), 1);
}

i.red
{
    color: rgba(var(--main-color-red), 1);
}

/**
 * alert colors
 */
.info
{
}

.warn
{
}

.fatal, .error
{
    background-color: rgba(var(--main-color-red), 1);
}
