/* All */

*, *::before, *::after {
    box-sizing: border-box;
}

/* index.html */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Titillium Web', sans-serif;
}

header {
    background-color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav {
    margin: 0;
    padding: 15px;
    display: flex;
    justify-content: space-between; /* Align items to the right */
    background-clip: padding-box; /* Set the background-clip property to padding-box */
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    margin-left: 20px; /* Adjust margin to separate items */
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: normal; /* Use the regular (normal) version of the font */
    position: relative;
    transition: color 0.3s ease; /* Add transition for smooth color change */
}

nav a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px; /* Set a thicker line */
    bottom: -2px; /* Raise the line up a bit */
    left: 0;
    background-color: var(--ot-blue); /* Use the named color */
    transition: width 0.3s ease; /* Add transition for smooth width change */
}

nav a:hover {
    color: var(--ot-blue); /* Change color on hover to the named color */
}

nav a:hover::before {
    width: 100%; /* Expand the underline on hover */
}

main {
    padding: 0;
    container: container-main / inline-size;
}

.home {
    height: 100vh;
    background: url('opentesting-city-svgo.svg') center / cover no-repeat;
    container: container-home / size;
}

.banner {
    height: calc(100vh - 10ex);
    width: 75%;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Center the content horizontally */
    text-align: center;
}

.banner .img-container {
    padding: 1.25ex 1.25em;
    margin: auto;
}

.banner .img-container img {
    display: block;
    width: 100%;
    margin: auto;
}

.logo {
    position: relative;
    width: var(--big-logo-width);
    font-size: var(--font-size-h1);
    background-color: white;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Covering the inner shadow with an extra 1px margin */
.banner .logo::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    display: block;
    width: 100%;
    height: 12px;
    background-color: white;
    z-index: 2;
}

