@import url("../components/sidebar.css");
@import url("../components/modal.css");
@import url("../components/star-rating.css");
@import url("../components/checkbox.css");

html {
    background-color: var(--secondary_background);
}

html,
body {
    height: 100%;
    min-height: 100%;
    max-width: 100%;
    position: relative;
}

.training_content {
    flex: 1;
    min-width: 0;
    width: 100%;
    container: training-content / inline-size;
}

.training_details {
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
}

.training_content .train_counter {
    margin-left: auto;
    margin-right: auto;
}

.big_container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-right: 24px;
    padding-left: 24px;
}

.dot {
    margin: 0 6px;
}

.stat_box_wrapper {
    min-width: 180px;
    max-width: 180px;
    align-self: self-start;
}

.train_stat {
    background-color: var(--white);
    border-bottom-width: 4px;
    padding: 0 !important;
    overflow: hidden;
    text-align: center;
}

.stat_section {
    font-weight: var(--main_bold_weight);
    padding: 15px;
    border-bottom: var(--border);
}

.stat_section span {
    font-size: 20px;
    font-weight: var(--main_bolder_weight);
}

.stat_section img {
    width: 28px;
    margin-right: 6px;
}

.train_stat div[data-cell="record"] .stat_section:not(.stat_header) {
    border-bottom: 0;   
}

.stat_header {
    background-color: var(--secondary_background);
}

.training_wrapper {
    flex-grow: 1;
    min-width: 0;
    min-height: 0;
    width: 100%;
    max-width: 1180px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: var(--border);
    border-bottom: var(--border);
}

