/* #region local fonts */
@font-face {
    font-family: AgencyFB;
    src: url("res/fonts/AGENCYR.woff") format("woff");
}
@font-face {
    font-family: AgencyFB;
    src: url("res/fonts/AgencyFBBold.woff") format("woff");
    font-weight: bold;
}
/* #endregion */

:root {
    --font-size: 110%;

    --scrollbar-bg: transparent;
    --scrollbar-color: rgba(0,0,0,0.25);

    --tab-angle-margin-right: -1.3em;
    --btn-margin-left: -1.3em;

    /* Normal colors */
    --color-tab-blur-select-hover:  rgba(194, 18, 42, 0.5);
    --color-tab-blur-background:    rgba(55, 55, 60, 0.5);
    --color-tab-blur-bracket:       rgba(40, 40, 44, 0.8);

    --color-tab-entry-background:   rgba(55, 55, 60, 0.8);
    --color-tab-selected-hover:     rgba(194, 18, 42, 0.8);
    --color-tab-selected-hover-border: rgb(142, 142, 143);
    
    --color-path-mode-border:       rgb(255, 78, 29);

    --color-background-challenge-bar-interior: rgba(27, 27, 27, 0.8);
    --color-challenge-bar-interior: rgb(240, 144, 116);
    --color-challenge-bar-progress: rgb(140, 65, 55);

    --color-background-input-text: var(--color-background-challenge-bar-interior);
    --color-input-text: rgb(240, 144, 116);
}
/* #region root elements */
html {
    font-family: AgencyFB, Veranda;
    font-size: var(--font-size);
    letter-spacing: 0.01em;
    overflow-y: scroll;
}   

body {
    margin-top: 0em;
    margin-left: 0em;
    margin-right: 0em;
    background: var(--color-tab-blur-background);
    background-size: cover;
}
hr {
    width: 100%;
    display: none;
}
/* #endregion */

/* #region content areas */
#root-container {
    display: flex;
}

#challenge-content-area {
    display: inline-flex;
    flex-direction: column;
    justify-content: left;
    align-items: center;
    margin-top: 1%;
    width: 100%;
}

#challenge-outer-area {
    display: flex;
    flex-direction: column;
    flex: 0.8 0 0;
    /* flex-grow: 0.8; */
}

#settings-content-area {
    display: flex;
    justify-content: center;
    margin-top: 2%;
    flex-grow: 1;
}

#settings-content-area .tab-button {
    flex-grow: inherit;
}

#path-content-area {
    display: inline-flex;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2%;
    width: 75%;
}

/* #endregion */

/* #region header */
#header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
}
.no-select, button {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */

}
/* if backdrop support, override other options with higher specificity */
@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
    div .tab-blur {
        background-color: var(--color-tab-blur-background);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
    div .tab-selected, div .tab-blur:hover {
        background-color: var(--color-tab-blur-select-hover);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
    div .tab-bracket-blur {
        background-color: var(--color-tab-blur-bracket);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}
.tab-entry {
    display: flex;
    flex-grow: 0.333;
    width: 10em;
    height: 3em;
    align-items: center;
    justify-content: center;
    background-color: var(--color-tab-entry-background);
    border-bottom: 0.3em solid rgb(142, 142, 143);
    color: #ABABAB;
    cursor: pointer;
    letter-spacing: 0.05em;
    font-weight: bold;
    text-transform: uppercase;
}
.tab-selected, .tab-entry:hover {
    background-color: var(--color-tab-selected-hover);
    border-bottom: 0.3em solid var(--color-tab-selected-hover-border);
    color: #F5F5F5;
}
.tab-angle {
    margin-right: var(--tab-angle-margin-right);
    clip-path: polygon(0 0, calc(100% - 1.5em) 0, 100% 100%, calc(0% + 1.5em) 100%);
}
.tab-angle-right {
    margin-left: -0.2em;
    clip-path: polygon(0 0, 100% 0, 100% 100%, calc(0% + 1.5em) 100%);
}
.tab-angle-left {
    margin-right: -1.5em;
    clip-path: polygon(0 0, calc(100% - 1.5em) 0, 100% 100%, 0% 100%);
}
.tab-bracket {
    display: flex;
    flex-grow: 1;
    height: 3.3em;
    position: relative;
    background-color: rgba(40, 40, 44, 0.7);
}
.tab-button {
    flex-grow: 0;
    letter-spacing: 0.05em;
    font-weight: bold;
    text-transform: uppercase;
}
#add-challenge {
    width: 50%;
    height: 2em;
}
/* #endregion */

/* #region level-2 */
#left-bar {
    display: inline-flex;
    flex-direction: column;
    width: 20%;
    /* flex-grow: 0.25; */
    margin-right: 2%;
    margin-left: 2%;
    margin-top: 2%;
}