.promo {
    min-width: 280px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Hiding the second logo above the promo by default */
.promo .img-container {
    display: none;
}

.promo h2 {
    margin: 0;
    padding: 1.25em;
    font-size: var(--font-size-h2);
    font-weight: lighter; /* Use a lighter font weight */
    color: black;
}

.button-container {
    position: relative;
    width: fit-content;
    margin: auto;
    background-color: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Covering the inner shadow with an extra 1px margin */
.button-container::after {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    display: block;
    width: 100%;
    height: 12px;
    background-color: white;
    z-index: 2;
}

.try-it-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: calc(1ex + 8px + 12px) 2.5em;
    border: none;
    border-radius: 5px; /* Adjust rounded corners */
    background-color: var(--ot-blue); /* Use the named color */
    color: white; /* Set text color to white */
    font-weight: bold; /* Use bold font weight for the button text */
    text-decoration: none;
}

.try-it-btn:hover {
    background-color: #0e3a7d;
    transform: translateY(-8px); /* Move the button up by 10px on hover */
    transition: background-color 0.2s ease, transform 0.2s ease; /* Faster transition */
}

.try-it-btn:not(:hover) {
    transition: background-color 0.2s ease, transform 0.2s ease; /* Transition when not hovered */
}

@container container-main (850px < width <= 1200px) {
    * {
        --font-size-h1: 2.5em;
        --font-size-h2: 1.25em;
        --big-logo-width: 450px;
    }
    .home {
        background-position: left;
    }
}

@container container-main (width <= 850px) {
    * {
        --font-size-h1: 2em;
        --font-size-h2: 1em;
    }
    .home {
        background-position: left;
    }
    .logo {
        display: none;
    }
    .promo .img-container {
        display: block;
        max-width: 320px;
        padding: 3ex 2em 1ex 2em;
    }
}

.learn-more {
    position: sticky;
    bottom: 20px;
    text-align: center;
    color: var(--ot-blue); /* Use the named color */
}

.learn-more p {
    margin: 0; /* Set margin to 0 */
    font-size: 1em; /* Keep the original font size */
}

.learn-more-arrow {
    width: 12px; /* Adjust the width of the arrow */
    height: 12px; /* Adjust the height of the arrow */
    display: inline-block;
    border-left: 2px solid var(--ot-blue); /* Use the named color for lines */
    border-bottom: 2px solid var(--ot-blue); /* Use the named color for lines */
    transform: rotate(-45deg); /* Rotate the lines to form a "V" */
    margin-top: 3px;
}

.learn-more a:link {
    color: inherit;
    text-decoration: none;
}

@container container-home (height <= 450px) {
    .learn-more {
        display: none;
    }
}

.index-content {
    padding: max(5%, 40px);
    container: container-content / inline-size;
}

.index-content :target {
    display: block;
    position: relative;
    top: calc(-2ex - 2 * 15px - 30px); /* Offsetting links so they don't overlap with the navbar */
    visibility: hidden;
}

.index-content h2 {
    color: var(--ot-blue);
}

.features-grid {
    display: grid;
    grid-template-columns: [left] 1fr [mid-left] 20% [mid-right] 1fr [right];
    grid-template-rows: auto;
    gap: 20px; /* Spacing between grid items */
}

.features-grid section, .feature-image-after {
    display: contents; /* Making the elements "transparent" to the grid */
}

.feature-image-before {
    display: none; /* Hiding the copy of the image before the middle description by default */
}

.feature-image {
    grid-row: span 1;
    grid-column: span var(--feature-image-span);
    place-self: center;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-image img {
    position: absolute;
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.feature-image .figure-open-test-banks {
    max-width: 275px;
}

.feature-image .figure-open-test-scores {
    max-width: 250px;
}

.feature-image .figure-open-source-code {
    max-width: 8em;
}

.feature-description {
    grid-row: span 1;
    grid-column: span var(--feature-description-span);
    place-self: center;
    padding: 20px;
    margin: var(--feature-description-margin);
    background-color: #e8f0fcff;
    border-radius: 15px;
}

.feature-description h2 {
    margin: 4px 0 16px 0;
}

.feature-description h2::before {
    content: "";
    display: inline-block;
    background: url('sparkles-svgo.svg') left / contain no-repeat;
    width: 1.25em; /* this is the element width, not the image width*/
    height: 1em;
}

@container container-content (width <= 600px) {
    * {
        --feature-image-span: 3;
        --feature-description-span: 3;
        --feature-description-margin: 0;
    }

    .feature-image-before {
        display: contents; /* Showing the image copy before the middle description */
    }

    .feature-image img {
        position: relative;
        margin: 40px 0 20px 0;
    }
    
    .feature-image-after {
        display: none; /* Hiding the image after the middle description */
    }
}

footer {
    background-color: var(--very-light-gray); /* Set background color for the footer */
    padding: 20px; /* Add padding for better spacing */
    text-align: center; /* Center-align text */
}

footer p {
    margin: 0; /* Remove default margin for <p> element */
}

/* documentation.html */

section.documentation {
    width: 90%;
    min-height: calc(100svh - 2 * 15px - 2 * 20px - 3.1em);
    margin: auto;
    padding: 2em;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@container container-main (width <= 850px) {
    section.documentation {
        justify-content: start;
    }
}

section.documentation h1 {
    color: var(--ot-blue);
}

section.documentation a {
    position: relative;
    text-decoration: none;
    font-weight: bold;
    color: var(--ot-blue);
}

section.documentation a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 1.5px;
    bottom: -1.5px;
    left: 0;
    background-color: var(--ot-blue);
    transition: width 0.3s ease;
}

section.documentation a:hover::after {
    width: 100%;
}

section.documentation .code {
    font-style: normal;
    font-family: monospace;
    background-color: var(--very-light-gray);
    border-radius: 5px;
}

section.documentation em.code {
    margin: 0 0.5ex;
    padding: 4px;
}

section.documentation p.code {
    margin: 2.5em 0;
    padding: 8px;
}

.demo-profiles-content {
    container: container-demo-profiles-content / inline-size;
}

.demo-profiles-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: calc(100svh - 2 * 15px - 2 * 20px - 3.1em);
    padding: 2em;
    container: container-demo-profiles / inline-size;
}

.demo-profiles-container h1 {
    margin-bottom: 0;
    color: var(--ot-blue);
    text-align: center;
}

.demo-profiles {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
}

.demo-profiles a {
    display: block;
    max-width: 25%;
    height: 100%;
    padding: 1em;
    text-align: center;
    color: inherit;
    text-decoration: none;
    border-radius: 10px;
    transition: transform 0.2s ease-out;
}

.demo-profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.demo-profiles a h2 {
    margin-top: 0;
}

.demo-profiles a img {
    max-width: 100px;
    margin-bottom: 1.25em;
}

.demo-profiles a:hover {
    transform: translateY(-2em);
}

#demo-profile-test-taker {
    background-color: var(--ot-red-light);
}

#demo-profile-test-taker h2 {
    color: var(--ot-red);
}

#demo-profile-test-administrator {
    background-color: var(--ot-dark-orange-lighter);
}

#demo-profile-test-administrator h2 {
    color: var(--ot-dark-orange-darker);
}

#demo-profile-developer {
    background-color: var(--ot-green-light);
}

#demo-profile-developer h2 {
    color: var(--ot-green-dark);
}

@container container-demo-profiles-content (width < 900px) {
    .demo-profiles-container {
        height: max-content;
    }
}

@container container-demo-profiles (width < 900px) {
    .demo-profiles-container h1 {
        margin-bottom: 2em;
    }

    .demo-profiles {
        flex-direction: column;
        gap: 4em;
        margin-bottom: 2em;
    }

    .demo-profiles a {
        width: 75%;
        max-width: none;
        margin: 0 2em;
    }
}

