@import '~bootstrap/scss/_functions';
@import '~bootstrap/scss/_variables';
@import '~bootstrap/scss/_mixins';
@import '../../../assets/css/abstracts/custom-variables.scss';
// ------------------------------------
// 	VARIABLES
// ------------------------------------

// colours
$primary-text: $gray-800;
$secondary-text: $gray-700;
$hover-text: lighten($primary-text, 30%);
$grey: $gray-100;
$dark-grey: $gray-500;
$pastel-grey: $gray-700;
$orange: $yellow-500;
$green: $green-600;
$dark-green: $green-800;
$red: theme-color("danger");
$blue: theme-color("info");
$hover: 0.8;
$quiz-primary: $blue-400;

// font-sizes

$byline: 12px;
$body: 14px;
$header: 16px;


// ------------------------------------
// 	GENERAL
// ------------------------------------
.title {
    font-weight: 400;
    color: $primary-text;

    h3 {
        margin-top: 0;
    }
}

.table-borderless tbody tr td,
.table-borderless tbody tr th,
.table-borderless thead tr th,
.table-borderless thead tr td,
.table-borderless tfoot tr th,
.table-borderless tfoot tr td {
    border: none;
}

.page-actions {
    padding: 20px 0 10px 0;
    border-top: 1px solid $gray-200;
    margin-top: 20px;
}

.quiz-bg {
    background: $quiz-primary;
    border-color: $quiz-primary;
    color: #fff;
}

// ------------------------------------
// 	BREADCRUMBS
// ------------------------------------