/* #endregion level-2 */

/* #region nav */
@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
    div.nav-blur {
        background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0), rgba(56, 55, 55, 0.5));
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

div.nav-bar-selected, .nav-bar:hover:not(#help-content) {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0), rgba(194, 18, 42, 0.8));
}
.nav-bar {
    padding-left: 5%;
    padding-right: 5%;
    padding-top: 3%;
    padding-bottom: 3%;
    margin-bottom: 2%;
    border-bottom-right-radius: 0.5em;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0), rgba(56, 55, 55, 0.8));
    color: white;
    text-align: center;
    font-size: 1.2em;
    letter-spacing: 0.1em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}
/* #endregion */

/* #region help */
#help-caret {
    -webkit-transition-property: transform;
    -moz-transition-property: transform;
    -o-transition-property: transform;
    transition-property: transform;
    -webkit-transition-duration: 200ms;
    -moz-transition-duration: 200ms;
    -o-transition-duration: 200ms;
    transition-duration: 200ms;
    display: inline-block;
    transform: rotate(0deg);
    -ms-transform: rotate(0deg);	 /*  for IE  */
    /* 	for browsers supporting webkit (such as chrome, firefox, safari etc.). */
    -webkit-transform: rotate(0deg);
}
#help-caret.selected {
    display: inline-block;
    transform: rotate(90deg);
    -ms-transform: rotate(90deg);	 /*  for IE  */
    /* 	for browsers supporting webkit (such as chrome, firefox, safari etc.). */
    -webkit-transform: rotate(90deg);
    transition-duration: 100ms;
}
#help-content {
    display: flex;
    max-height: 0em;
    overflow: hidden;
    flex-grow: 1;
    flex-direction: column;
    align-items: center;
    cursor: unset;

    background-image: linear-gradient(to right, rgba(56, 55, 55, 0.4), rgba(56, 55, 55, 0.8));
    color: lightgrey;
    text-align: unset;
    font-size: unset;
    letter-spacing: unset;
    font-weight: unset;
    text-transform: unset;

    padding-top: 0em;
    padding-bottom: 0em;

    -webkit-transition: max-height 200ms ease-out;
    -moz-transition: max-height 200ms ease-out;
    -o-transition: max-height 200ms ease-out;
    transition: max-height 200ms ease-out;
}
#help-content.selected {
    max-height: 100em;
    transition: max-height 500ms ease-in;
    padding-top: 3%;
    padding-bottom: 3%;
}
#help-content h2 {
    margin-block-start: 0em;
    margin-block-end: 0em;
}
.help-section {
    display: flex;
    align-items: inherit;
    flex-direction: column;
}
.help-section:first-child h3 {
    margin-block-start: 0em;
}
#help-keywords {
    display: flex;
    align-items: center;
    flex-direction: column;
}
#help-keywords div {

    display: inline-flex;
    flex-grow: 0.3;
    flex-direction: column;
    align-items: center;
}
#help-keywords div:not(:first-child) {
    margin-top: 1em;
}
#help-keywords h4 {
    color: lightgrey;
    margin-block: 0em;
}
#help-keywords span.comma {
    color: lightgrey;
}
/* #endregion */

