@font-face {
    font-family: 'inter';
    src: url(../fonts/Inter-Regular.ttf);
    font-weight: 500;
}

@font-face {
    font-family: 'inter';
    src: url(../fonts/Inter-Bold.ttf);
    font-weight: 700;
}

@font-face {
    font-family: 'inter';
    src: url(../fonts/Inter-SemiBold.ttf);
    font-weight: 600;
}

:root {
    --primary: #1950be;
    --secondary: #000000;
    --base: #ffffff;
    --guided: #832fbd;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
} 

/* Styling for layout.ejs */

html, body {
    height: 100%;
} 

body > footer{
    position: sticky;
    top: 100vh;
    margin-top: 5rem;
} 

body {
    font-family: 'inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.nav-bar {
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5rem;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--base);
    box-shadow: lightgray 0 1px 4px 0px;
    z-index: 1000;
}

.nav-bar > h1 {
    font-size: 1rem;
    font-weight: 500;
}

.nav-bar > h1 > a {
    text-decoration: none;
    color: var(--secondary);
}

.nav-bar > h1> a:hover {
    color: var(--primary);
}

nav ul {
    list-style-type: none;
    display: flex;
    justify-content: space-around;
    gap: 3rem;
}

nav a {
    text-decoration: none;
    color: var(--secondary);
    transition: ease-in-out 0.1s;
}

nav a:visited {
    color: var(--secondary);
}

nav a:hover {
    color: var(--primary);
}

nav a.active {
    font-weight: bold;
    color: var(--primary);
    transition: ease-in-out 0.1s;
}

nav a.active:hover {
    color: #627497;
} 

.nav-actions {
    display: flex;
    gap: 2rem;
}

.logo {
    width: 7rem;
} 

main {
    padding: 0 6rem;
    margin: 0 auto;
    width: 100%;
}

main h1{
    margin-top: 0;
}  

footer {
    background-color: var(--primary);
    color: var(--base);
    text-align: center;
    padding: 10px;
    position: absolute;
    bottom: 0;
    width: 100%;
}

h5 {
    font-size: 1rem;
} 

.guided-label {
    transition: ease-in-out 0.1s;
} 

.guided-label:hover {
    color: var(--guided);
} 

.guided-checkbox{
    accent-color: var(--guided);
} 

/* Base Layout */

.base-page {
    margin-top: 9rem;
    padding: 0 5rem;
    display: grid;
    grid-template-columns: 16rem 1fr 16rem;
} 

.content {
    grid-column-start: 2;
} 

/* Documentation Layout */
.documentation-page {
    display: grid;
    grid-template-columns: 16rem 1fr 16rem;
    padding: 0 5rem;
    margin-top: 9rem;
}

.documentation-page__nav > ul {
    list-style-type: none;
    padding: 0;
    margin: 0.2rem 0;
    position: fixed;
    height: calc(100vh - 15rem);
    overflow-y: auto;
}

.documentation-page__nav li {
    padding: 0.2rem 0;
    list-style-type: none;
}

.documentation-page__nav a {
    color: var(--secondary);
    text-decoration: none;
    transition: ease-in-out 0.1s;
}

.documentation-page__nav a:hover {
    color: var(--primary);
}

.documentation-page__nav a.active {
    color: var(--primary);
    font-weight: bold;
    transition: ease-in-out 0.1s;   
}

.documentation-page__nav a.active:hover{
    color: #627497;
} 

/* Styling Colapsable Menu */
.collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.1rem;
}

.collapsible__nested {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    font-size: 1rem;
    padding-left: 1.5rem;
}

.collapsible__nested .collapsible {
    font-size: 1rem;
}

.collapsible__icon {
    transition: transform 0.3s ease;
    width: 2rem;
}

.collapsible[aria-expanded="true"] .collapsible__icon {
    transform: rotate(90deg);
}

.collapsible[aria-expanded="true"] + .collapsible__nested {
    max-height: 500px; /* Adjust this value based on the expected height of the content */
    transition: max-height 0.3s ease-in;
}

.documentation-page__content-nav{
    text-align: left;
} 

.documentation-page__content-nav-container{
    position: fixed;
} 

.documentation-page__content-nav ul{
    list-style-type: none;
    padding: 0;
    box-sizing: border-box;
    float: right;
    margin: 0;
    margin-right: 2rem;
} 

.documentation-page__content-nav li{
    padding: 0.2rem 0
} 

.documentation-page__content-nav h3{
    margin: 0;
    margin-top: 0.4rem;
} 

.documentation-page__content-nav a{
    color: var(--secondary);
    text-decoration: none;
    transition: ease-in-out 0.1s;
} 

.documentation-page__content-nav a:hover {
    color: var(--primary);
}

.documentation-page__content-nav a.active {
    color: var(--primary);
    font-weight: bold;   
}

/* Styling Markdown */

h1 {
    color: var(--primary);
}

table {
    border: 1px solid #dee2e6;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0;
}

th, td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
}

.table_footnote {
    font-size: smaller;
    margin-top: 0;
}

blockquote {
    background: #dfe9ff;
    border-left: 10px solid var(--primary);
    margin: 1.5em 10px;
    padding: .1em 10px .1em;
    quotes: "\201C""\201D""\2018""\2019";
  }

figure {
    align-items: center;
    text-align: center;
}

