/* before variables.scss because it only affects presale, not control */
$body-bg: #f5f5f5 !default;

/* imports */
@import "../../pretixbase/scss/_variables.scss";
@import "../../bootstrap/scss/_bootstrap_reduced.scss";
@import "../../pretixbase/scss/_theme.scss";
@import "../../lightbox/css/lightbox.scss";
@import "../../cropper/cropper.scss";
@import "../../datetimepicker/_bootstrap-datetimepicker.scss";
@import "../../slider/_bootstrap-slider.scss";
@import "../../fontawesome/scss/font-awesome.scss";

@import "_theme.scss";
@import "_event.scss";
@import "_cart.scss";
@import "_forms.scss";
@import "_calendar.scss";
@import "_checkout.scss";
@import "../../pretixbase/scss/webfont.scss";

/* See https://github.com/pretix/pretix/pull/761 */
.bootstrap-datetimepicker-widget table td span {
    line-height: 1.8em;
}

.order-details dt {
    font-weight: normal;
    float: left;
    margin-right: .25em;
}
.status-dot {
    font-size: 1.2em;
}
.text-warning { color: $brand-warning; }
.text-info { color: $brand-info; }
.text-success { color: $brand-success; }
.text-danger { color: $brand-danger; }
h1 a, .btn {
    text-decoration: none;
}
/*
a, .btn-link {
    text-decoration: underline;
}
*/
/* bootstrap sets outline-offset with :active:focus so we need to match specifity of selector */
/* see line 26, pretix/static/bootstrap/scss/bootstrap/_buttons.scss */
button:focus, a:focus, .btn:focus, summary:focus,
/*button:active, a:active, .btn:active, summary:active,*/
button:active:focus, a:active:focus, .btn:active:focus, summary:active:focus {
    outline: 2px solid $link-hover-color;
    outline-offset: 2px;
}

footer {
    clear: both;
    padding: 10px 0;
}
footer nav {
    text-align: center;
    font-size: 11px;
}
footer nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}
footer nav li:not(:first-child):before {
    content: "·";
    font-weight: bold;
    display: inline-block;
    width: 1.5em;
    text-align: center;
}
footer nav .btn-link {
    display: inline;
    padding: 0;
    margin: 0;
    font-size: 11px;
    vertical-align: baseline;
}

.js-only {
    display: none;
}
.locales, .loginstatus {
    display: inline;
    a.active {
        /*border-bottom: 2px solid $brand-primary;*/
        font-weight: bold;
    }
    img {
        vertical-align: baseline;
    }
}
.locales ul {
    display: inline;
    list-style: none;
}
.locales li {
    display: inline;
}
.loginstatus a {
    margin-left: 10px;
}
.huge {
    font-size: 40px;
}
a:hover .panel-primary > .panel-heading {
    background-color: darken($btn-primary-bg, 10%);
    border-color: darken($btn-primary-border, 12%);
}

.thank-you {
    margin-bottom: 25px;

    .fa {
        font-size: 150px;
        line-height: 170px;
        display: block;
        color: $brand-success;
    }

    h2 {
        color: $brand-success;
    }
}

.contains-overlay {
    position: relative;
}
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: $gray-lightest;
}
.overlay-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.overlay-centered .overlay-content {
  max-width: 35em;
  margin-left: auto;
  margin-right: auto;
}

body.loading .container {
    -webkit-filter: blur(2px);
    -moz-filter: blur(2px);
    -ms-filter: blur(2px);
    -o-filter: blur(2px);
    filter: blur(2px);
}

.big-rotating-icon {
    -webkit-animation: fa-spin 8s infinite linear;
    animation: fa-spin 8s infinite linear;
    font-size: 120px;
    color: $brand-primary;
}
#loadingmodal, #ajaxerr, #cookie-consent-modal, #popupmodal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, .7);
    opacity: 0;
    z-index: 900000;
    visibility: hidden;
    padding: 10px;

    .big-icon {
        margin-top: 50px;
        font-size: 200px;
        color: $brand-primary;
    }
    &#popupmodal .big-icon {
        margin-top: 10px;
        font-size: 100px;
        color: $brand-primary;
    }

    .modal-card {
        margin: 50px auto 0;
        width: 90%;
        max-width: 600px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        background: white;
        border-radius: $border-radius-large;
        box-shadow: 0 7px 14px 0 rgba(78, 50, 92, 0.1),0 3px 6px 0 rgba(0,0,0,.07);
        padding: 20px;
        min-height: 160px;

        .modal-card-icon {
            float: left;
            width: 150px;
            text-align: center;
        }
        .modal-card-content {
            margin-left: 160px;
            text-align: left;
            h3 {
                margin-top: 0;
            }
        }
    }

    &#cookie-consent-modal {
        background: rgba(255, 255, 255, .5);
        opacity: 1;
        visibility: visible;
        display: none;
        .modal-card-content {
            margin-left: 0;
        }
        details {
            & > summary {
                list-style: none;
            }
            & > summary::-webkit-details-marker,
            & > summary::marker {
                display: none;
            }
            margin-bottom: 10px;
        }
    }
}
@media (max-width: 700px) {
    #loadingmodal, #ajaxerr, #cookie-consent-modal, #popupmodal {
        .modal-card {
            margin: 25px auto 0;
            max-height: calc(100vh - 50px - 20px);
            .modal-card-icon {
                float: none;
                width: 100%;
            }
            .modal-card-content {
                text-align: center;
                margin-left: 0;
                margin-right: 0;
                margin-top: 10px;
            }
        }
    }
}

#ajaxerr {
    background: rgba(236, 236, 236, .9);
}