ul.breadcrumb li {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

// ------------------------------------
// 	COMPONENTS
// ------------------------------------

// Card layout
@media only screen and (min-width: 980px) {
    .cards--grid .card {
        width: (100% / 3);
    }
}

@media only screen and (min-width: 480px) and (max-width: 979px) {
    .cards--grid .card {
        width: (100% / 2);
    }
}

// Card
.cards--grid .card .card-content {
    position: relative;
    z-index: 2;
    background-color: #fff
}

// Card content
.card-content:hover {
    opacity: 1;
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    transform: translateY(-3px);

    a {
        opacity: 1;
    }
}

.card-content__inner {
    display: block;

    &:hover {
        text-decoration: none;
    }
}

.card-content__img-container {
    position: relative;
    z-index: -1;
}

.card-content__labels {
    position: absolute;
    bottom: 4px;
    right: 4px;

    .label {
        font-size: 90%;
        display: inline-block;
    }
}

// Card toolbar
.card-content__toolbar {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 10px;
    background-color: rgba(black, .5);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.15s linear;

    span {
        font-size: ($body * 1.3);
    }

    a {
        color: white;

        &:hover {
            color: white;
            text-decoration: none;
            opacity: 0.8;
        }
    }
}

.card-content:hover .card-content__toolbar {
    visibility: visible;
    opacity: 1;
}

@media only screen and (max-width: 980px) {
    .card-content__toolbar {
        visibility: visible;
        opacity: 1;
    }

    .card-content__labels {
        bottom: 4px;
    }
}

// Show more button
.show-more-container {
    padding: 10px;

    .btn-show-more {
        width: 100%;
    }
}


// --	CARD IMAGES - TABLET & MOBILE --
.cards--grid {
    .card-content__img-container {
        .card-content__img, .card-content__icon {
            width: 100%;
            height: auto;
            float: none;

            img {
                width: 100% !important;
                height: auto;
            }

            span, .glyphicons {
                color: #fff;
                font-size: 64px;
                height: 64px;
                line-height: 64px;
                position: absolute;
                left: 50%;
                top: 50%;
                margin: -32px 0px 0 -32px;
                width: 64px;
            }
        }
    }

    .card-content__icon {
        padding-bottom: 60%;
    }
}


// ---- LABEL BORDER RADIUS ----
.card-content__labels span,
.quiz-status-label {
    border-radius: 0;
}


// ----- QUIZ CARD STATS/INFO WRAPPER -----

.card-content__progress {
    color: $dark-grey;
    width: 100%;
    display: table;

    .card-content__start-link {
        font-size: $body;
        color: $blue;
        display: table-cell;
        vertical-align: middle;
        text-align: center;

        &:hover {
            text-decoration: none;
        }
    }

    .success-status {
        text-align: center;
        margin: 0;

        .pass {
            color: $dark-green;
        }

        .fail {
            color: $red;
        }
    }

    small {
        display: block;
        line-height: $header;
    }

    .quiz-progress-figure {
        font-size: ($header * 1.8);
        line-height: ($header * 1.8);
    }

    // Quiz card progress bar
    .card-content__quiz-progress-bar {
        margin: 0;
        position: relative;
    }
}

// ------ QUIZ CARD TITLE SECTION ------

.card .card-content {
    &__detail {
        text-align: center;

        .card-content__title {
            font-size: 15px;
            font-weight: 600;
            height: 40px;
            max-height: 40px;
        }

        small {
            color: $dark-grey;
            display: block;
            margin-top: 8px;
        }
    }
}

// ----- COMPLETE QUIZ CARD -----

.card-content {
    // Complete card
    &.card-complete.card-complete {
        // Any styles can go here specific to completed quizzes, regardless of
        // pass or fail status
    }

    // Passed card
    &.card-pass.card-pass {
        .card-content__quiz-progress-bar .progress-bar.progress-bar {
            background: $green;
        }
    }

    // Failed card
    &.card-fail.card-fail {
        .card-content__quiz-progress-bar .progress-bar.progress-bar {
            background: $red;
        }
    }
}


// User profile
.mini-profile {
    display: block;
    padding: 10px;
    border: 1px solid $gray-200;
    background-color: $gray-100;
    margin-bottom: 15px;

    &.media:first-child {
        margin-top: 10px;
    }

    &:hover {
        background-color: $gray-100;
    }

    .media-heading {
        font-size: 14px;
        line-height: 21px;
        margin: 0;
    }

    img {
        width: 60px;
    }
}

// Quiz user status (side panel)
.quiz-status {
    ul {
        list-style: none;
        padding-left: 0;
        margin-bottom: 0;
    }

    li {
        font-size: $body;
        line-height: 21px;
        margin: 10px 0;

        &:first-child {
            margin-top: 0;
        }

        &:last-child {
            margin-bottom: 0;
        }
    }
}

// Quiz title and status labels (draft, live, archived)
.quiz-title {
    padding-right: 12px;
    overflow: hidden;
    word-break: break-word;

}

.quiz-status-label {
    vertical-align: middle;
}

h3.quiz-title .quiz-status-label {
    font-size: 50%;
}

h4.quiz-title .quiz-status-label {
    font-size: 66%;
}

// Statistics table
.table-nonfluid {
    width: auto !important;
}


.btn-next-question {
    color: white;

    &:hover, &:active, &:focus {
        color: white;
    }
}

// Quiz Intro page


.btn-intro {
    padding: 18px 58px;
    margin-bottom: 25px;
    margin-top: 25px;
}

.btn-submit {
    padding: 15px 20px;
    margin-top: 18px;
    margin-bottom: 18px;
}

// Quiz nav
.nav-wrap {
    position: relative;
    overflow: hidden;
    height: 74px;
}

.nav-wrap::after {
    content: '';
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 60px;
    background: linear-gradient(to right, rgba(245, 245, 245, 0.1) 0%, rgba(245, 245, 245, 1) 100%);
}

.nav-wrap.end::after {
    visibility: hidden;
    opacity: 0;

}

.quiz-nav {
    background: $gray-100;
    overflow-y: hidden;
    overflow-x: auto;
    margin-top: 5px;
    cursor: pointer !important;
}

@media only screen and (min-width: 980px) {
    .kinetic-moving-right li, .kinetic-moving-left li {
        pointer-events: none;
    }
}

// ---------------------------------------
// ----- QUESTI0N PAGE - SKIP QUESTI0N ---
// ---------------------------------------
.question-title-wrap {
    overflow: hidden;

    .title {
        display: inline-block;
    }

    .skip-question {
        display: inline-block;
        float: right;
        margin-top: 18px;
        margin-bottom: 9px;
    }
}

@media only screen and (max-width: 768px) {
    .question-title-wrap {

        .skip-question {
            float: none;
            margin-top: 0;
            margin-bottom: 0;

            button.btn {
                padding: 10px 0;
            }
        }
    }
}

// Removes question description margin if it is empty
.question-description:empty {
    margin-bottom: 0;
}


// Quiz answers
.quiz-answer {
    cursor: pointer;
    padding: 10px 20px;
    border: 1px solid $gray-500;
    margin-bottom: 10px;

    &:last-child {
        margin-bottom: 0;
    }

    &--highlighted, &:hover {
        border-color: $gray-500;
        background: $gray-100;
    }

    &--selected {
        color: $blue-500;
        border-color: $blue-500;

        .quiz-answer__counter {
            border-color: $blue-500;
            color: $blue-500;
        }
    }

    &__counter {
        display: inline-block;
        border: 1px solid $gray-500;
        background: #fff;
        height: 34px;
        width: 34px;
        text-align: center;
        margin-right: 10px;
        border-radius: 50%;

        &--multiple-choice {
            border-radius: 0;
        }
    }
}


// Quiz questions nav
.quiz-questions-nav {
    position: relative;
    width: 100%;
    list-style: none;
    white-space: nowrap;
    margin: 0;

    &__question {
        display: inline-block;
        background-color: $grey;
        border-right: 4px solid white;
        vertical-align: top;
        position: static;

        a, button {
            background: inherit;
            display: block;
            text-decoration: none;
            color: $dark-grey;
            padding: 12px 20px;
            box-sizing: border-box;
            -moz-box-sizing: border-box;
            -webkit-box-sizing: border-box;
            border-top: 5px solid (darken($grey, 10%));
            border-color: (darken($grey, 10%));
            text-align: center;

            &:hover {
                color: $dark-grey;
            }

            &:focus {
                border-color: (darken($grey, 10%));
                background-color: $grey;
                outline: none;
                border-top: 5px solid $blue;
            }

            &:active {
                cursor: move;
            }
        }

        &--intro {
            background-color: $grey;
            position: relative;
            z-index: 2;
            padding-bottom: 2px;

            &::after {
                content: "\E037";
                display: inline-block;
                font-family: 'Glyphicons Regular';
                font-style: normal;
                font-weight: normal;
                line-height: 1;
                vertical-align: top;
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
                position: absolute;
                font-size: 18px;
                color: $dark-grey;
                top: 20%;
                left: 50%;
                margin: 0 0 0 -8px;
                z-index: 1;
                pointer-events: none;
            }

            a {
                color: $dark-grey;
                border-top: 5px solid (darken($grey, 10%));
                padding: 30px 15px 10px 15px;

                &:hover {
                    color: $dark-grey;
                }
            }
        }

        &--active {
            button {
            }
        }

        &--state {
            border: 2px solid (darken($grey, 30%));
            padding: 5px;
            border-radius: 50%;
            margin: 1px auto 3px auto;
            // position: relative;
            width: 14px;
            height: 14px;

            &.complete {
                background: (darken($grey, 40%));
            }
        }
    }
}


.quiz-nav.slider-quiz-nav .slide-nav__question--active button {
    background: lighten(#3382cc, 40%);
    border-color: var(--theme-primary-color);
    color: var(--theme-primary-color);
}

.quiz-nav.slider-quiz-nav .slide-nav__question--erroractive button {
    background: lighten(#e34040, 40%);
    border-color: var(--red-600);
    color: var(--red-600);
}

.quiz-nav.slider-quiz-nav .slide-nav__question--error button {
    border-color: var(--red-600);
    color: var(--red-600);
}


// QUIZ QUESTION NAV HOVER ON SMALL SCREEN

@media only screen and (max-width: 980px) {
    .quiz-nav {
        .quiz-questions-nav__question:hover {
            button {
                background: $gray-100;
                color: $gray-500;
                border-color: (darken($grey, 10%));
            }
        }

        .quiz-questions-nav__question--active:hover {
            button {
                border-top-color: $blue-500;
            }
        }
    }
}

//Quiz Review page
.btn-finish {
    padding: 18px 32px;
}

.review-title {
    font-size: medium;
}

canvas#confetti {
    display: block;
    position: absolute;
    z-index: 1;
    pointer-events: none;
    width: 100%;
    top: 0;
    left: 0;
}

.table-borderless {
    display: block;
    padding-top: 5px;

    tbody {
        td {
            .btn {
                padding: 4px 10px;
                margin-top: -5px;
            }
        }
    }
}

// Quiz nav action buttons
.quiz-action {
    // float: right;
    // width:10%;
    margin-top: 5px;
    display: block;
    border-right: 4px solid white;

    &:last-child {
        border-right: none;
    }

    &:hover {
        opacity: $hover;
    }

    button {
        font-size: $body;
        padding: 22px 15px;
        width: 100%;
    }
}

// Quiz score
.quiz-score {
    width: 220px;
    padding: 10px;
    color: white;
    margin-bottom: 15px;
    margin-top: 15px;
    text-align: center;

    &__mark {
        font-size: ($header * 1.5);
        font-weight: bold;
        text-transform: capitalize;
        margin-bottom: 0;
    }

    &--passed {
        background: $green;
    }

    &--failed {
        background: $red;
    }
}

//Questions review

.add_question_btn {
    margin-top: 15px;
}

// List of questions
.questions-list {
    &__question {
        font-size: $body;
        line-height: 21px;
        margin: 10px 0;

        &:first-child {
            margin-top: 0;
        }

        &:last-child {
            margin-bottom: 0;
        }

        &--passed {
            color: $green;
        }

        &--failed {
            color: $red;
        }
    }
}

.new-option[disabled] {
    cursor: pointer;
}

.answer-checkbox {
    padding-left: 0;
}

.answer-control {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
}

div.radio.disabled {
    color: #aaa;
}

div.option-control a.ablock {
    display: block;
}

// Quiz Stats page
div.pass-fail-progress {
    background: #f3f3f3;
    border-radius: 5px;
    position: relative;
    width: 100%;
    height: 18px;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    line-height: 18px;

    span {
        position: absolute;
        text-align: center;
        top: 0;
        overflow: hidden;

        &.pass {
            background: $green-500;
            left: 0;
        }

        &.fail {
            right: 0;
            background: $red-500;
        }

        &.skip {
            background: $gray-500;
            right: 0;
            width: 0;
        }
    }
}

table.quiz-stats-table, #quiz_stats table {
    tr > td {
        text-align: center;
        vertical-align: middle;

        &:first-child {
            text-align: left;
        }
    }
}

table.answer-breakdown {
    tr > td:last-child,
    tr > th {
        text-align: center;

        &:first-child {
            text-align: left;
        }
    }
}

// This is a hack to hide the Filter and Reset buttons from datatables forms,
// for now
#quiz_stats_form_form_app,
#breakdown_form_form_app {
    .btn:not([name=show_export]) {
        display: none;
    }
}
/**
* Don't display buttons: Reset, Filter
**/
#attempts_form_form_app button {
    display: none;
}