figcaption {
    color: #627497;
}

img[alt=Bild] { width: 200px; }

#wrap {
    position: relative;
    display: inline-block;
}

.handle {
    display: block;
    height: 24px;
    width:  24px;
    background-image: url("/images/resize_handle.png");
    background-size: cover;
    position: absolute;
    bottom: 31px;
    right: 0px;
    pointer-events: none;
    z-index: 2;
}

.terminal-challenge {
    background: #000;
    color: #fff;
    padding: 1rem;
    margin: 2rem 0;
    box-shadow: 10px 10px 0 0 #110184;
    resize: both;
    overflow: auto;
    position: relative;
}

pre {
    white-space: pre-wrap; 
    word-wrap: break-word;
}

.guided {
    color: var(--guided);
} 

/* Styling error page*/

.error-content {
    max-width: 800px;
    margin:  0 auto;
}

/* Quiz */
.quiz {
    background-color: var(--primary);
    margin: 3rem 0;
    padding: 2rem;
    border-radius: 1rem;
    color: var(--base);
    box-shadow: 10px 10px 0 0 #110184;
}

.quiz__questions-container {
    font-size: 1.rem;
    margin: 2rem 0;
}

.quiz__question-container{
    margin: 1rem;
    border: 2px solid var(--base);
    font-weight: 600;
}

.quiz__option {
    float: left;
    margin: 0.5rem;
    margin-right: 1rem;
    accent-color: var(--base);
    cursor: pointer;
}

.quiz__option-label {
    display: block;
    cursor: pointer;
    padding: 0 2.5rem;
    transition: ease-in 0.2s;
}

.quiz__option-label:hover, .quiz__option:hover + label {
    box-shadow: 0 0 0px 3px var(--base);
}

.quiz__option:checked + label {
    background-color: #6091dd;
}

.quiz__option-label--correct {
    background-color: #16c179;
}

.quiz__option:checked + label.quiz__option-label--correct {
    background-color: #2be296;
}


.quiz__option-label--incorrect {
    background-color: #b73f3f;
}

.quiz__option:checked + label.quiz__option-label--incorrect {
    background-color: #cf5959;
}

.quiz__feedback-text {
    margin: 0;
    float: left;
}

.quiz__submit-button {
    display: block;
    margin-left: auto;
    color: var(--primary);
    background-color: var(--base);
    border: none;
    padding: 0.4rem 1.2rem;
    font-family: inter;
    font-size: 1.1rem;
    margin-right: 1rem;
    border-radius: 0.3rem;
    cursor: pointer;
}

.quiz__submit-button::before {
    content: "Richtig!";
}

.quiz__submit-button:hover {
    box-shadow: 0 0 0 4px #6091dd;
}

/* Challenge */
.challenge__input {
    background-color: var(--secondary);
    border: none;
    padding: 0.5rem 0.2rem;
    color: var(--base);
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    height: 2.5rem;
    width: 25rem;
    transition: ease-in 0.2s;
}

.challenge__submit-button {
    color: var(--base);
    background-color: var(--primary);
    margin-left: 1rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.3rem;
    padding: 0.4rem 1.2rem;
    font-family: inter;
    font-size: 1.1rem;
    cursor: pointer;
}

.challenge__submit-button:hover {
    background-color: #1b5fe8;
}

.challenge__input--correct {
    box-shadow: #16c179 0 7px 0;
}

.challenge__input--incorrect {
    box-shadow: #b73f3f 0 7px 0;
}

.challenge__feedback-text {
    transition: ease-in 0.2s;
}

.challenge__feedback-text--correct {
    color: #16c179;
}

.challenge__feedback-text--incorrect {
    color: #b73f3f;
}

/* Searchbar */
#searchInput {
    min-width: 15rem;
}

#searchInput::selection {
    background-color: #dfe9ff;
}

#searchInput:focus {
    outline: 1px solid var(--primary);
}

#suggestions {
    border: 1px solid var(--primary);
    min-width: 15rem;
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: absolute;
    background-color: var(--base);
    display: none;
}

#suggestions.suggestions--focussed {
    display: flex;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    text-decoration: none;
    color: var(--secondary);
}

.suggestion-item:hover {
    background-color: #dfe9ff;
}

.suggestion-item__text {
    margin: 0;
    font-size: 0.9rem;
}

.suggestion-item__path {
    font-size: 0.8rem;
    margin: 0;
    color: var(--primary);
}

/* Button for previous and next page */
.btn-link_container {
    display: flex;
    justify-content: space-between;
    padding: 1.2rem;    
}

.btn-link {
    color: var(--base);
    background-color: var(--primary);
    margin-left: 1rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.3rem;
    padding: 0.4rem 1.2rem;
    font-family: inter;
    font-size: 1.1rem;
    cursor: pointer;
}

.btn-link:hover {
    box-shadow: 0 0 0 4px #6091dd;
}

.btn-link:disabled {
    background-color: #627497;;
    cursor: default;
}

.btn-link:disabled:hover {
    box-shadow: none;
}

/* Responsiveness for smaller screen sizes */

@media only screen and (max-width: 1250px) {

    .documentation-page{
        grid-template-columns: 12rem 1fr;
    } 

    .documentation-page__content-nav{
        width: 1px;
        display: none;
        visibility: hidden;
    }  

}