/* #region challenge bars */
@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
    div.challenge-bar-blur {
        background-color: rgba(56, 55, 55, 0.5);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

.challenge-bar {
    display: flex;
    flex-grow: 0;
    width: 100%;
    box-sizing: border-box;
    padding-left: 1%;
    padding-right: 3%;
    padding-top: 1%;
    padding-bottom: 1%;
    margin-bottom: 1%;
    background-color: rgba(56, 55, 55, 0.8);
    color: lightgrey;
}

.challenge-bar-completed::after {
    position: absolute;
    content: '';
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: rgba(50, 50, 50, 1);
    opacity: 0.4;
}

.challenge-bar-data {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
}

.challenge-bar-title {
    align-content: center;
    width: 100%;
}

.cb-type {
    display: inline-block;
    width: 2ch;
    padding: 0.4ch 0.5ch 0.2ch 0.5ch;
    margin-right: 1ch;
    text-align: center;
}
.type-br {
    background-color: rgb(64, 148, 158);
    color: rgb(114, 252, 255);
}
.type-a {
    background-color: rgb(108, 79, 198);
    color: rgb(199, 148, 255);
}
.type-c {
    background-color: rgb(215, 154, 8);
    color: rgb(255, 254, 24);
}

.challenge-bar-interior {
    position: relative;
    display: inline-flex;
    width: 95%;
    min-height: 1.5em;
    background-color: rgba(27, 27, 27, 0.8);
    color: rgb(240, 144, 116);
}

.challenge-bar-interior[for-data] {
    padding-left: 0.2em;
    padding-top: 0.2em;
    padding-right: 2em;
    width: unset;
    min-height: 0em; 
    overflow-wrap: normal;
}

.challenge-bar-interior > span {
    position: absolute;
    top: 0em;
    left: 0em;
    /* Bottom spacing controlled by challenge-bar-interior min-height */
    padding-left: 0.2em;
    padding-top: 0.2em;
}

.challenge-bar-progress {
    position: absolute;
    top: 0em;
    left: 0em;
    height: 100%;
    padding: 0.5% 1% 0.5% 1%;
    background-color: var(--color-challenge-bar-progress);
    z-index: -1;
}

.challenge-bar-progress-text {
    display: inline-flex;
    /* width: 2em; */
    height: 100%;
    align-items: center;
    padding-left: 0.2em;
}

.challenge-bar-progress-stepper {
    display: inline-flex;
    align-content: center;
    /* 3.5em is the size of the angle on the bar */
    /* width: calc(100% - 5em); */
    /* Use this to allow the inside text to grow */
    flex-grow: 1;
    height: 100%;
    margin-left: 1em;
    margin-right: 2em;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    opacity: 0;
    transition-property: opacity;
    transition-duration: 100ms;
}

.challenge-bar-progress-stepper:hover {
    opacity: 1;
}

.stepper-divide {
    width: 1.5em;
    height: 100%;
    background-color: white;
}

.dot {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    height: 100%;
    background-color: transparent;
}

.dot.plus {
    background: no-repeat url("res/images/plus.svg") 0% / 100%;
}
.dot.minus {
    background: no-repeat url("res/images/minus.svg") 0% / 100%;
}
.dot-half:hover .dot.minus {
    background: no-repeat url("res/images/minus-hover.svg") 0% / 100%;
    filter: brightness(1.5);
}
.dot-half:hover .dot.plus {
    background: no-repeat url("res/images/plus-hover.svg") 0% / 100%;
    filter: brightness(1.5);
}
.dot-half {
    display: inline-flex;
    flex-grow: 0.5;
    cursor: pointer;
}
.dot-half:last-child {
    justify-content: flex-end;
}

.dot > img {
    opacity: 0;
    height: 1em;
}

.keyword {
    color: rgb(255, 208, 0);
}

.star-container {
    display: flex;
    width: fit-content;
    justify-content: end;
    align-items: center;
}
/* Spans that are children */
.star-container > span {
    /* 3 character width. +10 is max, but +1 is same width now */
    width: 3ch;
    font-size: 1.4em;
    font-weight: bold;
    margin-right: 0.5em;
}
.star-five {
    background: no-repeat url("res/images/star-five.svg") 50% / 100%;
}
.star-five:hover {
    background: no-repeat url("res/images/star-five-hover.svg") 50% / 100%;
    filter: brightness(1.5);
}
.star-five > img {
    opacity: 0;
}
.icon {
    display: inline-flex;
    align-items: center;
    margin-left: 1em;
    vertical-align: top;
}
/* Until/unless all our images are SVGs it doesn't make sense to scale them based
on relative measures, just use the png image sizes */
.icon img {
    max-height: 32px;
}
/* Do the edit icon with CSS since sizing is easier this way */
.edit-icon {
    opacity: 0;
    background: no-repeat url("res/images/edit-icon-32x32.png") 50% / 100%;
    transition-property: opacity;
    transition-duration: 100ms;
}
.edit-icon:hover {
    background: no-repeat url("res/images/edit-icon-32x32-hover.png") 50% / 100%;
    filter: brightness(1.5);
}
.edit-icon img, .search-icon img {
    opacity: 0;
}

.search-icon {
    background: no-repeat url("res/images/search-icon.png") 50% / 100%;
}
.search-icon:hover, .search-icon.selected {
    background: no-repeat url("res/images/search-icon-hover.png") 50% / 100%;
    filter: brightness(1.5);
}
/* Make the icon visible when hovering on the entire div */
.challenge-bar:hover .edit-icon, .challenge-bar:hover .dot-icon {
    opacity: 1;
}
.challenge-editor {
    flex: 0 0 100%;
    display: flex;
    justify-content: space-between;
    overflow: hidden;
}
.edit-mode {
    display: inline-block;
    width: 7ch;
    height: 2em;
    padding: 0.4ch 0.5ch 0.2ch 0.5ch;
    margin-right: 1ch;
    text-align: center;
}
.challenge-editor select[data-chosen='BR'] {
    background-color: rgb(64, 148, 158);
    color: rgb(114, 252, 255);
}
.challenge-editor select[data-chosen='A'] {
    background-color: rgb(108, 79, 198);
    color: rgb(199, 148, 255);
}
.challenge-editor select[data-chosen='C'] {
    background-color: rgb(215, 154, 8);
    color: rgb(255, 254, 24);
}
.challenge-editor .star-container {
    display: inline-flex;
    height: 100%;
    align-content: center;
    width: 40%;
    flex-wrap: wrap;
    flex-direction: row;
}
.challenge-editor .star-container .edit-text-div {
    box-sizing: border-box;
}
.challenge-text-container {
    display: inline-flex;
    flex-direction: column;
    width: 60%;
}
.challenge-editor-line-1 {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}
.challenge-editor-line-1 input[for-data="title"] {
    flex-grow: 1;
}
.challenge-editor-line-2 {
    margin-top: 0.2em;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}
.line-2-inputs {
    flex-grow: 1;
    display: inline-flex;
}
.line-2-inputs > input[type="number"] {
    width: 40%;
}
.line-2-inputs > span {
    display: inline-flex;
    width: 10%;
    height: 100%;
    justify-content: center;
    align-items: center;
}
.edit-icon.edit-checkmark {
    opacity: 1;
    background: no-repeat url("res/images/checkmark.png") 50% / 100%;
}
.edit-icon.edit-checkmark:hover {
    background: no-repeat url("res/images/checkmark-hover.png") 50% / 100%;
}
.edit-checkmark img {
    opacity: 0;
}
.edit-icon.edit-delete {
    opacity: 1;
    background: no-repeat url("res/images/trashcan.png") 50% / 100%;
}
.edit-icon.edit-delete:hover {
    background: no-repeat url("res/images/trashcan-hover.png") 50% / 100%;
}
.edit-delete img {
    opacity: 0;
}
/* #endregion challenge bars */

/* #region Challenge Filter */
#challenge-filter-area {
    display: flex;
    /* width: fit-content; */
    width: 2.4em; /* 1em from the search icon, .4 is 2x padding */
    background-color: rgba(56, 55, 55, 0.8);
    color: lightgrey;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0.2em;
    transition-property: width;
    transition-duration: 400ms;
}
#challenge-filter-area.selected {
    width: 100%;
}
#challenge-filter-area img {
    width: 1em;
    height: 1em;
}
#challenge-filter-area :is(input[type="button"], button) {
    letter-spacing: unset;
    font-weight: normal;
    text-transform: none;
    padding-top: 0.1em;
}
#filter-bar-textbox {
    margin-left: 1em;
    min-height: auto;
}
#btn-filter, #btn-filter-clear, #btn-filter-completed {
    height: auto;
}
/* #endregion */