// ------------------------------------
// 	QUESTION ADMIN
// ------------------------------------

input.question-finder {
    max-width: 648px;
}

// ------------------------------------
// 	FOOTER TOOLBAR
// ------------------------------------

.affix.form-toolbar {
    .container {
        margin: 0 auto;
    }
}

.affix.form-toolbar-bottom {
    background: $gray-100;
    border-top: 1px solid $gray-200;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    margin: 0;
    z-index: 10;
}


//  ----------
// QUESTIONS/SECTION PANELS
// ------------
.question-panel, .section-panel {
    border: 1px solid $gray-200;
    border-radius: var(--theme-rounded-corners);
    user-select: none;
    margin-bottom: 10px;
    padding: 10px 20px;


    .question-panel__handle {
        cursor: move;
    }

    //  ------
    // QUESTIONS/SECTION PANELS - TITLE STYLING
    // ------
    &__title {
        margin-left: 8px;
        vertical-align: middle;
    }


    //  ------
    // QUESTIONS/SECTION PANELS - RIGHT HAND BUTTONS
    // ------
    &__edit, &__delete, &__copy, &__add {
        text-decoration: none;
        margin-left: 8px;

        &:hover {
            text-decoration: none;
        }
    }
}


//  ----------
// QUESTIONS PANELS
// ------------
.question-panel {
    font-size: $body;
    background-color: #FFF;
}