nav .demo-generators {
    display: none; /* Hidden by default - normally 'inline' */
    margin-left: 5px;
}

nav .demo-generators input {
    appearance: none;
    margin: 0;
    padding: 0;
}

body:has(nav input:checked) .sidebar { /* Clicking on "Generators"  */
    translate: 0;
    opacity: 1;
}

body:has(nav input:checked) .app { /* Clicking on "Generators"  */
    opacity: 0.25;
}

.demo-content {
    display: flex;
    min-height: calc(100svh - 2 * 15px - 2 * 20px - 3.1em);
}

.sidebar {
    width: 300px;
    padding: 20px;
    color: white;
    background-color: var(--ot-blue);
    flex: 0 0 auto;
}

.tree-view {
    margin: 0;
    padding: 0;
    padding-inline-start: 1ex;
}

.tree-view ul {
    padding: 0.5ex 0 0.5ex 1.5em;
}

.tree-view li {
    display: block;
    position: relative;
    padding: 0;
}

.selection-list li {
    width: fit-content;
    cursor: pointer;
}

@media (width < 900px) {
    nav .demo-generators {
        display: inline;
    }

    .sidebar {
        position: absolute;
        min-height: calc(100svh - 2 * 15px - 2 * 20px - 3.1em);
        translate: -100%;
        opacity: 0;
        transition: translate 300ms ease-out, opacity 300ms ease-out;
        z-index: 5;
    }
}

.app {
    display: flex;
    flex-direction: column;
    padding: 40px;
    flex-grow: 1;
}

.app > * {
    flex: 1;
}

.app-init {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-init .main-instruction {
    margin: 2em 1em;
    text-align: center;
    font-size: 2.5ex;
    color: var(--light-gray);
}

.app-init .details {
    padding: 1.5em 2em;
    border-radius: 10px;
    background-color: var(--ot-dark-orange-lighter);
    opacity: 0;
    translate: 0 10px;
    animation: 1s 0.1s forwards fade-in;
}
@keyframes fade-in {to{opacity: 100; translate: 0;}}

.app-init .details h2 {
    font-size: 1.2em;
    color: var(--ot-dark-orange-darker);
}

.app-init .details p {
    margin: 0;
}

.app-init .title-how-to-use {
    margin: 0 0 2ex 0;
}

.app-init .title-learn-more {
    margin: 2ex 0;
}

.app-init .details em {
    font-style: italic;
}

.app-content {
    display: none; /* Hidden by default - normally 'flex' */
    flex-direction: column;
    container: container-app-content / inline-size;
}

.main-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 1ex;
}

.generator-header {
    display: flex;
    flex-direction: row;
    align-items: last baseline;
    gap: 2ex;
}

.generator-header span {
    height: fit-content;
}

.generator-header .title {
    font-weight: bold;
    color: var(--ot-blue);
}

.generator-header .loader {
    width: 1.5ex;
    height: 1.5ex;
    border-radius: 50%;
    border: 0.25ex solid var(--ot-blue);
    border-right-color: transparent;
    animation: l2 1s infinite linear;
}
@keyframes l2 {to{transform: rotate(1turn)}}

.generator-header .subtitle {
    font-size: small;
    font-style: italic;
    color: var(--light-gray);
}

.main-header .score-widgets {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: fit-content;
    gap: 1em;
}

.main-header .score {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.75ex;
    width: fit-content;
    padding: 0 10px;
    border-radius: 2em;
    background-color: var(--ot-light-orange-lighter);
}

.main-header .score-text, .main-header .score-ratio, .score-widgets button {
    font-size: small;
}

.main-header .score-percent {
    padding: 0 8px;
    background-color: var(--ot-dark-orange-darker);
    color: white;
    font-weight: bold;
}

.score-widgets button {
    padding: 0;
    font-family: 'Titillium Web', sans-serif;
    color: var(--light-gray);
    text-decoration: underline;
    cursor: pointer;
    background-color: transparent;
    border: none;
    transform: translateY(-1px);
}

.key-form {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.key-form .input-container {
    flex: 1;
}

.key-form input, .key-form button {
    height: 36px;
    border-radius: 5px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 1em;
}

.key-form input {
    width: 100%;
    padding: 1px 0 1px 10px;
    border: 2px solid #e1e1e1;
}

.key-form .buttons-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 3em;
}

.key-form button {
    display: inline-flex;
    align-items: center;
    padding: 8px;
    border: none;
    cursor: pointer;
    color: white;
    background-color: var(--ot-blue);
}

