/*
 * some basic styles
 */

// don't let images be wider than the parent layer
iframe,
img {
    max-width: 100%;
}

.a {
    cursor: pointer;
}

.a:hover,
.a:focus,
a:hover,
a:focus,
[data-toggle]:hover,
[data-toggle]:focus {
    opacity: .8;

    .fas,
    .fab,
    &.fas,
    &.fab {
        transform: rotate(-180deg);
    }
}

[data-toggle="collapse"] {
    &[aria-expanded="true"] {
        .accordion-icon {
            &:before {
                content: "\f068";
            }
        }
    }
}

// transactions
.transition,
a, a *,
.a, .a *,
button, input, optgroup, select, textarea,
.btn,
.alert,
.dropdown,
[data-toggle], [data-toggle] *,
.container,
.container-fluid,
.row,
[class="col-*"] {
    transition: all 0.4s ease;
}

.btn-toolbar {
    margin-top: $grid-gutter-height / 2;
}

.field {
    position: relative;
    margin: ($grid-gutter-height / 4) 0;

    &.composite {
        margin-top: 0;
        margin-bottom: 0;
    }

    &.required {
        &:after {
            display: block;
            position: absolute;
            top: 2rem;
            right: .5rem;
            content: "*";
            color: $red;
            z-index: 2;
        }
    }

    &.holder-error,
    &.error {
        input, select, textarea {
            border-color: $red;
        }

        label {
            color: $red;
        }
    }

    .bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
        width: 100%;
    }
}

.message {
    @extend .alert;

    @extend .alert-info;

    display: block;
    margin: .5rem 0;
}

.message.validation,
.message.required,
.message.error {
    @extend .alert;

    @extend .alert-danger;
}

// element col paddings
.col-block {
    padding: $grid-gutter-height / 4;
}

// rewrite btn opacity on hover
.btn {
    &:hover,
    &:focus {
        opacity: 1;
    }
}

// SS-messages
.message {
    @extend .alert;

    @extend .alert-info;
}

.message.required,
.message.error {
    @extend .alert;

    @extend .alert-danger;
}

// dropdown icon
.dropdown.show .dropdown-toggle::after,
.dropdown-toggle.active-dropdown::after,
.dropdown-toggle.active::after {
    transform: rotate(-90deg);
}

// dropdown hover
/*
.dropdown.show {
    .dropdown {
        &:hover,
        &:focus {
            .dropdown-menu {
                display: block;
            }
        }
    }
}
@media only screen and (min-width: map-get($grid-breakpoints, "md")) {
    .dropdown-hover ul li {
        position: relative;
    }

    .dropdown-hover ul li {
        &:hover,
        &:focus {
            > .dropdown-toggle::after {
                transform: rotate(-90deg);
            }

            > ul {
                display: block;
            }
        }
    }

    .dropdown-hover ul ul {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 250px;
        display: none;
    }

    .dropdown-hover ul ul li {
        position: relative;
    }

    .dropdown-hover ul ul li {
        &:hover,
        &:focus {
            > ul {
                display: block;
            }
        }
    }

    .dropdown-hover ul ul ul {
        position: absolute;
        top: 0;
        left: 100%;
        min-width: 250px;
        display: none;
    }

    .dropdown-hover ul ul ul li {
        position: relative;
    }

    .dropdown-hover ul ul ul li {
        &:hover,
        &:focus {
            ul {
                display: block;
            }
        }
    }

    .dropdown-hover ul ul ul ul {
        position: absolute;
        top: 0;
        left: -100%;
        min-width: 250px;
        display: none;
        z-index: 1;
    }
}*/

// dark dropdowns
.navbar-dark {
    .nav-link {
        @include hover-focus {
            background: $navbar-dark-hover-background;
        }
    }

    .active > .nav-link,
    .nav-link.active {
        background: $navbar-dark-active-background;
    }

    .nav-link.show,
    .navbar-nav .show > .nav-link {
        background: $navbar-dark-show-background;
        color: $navbar-dark-show-color;
    }
}

.dropdown-menu.bg-dark {
    border-color: $dark;

    .nav-link {
        color: $navbar-dark-color;

        @include hover-focus {
            color: $navbar-dark-hover-color;
        }


        &.disabled {
            color: $navbar-dark-disabled-color;
        }
    }

    .show > .nav-link,
    .active > .nav-link,
    .nav-link.show,
    .nav-link.active {
        color: $navbar-dark-active-color;
    }

    .dropdown-item {
        @include hover-focus {
            color: $navbar-dark-hover-color;
            background: $navbar-dark-hover-background;
        }


        &.active,
        &:active {
            background: $navbar-dark-active-background;
        }

        .nav-link {
            background: none;
        }
    }
}

// pulse
.pulse {
    animation: pulse 0.8s linear infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.8);
    }

    100% {
        transform: scale(1);
    }
}

.row-xs {
    margin-right: -($grid-gutter-xs-width / 2);
    margin-left: -($grid-gutter-xs-width / 2);

    [class^="col-"] {
        padding-left: $grid-gutter-xs-width / 2;
        padding-right: $grid-gutter-xs-width / 2;
    }
}