//  ----------
// SECTIONS PANELS
// ------------
.section-panel {
    background-color: $gray-100;
    width: 100%;

    //  ------
    // SECTION PANEL - HEADER BLOCK
    // ------
    &__header {
        margin-bottom: 10px;
    }

    //  ------
    // SECTION PANEL - TITLE STYLING
    // ------
    &__title {
        font-size: 16px;
    }
}




.slider-nav-wrap {
    position: relative;
    overflow: hidden;
    // box-shadow: 0 0 9px 0px #e4e4e4;
    // padding: 5px;
    margin-bottom: 5px;
    border-radius: 8px;

    .slider-quiz-nav {
        background: #fff;
        margin: 0;
    }
}

.slider-nav-wrap::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    opacity: 1;
    background: -moz-linear-gradient(left, rgba(249,249,249,0) 0%, rgb(255, 255, 255) 100%);
    background: -webkit-linear-gradient(left, rgba(249,249,249,0) 0%,rgba(255,255,255,1) 100%);
    background: linear-gradient(to right, rgba(249,249,249,0) 0%, rgb(255, 255, 255) 100%);
    transition: 0.3s;
    z-index: 2;
}

.slider-nav-wrap.end::after {
    opacity: 0;
    transition: 0.3s;
}




.slide-nav {
    margin-bottom: 10px;
    position: relative;
    width: 100%;
    list-style: none;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    &::-webkit-scrollbar {
        width: 0px;
        background: transparent; /* Chrome/Safari/Webkit */
    }
}