.error {
    display: none;
    margin-top: 10px;
    padding: 5px 10px 5px 10px;
    background-color: var(--ot-red-light);
    color: var(--ot-red);
    border-radius: 5px;
    align-items: center;
}

.error::before {
    content: "";
    display: inline-block;
    background: url('warning-ot-red-svgo.svg') left center / contain no-repeat;
    width: 1.5em; /* This is the element width, not the image width*/
    height: 1em;
}

.error-text {
    width: calc(100% - 1.5em);
    word-wrap: break-word;
}

.main-view {
    display: flex;
    flex-direction: column;
    margin-top: 16px;
    flex: 1;
}

.main-view > * {
    flex: 1;
}

.view-init {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 80%;
    margin: auto;
}

.view-init p {
    margin: 0;
    text-align: center;
    font-size: 2.5ex;
    color: var(--light-gray);
}

.init-up-arrow {
    display: block;
    width: 2px;
    height: 45px;
    margin: 0 auto 20px auto;
    background-color: var(--light-gray);
}

.init-up-arrow::after {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--light-gray);
    border-left: 2px solid var(--light-gray);
    transform: translate(calc(-50% + 1px), 2px) rotate(45deg);
}

.question {
    display: none; /* Hidden by default - normally 'flex' */
    flex-direction: column;
    justify-content: center;
    max-width: 80%;
    margin: 5vh auto 5vh auto;
    font-size: calc(0.75 * 1.5em);
}

.prompt .blank::before {
    content: "____________";
    font-family: Arial, sans-serif, monospace;
}

.options {
    display: flex;
    flex-direction: column;
    justify-content: center;
    container: container-options / inline-size;
}

.options .option-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.options table {
    margin: 2em 0;
    border-collapse: separate;
    border-spacing: 1em 0;
}

.options thead {
    font-weight: bold;
    color: var(--ot-blue);
}

.options thead td {
    padding: 0 0 1ex 0;
}

.options tbody td, tbody span {
    padding: 0.5ex 1.5ex;
}

.options tbody label {
    cursor: pointer;
}

.options tbody span:hover {
    border-radius: 20ex;
    background-color: var(--ot-light-blue);
}

.options tbody input {
    position: absolute;
    height: 0;
    width: 0;
    opacity: 0;
}

.options tbody input:checked + span {
    border-radius: 20ex;
    color: white;
    background-color: var(--ot-blue);
}

.options td {
    text-align: center;
}

@container container-options (width <= 600px) {
    .options .option-container {
        flex-direction: column; 
    }
}

.submit-response-button {
    margin: 0 auto;
    padding: 0.8ex 16px;
    border-width: 1px;
    border-color: var(--ot-blue);
    border-radius: 50px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 1em;
    color: var(--ot-blue);
    background-color: white;
    cursor: pointer;
}

.next-step-form {
    display: flex;
    flex-direction: row;
    align-items: last baseline;
    gap: 10px;
}

#skip-question-form {
    justify-content: right;
}

.skip-button {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Titillium Web', sans-serif;
    text-decoration: underline;
    color: var(--dark-gray);
    background-color: transparent;
}

.skip-hint {
    font-size: 0.8em;
    font-style: italic;
    color: var(--dark-gray);
}

@container container-app-content (width < 550px) {
    .main-header {
        flex-direction: column;
    }

    .main-header .score-widgets {
        margin-top: 20px;
        margin-left: auto;
        margin-right: auto;
    }

    .key-form {
        flex-direction: column;
        gap: 1em;
    }

    .key-form .buttons-container {
        justify-content: space-evenly;
        gap: 0;
    }

    .error {
        margin-top: 1em;
    }

    #skip-question-form {
        justify-content: center;
    }
}

.answer {
    display: none; /* Hidden by default - normally 'flex' */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3ex 3em;
    border-radius: 10px;
    box-shadow: 0 0px 10px var(--light-gray);
}

.answer .title {
    padding-bottom: 1.5ex;
    text-align: center;
    font-weight: bold;
    font-size: calc(0.85 * 1.5em);
    color: var(--ot-blue);
}

.answer .summary::before {
    content: "Summary:";
    padding-right: 1em;
    font-weight: bold;
    color: var(--ot-blue);
}

.answer .summary .correct, .answer .summary .correct-answer {
    color: green;
}

.answer .summary .incorrect, .answer .summary .incorrect-answer {
    color: red;
}

.answer .summary .correct-answer, .incorrect-answer {
    font-weight: bold;
}

.answer .explanation::before {
    content: "Explanation:";
    padding-right: 1em;
    font-weight: bold;
    color: var(--ot-blue);
}

#next-question-form {
    margin-top: 40px;
    justify-content: center;
}

.next-question-button {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 1em;
    color: white;
    background-color: var(--ot-blue);
    cursor: pointer;
}