/*

styles for UI widgets such as popovers, modals, tabs

*/

@import "_variables.scss";

.popover {
    position: absolute;
    padding: 32px 64px 32px 32px;
    border: 1px solid $border-light;
    border-radius: 5px;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.05), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    z-index: 9999;
    background-color: $color-popover-background;
    top: auto;
    display: block;
    width: 30%;
    min-width: 200px;
    max-width: 400px;
}

.modal-container {
    position: fixed;
    display: flex;
    justify-content: center;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    padding-top: 10vh;

    .modal {
        position: relative;
        margin: 1em;
        background-color: #fff;
        max-width: $layout-breakpoint-large;
        border-radius: 0.5em;
        height: fit-content;
        display: flex;
        flex-direction: column;
        max-height: 80vh;

        .modal-header {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            padding: 0.5em;
            border-bottom: 1px solid $border-light;
            @include box-shadow-light;

            h2 {
                padding:.25em;
            }

            .modal-close-x {
                border: none;
                cursor: pointer;
                border-radius: 0.25em;
                filter: invert(40%) sepia(3%) saturate(18%) hue-rotate(327deg) brightness(95%) contrast(85%);
                @include media-small {
                    width: 1.75em;
                    height: 1.75em;
                }

                &:hover {
                    filter:none;
                    background-color: #e1f3fc;
                }
            }
        }

        .capability-content {
            overflow-y: auto;
            padding: 1em;
        }
    }
}

.popover-more {
    display: inline-block;
    height: 1.25em;
    width: 1.25em;
    vertical-align: top;
    background: url(https://www.google.com/images/icons/material/system/svg/help_24px.svg) no-repeat center center;
    background-size: contain;
    filter: invert(53%) sepia(12%) saturate(175%) hue-rotate(165deg) brightness(97%) contrast(91%);
    border-bottom: 0;
}

ul.tabs {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid $border-light;
    padding: 0;

    li {
        list-style-type: none;
        text-align: center;

        a {
            display: inline-block;
            padding: 4px 18px;
            margin: 0 12px;
            cursor:pointer;

            font-family: $font-roboto;
            font-weight: 300;
            font-size: 0.85rem;
            text-decoration: none;
            color: $color-text-light;
            text-transform: uppercase;
            border-bottom: 2px solid white;
            transition: border-bottom 400ms ease-out;

            &:hover {
                color: $color-text;
            }

            &.selected {
                color: $color-text;
                font-weight: 500;
                border-bottom: 2px solid $color-link;
            }
        }
    }

    @include media-small {
        flex-direction: column;
        li {
            a {
                font-size: 1.25rem;

                &.selected {
                    border: none;

                    &::before {
                        content: "• ";
                        color: $color-link;
                    }
                }
            }
        }
    }
}

// elements that are present only for screen readers
.sr-only {
    clip: rect(0 0 0 0);
    clip-path: inset(100%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

// icons
img.icon {
    &.arrow-right {
        height: 0.9em;
        vertical-align: middle;
    }
}

// blockquote (used as a highlight/snipe e.g. "sponsor the devops awards")
blockquote {
    display: block;
    width: fit-content;
    margin: 0 auto .5rem auto;
    color: $color-text-highlight;
    background-color: $background-highlight;
    padding: 0.5em 1.5em;
    border-radius: 0.25em;
    p {
        font-family: $font-google-sans;
        margin: 0;
        padding: 0;
        text-align: center;
    }
}
