/*
    Basic CSS
*/

@import url("https://fonts.googleapis.com/css?family=Barlow:300,400,500,600,700|Hind:400,500,600,700|Quattrocento:400,700");

:root {
    --body-bg: #fafafa;
    --body-color: #121619;
    --link-color: #222;
    --link-color-hover: #000;


    --color-red: #D14D33;
    --color-yellow: #FFCD00;
    --color-yellow-warm: #FFA700;
    --color-blue: #0283C7;


    --border-radius-size: 1rem;
    --border-color: rgb(139, 139, 139);
    --border-color-hover: black;

    /* default degree to not break progress bar */
    --color-track: rgb(225, 224, 224);
    --degree: 80deg;

    --selection-color: #FFCD00;
}

@media (prefers-color-scheme: dark) {
    :root {
        --body-bg: #212529;
        --body-color: #dfdfdf;

        --link-color: #dee2e6;
        --link-color-hover: #fff;

        --border-color: #939393;
        --border-color-hover: white;

        --color-track: #444;

        /* Make yellow more warm in darkmode */
        --color-yellow: #FFA700;

        --selection-color: #FFA700;
    }

    .smart-invert {
        filter: invert(1) hue-rotate(180deg);
    }

    .button.is-yellow-bright:hover {
        background-color: #ffbb3c !important;
    }
}

::selection{
    background: var(--selection-color);
    color:white;
}