/* #region Settings */
.settings-content {
    display: inline-flex;
    flex-grow: 0.5;
    padding: 1% 3% 1% 1%;
    margin-bottom: 1%;
    background-color: rgba(56, 55, 55, 0.8);
    color: lightgrey;
    column-gap: 1em;
}

@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
    div.settings-blur {
        background-color: rgba(56, 55, 55, 0.5);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

#import-export-area {
    display: inline-flex;
    /* flex-direction: column; */
    flex-wrap: wrap;
    flex-basis: 25%;
    column-gap: 0.5em;
    row-gap: 0.25em;
}
#import-export-area input {
    flex-grow: 1;
}
#import-export-area > div {
    display: inherit;
    flex-basis: inherit;
    column-gap: inherit;
    row-gap: inherit;
}
#import-export-text {
    width: 100%;
}
/* #endregion Settings */

/* #region Optimal Path */
#path-content {
    display: inline-flex;
    flex-direction: row;
    /* row-gap: 1em; */
    flex-wrap: wrap;
    padding-left: 2em;
    padding-right: 2em;
}
#path-content div.title-break {
    display: flex;
    flex-basis: 100%;
    justify-content: center;
}
#path-content div.entries {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    flex-basis: 100%;
    row-gap: 1em;
    justify-content: center;
}
div.entries {
    padding: 1em;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0), 
        rgba(56, 55, 55, 0.8), rgba(0, 0, 0, 0.0));
    text-transform: capitalize;
}
.path-entry {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    justify-content: flex-end;
    margin-right: 1em;
    cursor: pointer;
}
.path-entry-text {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}
.path-entry span {
    margin-top: 0.5em;
}
.path-entry img, .image-crisp {
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: -o-crisp-edges; /* Opera */
    image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
}
.path-entry .path-entry-name {
    font-weight: bolder;
}
.path-entry[mode-name] {
    border-color: transparent;
    border-width: 1px;
    border-style: solid;
    min-width: 1.5em;
}
.path-entry[mode-name].selected {
    border-color: var(--color-path-mode-border);
    border-width: 1px;
    border-style: solid;
}
/* #endregion Optimal Path */