.loading #loadingmodal, .ajaxerr #ajaxerr, .has-popup #popupmodal {
    opacity: 1;
    visibility: visible;
    transition: opacity .5s ease-in-out;
    -moz-transition: opacity .5s ease-in-out;
    -webkit-transition: opacity .5s ease-in-out;
}

.typo-alert span[data-typosuggest] {
    text-decoration: underline;
    cursor: pointer;
}

.info-row {
    & > .fa {
        font-size: 26px;
        color: $brand-primary;
        float: left;
        margin-top: 3px;
    }
    & > img {
        width: 26px;
        height: auto;
        float: left;
        margin-top: 3px;
        position: relative;
        left: 3.71423px;  /* Position analog to what fa-fw does */
    }
    p {
        min-height: 30px;
        margin-left: 40px;
    }
    p:first-child {
        margin-top: 0;
    }
}

@media (min-width: $screen-md-min) {
    .thank-you {
        min-height: 170px;
        max-width: 59em;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 3em;

        & > .fa {
            float: left;
            margin-right: 30px;
            margin-left: 0;
        }

        h2 {
            padding-top: 35px;
        }

        & > * {
            margin-left: 158px;
        }
    }
}
@media (max-width: $screen-sm-max) {
    .thank-you {
        text-align: center;
    }
    h2 {
        margin-top: 0;
    }
    .checkout-button-row > div {
        margin-bottom: 15px;
    }
    .checkout-button-row > div.clearfix {
        margin: 0;
    }
}

.blank-after {
    margin-bottom: 1em;
}
.dl-horizontal dt  {
    white-space: normal;
}
.dl-inline dt, .dl-inline dd {
    display: inline;
}

.collapse-indicator {
    -moz-transition: all 150ms ease-in 0s;
    -webkit-transition: all 150ms ease-in 0s;
    -o-transition: all 150ms ease-in 0s;
    transition: all 150ms ease-in 0s;
}

.panel-title a[data-toggle="collapse"], details .panel-title {
    display: flex;
    padding: 0.75*$line-height-computed;
    margin: -0.75*$line-height-computed;
    align-items: center;
    justify-content: space-between;
    outline: 0;
    text-decoration: none;
    position: relative;
    padding-left: 30px;
}

.panel-title a[data-toggle="collapse"] .collapse-indicator,
details .panel-title .collapse-indicator {
    /* hide old collapse indicators until they are all removed from HTML */
    display: none;
}

.panel-title a[data-toggle="collapse"]::before,
details .panel-title::before {
    position: absolute;
    top: 50%;
    left: 10px;
    margin-top: -.5em;
    content: "";
    width: 1em;
    height: 1em;
    font: normal normal normal 14px/1 FontAwesome;
    display: inline-block;
    text-align: center;
    transform: rotate(-90deg);
    transition: transform 150ms ease-in 0s;
}
.panel-title a:not(.collapsed)::before,
details.details-open .panel-title::before {
    transform: rotate(0deg);
}

.panel-default .panel-title a[data-toggle="collapse"]:hover {
    background-color: #eeeeee;
}

.panel-primary .panel-title a[data-toggle="collapse"]:hover {
    background-color: darken($btn-primary-bg, 10%);
}

.panel-title a.h6 {
    text-decoration: underline;
    margin-left: .5em;
}
.panel-title a.h6 .fa {
    margin-left: .25em;
    margin-right: .25em;
}

details {
    list-style: none;
}
details > summary::-webkit-details-marker {
    display: none;
}

details summary {
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}
.nojs details:not([open], .details-open) .panel-heading .collapse-indicator,
[aria-expanded=false]>.collapse-indicator {
    -webkit-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

details.sneak-peek {
    position: relative;
    height: 11em;
    overflow: hidden;
    transition: height .5s;
}
.sneak-peek-trigger {
    display: grid;
    justify-content: center;
    align-content: center;
    width: 100%;
    height: 4.5em;
    margin: 0;
    padding: 15px;
    background: linear-gradient(0deg, rgba(248,248,248,.9) 44%, rgba(248,248,248,0) 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 10;
}

form.download-btn-form {
    display: inline;
}
.alert-testmode {
    margin-top: 20px;
}
h2 .label {
    display: inline-block;
}

.nojs .requirejs {
    display: none !important;
}

.event-list {
    margin-bottom: 15px;
    border-top: 1px solid $table-border-color;

    .row {
        margin-left: 0;
        margin-right: 0;
        padding-top: 5px;
        padding-bottom: 5px;
        border-bottom: 1px solid $table-border-color;
        border-left: 1px solid $table-border-color;
        border-right: 1px solid $table-border-color;
    }
    .row > div {
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

.quotabox {
    display: inline-block;
    vertical-align: top;
    width: 50px;
    .progress {
        height: 7px;
        margin-bottom: 2px;
    }
    .numbers {
        font-size: 10px;
        color: $text-muted;
        display: block;
        text-align: center;
    }
    &.availability .progress-bar-success {
        background: lighten($brand-success, 20%);
    }
}

.nav-tabs {
    border-bottom: 0px solid #ddd;
}
.tab-content {
    border: 1px solid #ddd;
    border-radius: 0px 5px 5px 5px;
    & .tab-pane > table {
        margin: 0;
    }
}

.user-select-none {
    user-select: none;
}

@for $i from 0 through 100 {
    .progress-bar-#{$i} { width: 1% * $i; }
}

@import "_iframe.scss";
@import "_a11y.scss";
@import "_print.scss";
@import "../../pretixbase/scss/_rtl.scss";
@import "../../bootstrap/scss/_rtl.scss";
@import "_rtl.scss";
