/*
 * Idle session warning bar of the map pages. Native elements only - an ExtJS
 * window would capture the focus and interrupt the geometry digitizing, and
 * Mobile.aspx does not load the full ExtJS.
 */

.gpz-idle-bar {
    /*
     * The bar floats above the content and reserves no space: a body padding
     * would not move the absolutely positioned ExtJS viewport, so the map canvas
     * would drift. The ExtJS 2.2.1 windows start at z-index 9000.
     */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30000;

    /*
     * The bar covers the top strip of the map, where the map toolbar sits, so
     * pointer events go straight through it; only the controls of the 'action'
     * mode take them back.
     */
    pointer-events: none;

    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 48px;
    padding: 6px 16px;

    /*
     * #c12e2a - background of the DevExtreme rule
     * ".dx-button-mode-contained.dx-button-danger.dx-state-focused"
     * (src/themes/theme.additional.css), the pressed shade of #d9534f; white on
     * it reaches 5.69:1, on the resting #d9534f only 3.96:1.
     */
    background-color: #c12e2a;
    color: #ffffff;
    border-bottom: 1px solid #972421;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);

    font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Verdana, sans-serif;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.2px;

    /* Slides out of the top edge when it appears. */
    animation: gpz-idle-bar-slide-in 220ms ease-out;
}

@keyframes gpz-idle-bar-slide-in {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.gpz-idle-bar__icon {
    flex: 0 0 auto;
    margin-right: 8px;
    font-size: 18px;
    line-height: 1;
}

.gpz-idle-bar__text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
}

.gpz-idle-bar__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: 16px;

    /* The one interactive part of the bar takes the pointer back. */
    pointer-events: auto;
}

/*
 * Shape and size of the DevExtreme button of the React layer, drawn by hand.
 * Contrast (WCAG 2.x): #c12e2a on #ffffff 5.69:1 resting, on #f0f0f0 4.99:1
 * hover, on #e8e8e8 4.64:1 pressed (>= 4.5:1 required; #e0e0e0 would give
 * 4.31:1), #ffffff on #c12e2a 5.69:1 for the focus ring (>= 3:1 required).
 */
.gpz-idle-bar__button {
    box-sizing: border-box;
    min-width: 44px;

    /*
     * Taken from the DevExtreme theme: padding 4px 10px from
     * ".dx-button-has-text .dx-button-content", border 1px and radius 4px from
     * ".dx-button", line-height normal from ".dx-button-text". The theme sets no
     * min-height, so the height of the button is the sum of the above.
     */
    padding: 4px 10px;

    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #ffffff;
    color: #c12e2a;

    font-family: inherit;
    font-size: inherit;
    line-height: normal;
    cursor: pointer;
}

.gpz-idle-bar__button:hover {
    background-color: #f0f0f0;
}

/*
 * The focus ring is white and pushed outside the button, so it is measured
 * against the red of the bar rather than against the white button it surrounds.
 */
.gpz-idle-bar__button:focus {
    background-color: #f0f0f0;
    border-color: transparent;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.gpz-idle-bar__button:active {
    background-color: #e8e8e8;
}

/* Available to assistive technology only, removed from the visual flow. */
.gpz-idle-bar__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

@media (max-width: 479px) {
    .gpz-idle-bar {
        font-size: 12px;
        line-height: 18px;
    }

    .gpz-idle-bar__text {
        flex: 1 1 100%;
    }

    .gpz-idle-bar__actions {
        flex: 1 1 100%;
        margin-left: 0;
        margin-top: 6px;
    }

    /* A full width, comfortable touch target on a phone. */
    .gpz-idle-bar__button {
        flex: 1 1 auto;
        min-height: 44px;
    }
}

/* Screen shown once after the session has been terminated. */
.gpz-idle-info {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30001;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: rgba(255, 255, 255, 0.94);
    font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Verdana, sans-serif;
    color: #333333;
}

.gpz-idle-info__box {
    box-sizing: border-box;
    max-width: 480px;
    padding: 24px;
    text-align: center;
}

.gpz-idle-info__title {
    margin: 0 0 12px 0;
    font-size: 20px;
    line-height: 26px;
}

.gpz-idle-info__message {
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 20px;
}

.gpz-idle-info__button {
    box-sizing: border-box;
    min-height: 36px;
    min-width: 44px;
    padding: 6px 18px;

    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #c12e2a;
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

.gpz-idle-info__button:hover,
.gpz-idle-info__button:focus {
    background-color: #972421;
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .gpz-idle-bar,
    .gpz-idle-bar *,
    .gpz-idle-info,
    .gpz-idle-info * {
        animation: none !important;
        transition: none !important;
    }
}