.slide-nav__question--intro {
    padding: 0 10px 0 0;
}

.slide-nav__question {
    cursor: default;
    display: inline-block;
    margin-right: 6px;

    button {
        color: $gray-600;
        padding: 0;
        height: 40px;
        width: 40px;
        vertical-align: middle;
        background: #fff;
        border: 2px solid transparent;
        border-radius: 10rem;
        position: relative;
        z-index: 1;
    }

    button, a {
        font-weight: bold;
        &:focus {
            outline: none;
        }
    }

    .quiz-questions-nav__question--state {
        border: none;
        padding: 0;
        border-radius: 10rem;
        margin: 5px auto 0;
        width: 8px;
        height: 8px;
        display: block;
        background: transparent;
    }
}

.slide-nav__question--active button::after {
    content: '';
    position: absolute;
    background: currentcolor;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 10rem;
    opacity: 0.03;
    z-index: 0;
}

.slide-nav__question button:hover {
    background: $gray-100;
    border-color: $gray-200;
    cursor: pointer;
}

.slide-nav__page--error {
    position: absolute;
    left: 25;
    top: 20;
    z-index: 999;
}


// POLLS & SURVEY LIST COMPONENENT IMAGE WRAPPER
.image-wrapper {
    position: relative;
}

// POLLS & SURVEY LIST COMPONENENT BACKGROUND DIV
.image {
    width: 40px;
    height: 40px;
    background-position: center;
    background-size: cover;
    position:relative;
    z-index: 1;
}

// POLLS & SURVEY LIST COMPONENENT PLACEHOLDER IMAGE (WHEN NO BACKGROUND EXISTS)
.load-icon {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    text-align: center;
    padding: 3px;
    font-size: 23px;
    z-index: 0;
}