body {
    font-family: 'Hind', sans-serif;
    font-weight: normal;
    font-style: normal;
    margin: 0;
    padding: 0;
    background-color: var(--body-bg);
    color: var(--body-color);
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

a:focus, input:focus, textarea:focus, button:focus {
    text-decoration: none;
    outline: none;
}

a {
    color: var(--link-color);
}

a:focus, a:hover {
    text-decoration: none;
    color: var(--link-color-hover);
}

a.no-style {
    color: inherit;
    text-decoration: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Quattrocento', serif;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.katex {
    color: var(--body-color);
}

/*
    Effects
*/

.rescale:hover {
    transform: scale(1.05);
}

/*
    Layout
*/

.fullscreen {
    max-width: 768px;
    margin: 0 auto;
    margin-top: 3rem;
}

.fullscreen>.box {
    margin: 0 1rem;
}

/*
    Form
*/
form.form {}

.form-field {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    -webkit-appearance: none;
    color: var(--body-color);
    background: var(--body-bg);
}


/*
    Components
*/
hr {
    border: 1px solid #e5e5e5;
    margin: 1rem auto;
    width: 100%;
}


.box {
    padding: 1em;
    border-radius: var(--border-radius-size);
    border: 1px solid var(--border-color);
    transition: border-color 250ms;
}

.box:hover.clickable {
    border-color: var(--border-color-hover);
}

.button {
    display: inline-block;

    text-align: center;
    white-space: nowrap;

    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    border: 2px solid white;
    border-radius: var(--border-radius-size);

    padding: 0 2rem;
    font-size: 1rem;
    font-weight: bold;

    line-height: 3rem;

    cursor: pointer;

    -webkit-transition: all 0.25s ease-out 0.1s;
    -moz-transition: all 0.25s ease-out 0.1s;
    -ms-transition: all 0.25s ease-out 0.1s;
    -o-transition: all 0.25s ease-out 0.1s;
    transition: all 0.25s ease-out 0.1s;

    font-family: 'Barlow', sans-serif;
    text-transform: uppercase;

    color: white;
    background-color: var(--color-red);
}

.button:hover {
    background-color: #eb654b;
}

.button.is-yellow:hover {
    background-color: #ffbb3c;
}

.button.is-yellow-bright:hover {
    background-color: #ffd429;
}

.button.small {
    font-size: 0.85rem;
    padding: 0 1rem;
    line-height: 2.5rem;
}

.close-button {
    background: none;
    color: var(--body-color);
    font-size: 1.5rem;
    transform: scale(0.6);
    margin-right: 0.1rem;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    aspect-ratio: 1;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: border-color 0.25s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Symbola';
    font-weight: bold;

}

.close-button.text:after {
    content: "×";
    position: absolute;
}

.close-button.color {
    border: 6px solid var(--border-color);
    transform: scale(0.4);
    background: var(--color-red);
}

.close-button:hover {
    border-color: var(--border-color-hover);
}





/* concept icon */

.concept-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.concept-icon .progress-bar {
    aspect-ratio: 1;
    border-radius: 50%;
    width: 120px;
    height: 120px;

    transition: transform 300ms;

    --color-start: #A8DEFB;
    --color-finish: #00A7FF;

    background: conic-gradient(var(--color-start) 0, var(--color-finish) var(--degree), transparent calc(var(--degree)) 100%);
    background-color: var(--color-track);
    position: relative;

    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.concept-icon .progress-bar svg {
    position: absolute;
}

.concept-icon .progress-bar svg:nth-of-type(1) {
    height: 100%;
    width: 100%;
}

.concept-icon .progress-bar svg:nth-of-type(2) {
    height: 100%;
    width: 100%;
    transform: rotate(var(--degree));
    position: absolute;
    right: 0;
}


.concept-icon .hover-overlay {
    position: absolute;
    z-index: 2;
    background: var(--body-bg);
    left: 65%;
    bottom: 70%;
    min-width: 300px;
    pointer-events: none;
    opacity: 0;
}

.concept-icon .progress-bar.clickable {
    cursor: pointer;
}

.concept-icon.locked {
    pointer-events: none;
    filter: saturate(0);
}

.concept-icon.completed .progress-bar {
    --color-start: #FFE88A !important;
    --color-finish: #FFA700 !important;
}

.concept-image {
    height: 84%;
    width: 84%;
    top: 8%;
    left: 8%;
    position: absolute;
    border-radius: 50%;
    background: var(--body-bg);
    border: none;
    padding: 0.5rem;
}

.concept-icon>p {
    font-weight: bold;
    margin-bottom: 0;
}

/* concept graph */
.concept-graph {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 6rem;
    margin: 0 auto;
}

.concept-graph .row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}


.hover-overlay h2 {
    margin: 0.5rem 0;
}

.hover-overlay .buttons {
    display: flex;
    gap: 1rem;
}

/* only show hover overlay if device has easy hover access i.e. non-touch*/
@media (hover: hover) {
    .concept-icon:hover .hover-overlay {
        pointer-events: initial !important;
        opacity: 1 !important;
    }

    .concept-icon .hover-overlay {
        transition: opacity 300ms;
    }
}

@media (hover:none) and (max-width:425px) {
    .concept-icon .hover-overlay {
        position: fixed;
        width: 100%;
        bottom: calc(55px + env(safe-area-inset-bottom));
        left: 0 !important;
    }
}





/* problem/concept practice modal */
.modal {
    position: fixed;
    /* width: 100vw; */
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.problem-practice {
    border: 0;
    width: 100%;
    z-index: 10;
    border-radius: var(--border-radius-size);
    margin: 0 1rem;
    margin-top: 1rem;
    max-width: 728px;
    height: 336px;

}

@media (min-height: 550px) and (min-width:425px) {
    .problem-practice {
        margin-top: 5rem;
    }
}



@media (min-height: 750px) and (min-width:425px) {
    .problem-practice {
        margin-top: 10rem;
    }
}


@media (max-width: 425px) {
    .problem-practice {
        height: 100% !important;
        margin: 0;
    }
}


/*

more styles
*/

.is-yellow-bright {
    background-color: var(--color-yellow);
    color: white;
}

.is-yellow {
    background-color: var(--color-yellow-warm);
    color: white;
}

.is-blue {
    background-color: var(--color-blue);
    color: white;
}

.is-red {
    background-color: var(--color-red);
    color: white;
}

/* interaction */
    .interaction {
        display:flex;
        flex-direction:row;
        width:100%;
        position: relative;
        margin-bottom:1rem;
    }
    .interaction.indented{
        margin-left:2rem;
        width:calc(100% - 2rem);
    }
    .interaction.double-indented{
        margin-left:4rem;
        width:calc(100% - 4rem);
    }

    .interaction .image {
        margin-right:1rem;
        border-radius:50%;
        width:75px;
        height:75px;
        border: 5px solid var(--border-color);
        box-sizing: border-box;
    }
    .interaction .content{
        width:100%;
    }
    .interaction.indented .content{
        width:calc(100% - 2rem);
    }
    .interaction.double-indented .content{
        width:calc(100% - 4rem);
    }
    .interaction .content .by{
        {% comment %} margin-top:12.5px; {% endcomment %}
        margin-top:18.75px;
        margin-bottom:8px;
        margin-left:6px;
    }
    .interaction .content .controls {
        display:flex;
        flex-direction:row;
        gap: 1rem;
    }