.training {
    flex-grow: 1;
    background-color: var(--white);
    padding: 32px 24px 24px 24px;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mobile_mode .training,
.mobile_mode .train_results {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.drob .training {
    padding-top: 24px;
}

.desc {
    font-size: 18px;
}

.desc h1 {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 4px solid var(--accent);
    overflow-wrap: anywhere;
}

.second_nav {
    margin-top: 0;
    padding: 15px 24px 30px 24px;
}

.rubric {
    color: var(--accent);
    font-weight: var(--main_bolder_weight);
    text-transform: uppercase;
    margin-bottom: 15px !important;
    margin-top: 0 !important;
}

.rubric + * {
    margin-top: 0 !important;
}

.desc h2,
.desc h3,
.desc h4,
.desc h5,
.desc h6 {
    font-family: var(--main_font);
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 48px;
}

.desc p {
    line-height: 1.6em;
    margin: 24px 0;
}

.desc ul li,
.desc ol li {
    margin-top: 14px;
}

.content_box {
    max-width: 728px;
    margin-left: -24px;
    margin-right: -24px;
    padding: 24px;
    background-color: var(--white);
    border-bottom: var(--border);
    border-top: var(--border);
}

.other_links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.dot {
    margin: 0 6px;
}

.single_btn {
    padding: 16px !important;
    width: 100%;
    font-size: inherit;
    text-transform: none;
    font-weight: var(--main_bold_weight);
    display: flex;
    align-items: center;
    justify-content: center;
}

.single_btn.secondary {
    color: var(--main) !important;
}

.other_links .single_btn {
    min-width: 100%;
    max-width: 100%;
}

@media (min-width: 550px) {
    .other_links .single_btn {
        min-width: calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

@media (min-width: 768px) {
    .other_grades .single_btn {
        min-width: calc(25% - 12px);
        max-width: calc(25% - 12px);
    }
}


.multiplier {
    color: var(--progress);
}

.correctAnswers {
    color: var(--blue3);
}

.best {
    color: var(--coral);
}

.timer,
.progress {
    position: absolute;
    left: 0;
    height: 7px;
    width: 0;
    transition: 0.2s linear width;
}

.progress {
    bottom: 0;
    background-color: var(--green);
}

.timer {
    top: 0;
    background-color: var(--blue3);
}

.descend {
    width: 100%;
    transition: none;
}

/* FULLSCREEN */
.training_fullscreen .training_content {
    container-type: normal;
}

.only_fullscreen {
    display: none;
}

.training_fullscreen .main_wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: fixed;
    z-index: 100;
    width: 100%;
    max-width: none;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--secondary_background);
}

.training_fullscreen .stat_box_wrapper {
    align-self: center;
}

.training_fullscreen .only_fullscreen {
    display: flex;
}

.training_fullscreen .train_results {
    overflow-y: auto;
}

.switch_full_mobile {
    position: absolute;
    top: 5px;
    right: 5px;
}

/* SOUND */

.switch_sound,
.btn.switch_fullscreen {
    height: 48px;
    width: 48px;
    display: flex;
    padding: 0 !important;
}

.switch_sound img {
    width: 25px;
    display: none;
    vertical-align: middle;
}

.switch_sound img:nth-child(1) {
    display: block;
}

.no_sound .switch_sound img:nth-child(2) {
    display: block;
}

.no_sound .switch_sound img:nth-child(1) {
    display: none;
}


/* RESULTS */

.train_results {
    flex-grow: 1;
    background-color: var(--white);
    padding: 32px 24px 24px 24px;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.train_results .box,
.settings .box {
    width: 100%;
    position: relative;
    padding: 24px 16px;
    text-align: center;
}

#perfectAnimWrapper {
    z-index: 1000;
    width: 100%;
    top: 0;
    position: fixed;
    pointer-events: none;
}

.train_results {
    display: none;
}

.show_results .train_results {
    display: flex;
}

.show_results .training,
.show_results .keypad {
    display: none !important;
}

.bignum {
    font-size: calc(1.5rem + 0.7vh + 1.5vw);
}

.total_q {
    margin-left: 3px;
}

/* RESULT */

.train_results .box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.train_results .box h3,
.train_results .box {
    border: none;
    color: var(--white);
}

.res_correct {
    background-color: var(--blue3);
}

.res_percent {
    background-color: var(--progress);
}

.res_xp {
    background-color: var(--xp);
}

.res_avg_time {
    background-color: var(--orange);
}

.record {
    display: none;
    font-weight: var(--main_boldest_weight);
    font-size: 17px;
}

.current_record {
    position: absolute;
    top: 16px;
    font-weight: var(--main_boldest_weight);
    left: 16px;
}

.current_record ~ .bignum {
    margin-top: 15px;
}

.coin_progress {
    display: inline-block;
    position: relative;
    background-color: var(--gray);
    border-radius: 50vh;
    height: 12px;
    overflow: hidden;
    width: 100%;
}

.coin_progress span {
    display: inline-block;
    background-color: var(--yellow);
    height: inherit;
    position: absolute;
    width: 0;
    left: 0;
}

.xp_counter {
    width: 100%;
    background-color: var(--white);
    border-bottom-width: 4px;
    padding: 24px 16px;
    text-align: center;
}

.xp_counter span {
    font-size: 17px;
    font-weight: var(--main_bolder_weight);
}

.xp_counter img {
    margin-right: 6px;
    height: 27px;
}

.earned_coin img {
    height: 27px !important;
    margin-right: 0;
    margin-left: 15px;
}


.settings select {
    text-align: center;
    border-radius: var(--radius);
    border: var(--border);
    border-bottom-width: 4px;
    padding: 10px 15px;
    cursor: pointer;
    max-width: 130px;
}


.button_row {
    display: flex;
    justify-content: center;
}

.button_row .btn::before {
    border-radius: 0;
}

.button_row .btn:first-child:before {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.button_row .btn:last-child:before {
    border-bottom-right-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.btn.hide {
    display: none !important;
}

.progress-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 55px;
    height: 55px;
    font-size: 19px;
    border-radius: 50%;    
    color: var(--green);
    font-weight: var(--main_bolder_weight);
}

#total_train_progress .xp {
    font-size: 18px;
} 

.next_prev_train {
    margin-left: auto;
    margin-right: auto;
    max-width: 728px;
}

.next_prev_train .sec {
    font-size: 14px;
}

.next_prev_train .training_name {
    margin-top: 12px;
    font-weight: var(--main_bolder_weight);
}

.next_prev_train .box {
    background-color: var(--white);
    border-bottom-width: 4px;
    min-width: calc(50% - 12px);
    max-width: calc(50% - 12px);
}


.prev_training svg {
    rotate: 180deg;
}

.error_row {
    border-top: var(--border);
    padding: 16px 0;
}

.error_row h3 {
    font-weight: 600;
    font-family: var(--main);
    font-size: 19px;
}

.error_row p {
    margin: 10px 0 0 0;
}

.error_count {
    color: var(--blue3);
    background-color: var(--lightblue);
    min-width: 25px;
    display: flex;
    padding: 0 5px;
    min-height: 25px;
    border-radius: 50vh;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

@media (max-width: 473px) {
    #total_train_progress {
        flex-direction: column-reverse;
    }
}

@media (max-width: 767px) {
    .main_wrapper {
        flex-direction: column-reverse;
        padding: 0;
        min-height: calc(100vh - var(--nav_height));
        gap: 0;
        margin-top: 0;
    }
    .second_nav {
        display: none;
    }
    .stat_box_wrapper {
        width: 100%;
        max-width: 100%;
    }
    .train_stat div {
        flex-grow: 1;
    }
    .stat_section:not(.stat_header) {
        border-bottom: 0;
    }
    .train_stat {
        font-size: 13px;
        display: flex;
        border: 0;
        border-radius: 0;
    }
    .stat_box_wrapper .xp_counter {
        display: none;
    }
    .next_prev_train {
        flex-direction: column;
    }
    .next_prev_train .box {
        max-width: 100%;
    }
    .navbar {
        position: static;
    }
    body {
        padding-top: 0;
    }
}

@media (min-width: 768px) {
    .navbar {
        display: block;
    }

    .content_box {
        margin-left: auto;
        margin-right: auto;
        border: var(--border);
        border-radius: var(--radius);
        border-bottom-width: 4px;
    }

    .training {
        padding: 32px;
    }

    .main_wrapper {
        min-height: calc(100vh - var(--nav_height) - 100px);
    }

    .training_wrapper {
        border: var(--border);
        border-radius: var(--radius);
        border-bottom-width: 4px;
    }

    .keypad section:last-child {
        border-bottom-left-radius: var(--radius);
        border-bottom-right-radius: var(--radius);
    }
    .stat_section span {
        font-size: 25px;
    }
}

@container training-content (max-width: 767px) {
    .main_wrapper {
        flex-direction: column-reverse;
        gap: 16px;
    }

    .stat_box_wrapper {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .train_stat {
        display: flex;
        font-size: 13px;
    }

    .train_stat > div {
        flex: 1;
        min-width: 0;
    }

    .stat_section:not(.stat_header) {
        border-bottom: 0;
    }

    .stat_box_wrapper .xp_counter {
        display: none;
    }

    .training_content > .container.mobile {
        display: block !important;
    }
}

@media (min-height: 953px) {
    .training_wrapper {
        min-height: 753px;
    }
}