/* #region Widgets */
.github-corner {
    position: absolute;
    left: 0.5em;
    transform: rotate(60deg);
}
/* Make the progress bar look like it's slanted */
.bar-angle {
    clip-path: polygon(0 0, calc(100% - 1.5em) 0, 100% 100%, 0% 100%);
}

/* Scrollbar customizations */
::-webkit-scrollbar-track {
    -webkit-border-radius: 10px;
    border-radius: 10px;
}
  
*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    background-color: var(--scrollbar-bg, auto);
}
  
*::-webkit-scrollbar-thumb {
    border-radius: 10px;
    border: 2px solid var(--scrollbar-bg, auto);
    background: var(--scrollbar-color);
}
  
*::-webkit-scrollbar-corner {
    background-color: var(--scrollbar-bg, auto);
}

input, textarea, button {
    font-size: inherit;
    font-family: inherit;
}
input[type="button"], button {
    display: flex;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0 0 0 0;
    white-space: nowrap;
    box-sizing: content-box;
}
input[type="text"], input[type="number"] {
    margin-left: 0.5em;
    min-width: 0em;
    border-width: 0px;
    outline-width: 0px;
}
input[type="text"]:focus-visible, input[type="number"]:focus-visible {
    box-shadow: 0px -1px 0px 0px var(--color-challenge-bar-progress) inset;
}

textarea, input[type="text"], input[type="number"] {
    background-color: var(--color-background-input-text);
    color: var(--color-input-text);
}
textarea:focus-visible, select:focus-visible {
    outline: solid var(--color-challenge-bar-progress) 1px;
}
/* #endregion */