:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-light: #f1f1f1;
    --color-gray-dark: #494949;

    --font-size-base: 100%;
    --font-size-h1: clamp(2.5rem, 3vw, 3.5rem);
    --font-size-h2: 1.5rem;
    --font-size-content-h2: clamp(2rem, 3vw, 2.5rem);
    --font-size-aside: 2rem;
    --font-size-nav: 1.5rem;
    --font-size-form: 2rem;
    --font-size-button: 1rem;

    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 2.5rem;
    --spacing-nav-side: 5.25rem;
    --spacing-nav-link: 4rem;

    --content-height: calc(100vh - 6rem - 4.5rem);
    --content-height-mobile: calc(100vh - 6rem - 4.5rem);
    --logo-height: 3rem;
    --border-width: 0.25rem;
    --button-min-width: 5rem;
    --login-height: calc(100vh - 15rem - 6rem - 4.5rem);

    --object-position: center;
}

*, *::after, *::before {
    margin:0px;
    padding:0px;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    font-family: arial;
}

body {
    padding-top: 6rem;
    padding-bottom: 4.5rem;
}

.lernseite-content > h1, .home h1 {
    font-size: var(--font-size-h1);
    text-align: var(--object-position);
    margin: 0;
    color: var(--color-black);
    background-color: var(--color-white);
    font-weight: 300;
}

h2 {
    font-size: var(--font-size-h2);
    margin: 0;
}

h3 {
    font-size: clamp(1rem, 2vw, 1.6rem);
    margin: 0;
}

button {
    color: var(--color-white);
    background-color: var(--color-black);
    cursor: pointer;
    font-size: var(--font-size-button);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

button:hover {
  background-color: var(--color-gray-dark);
}

*:not([type="hidden"]) + button {
  margin-top: 1rem;
}

p, th, td {
}

@media (max-width: 475px) {

    html {
        min-width: 340px
    }
    
    .lernseite {
        display: block;
    }
}
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 6rem;
    z-index: 9999;
    background-color: black;
}

header nav {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 min(var(--spacing-nav-side), 4vw);
}

header nav .logo {
    height: var(--logo-height);
}

header nav .spacer {
    flex-grow: 1;
}

header nav .nav-gap {
    width: var(--spacing-nav-link);
    flex-shrink: 0;
}

header nav .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem var(--spacing-nav-link);
    min-width: 0;
}

header nav a:link {
    color: var(--color-white);
    text-decoration: none;
    font-size: var(--font-size-nav);
}

header nav a:visited {
    color: var(--color-white);
}

header nav a:hover {
    color: var(--color-white);
    text-decoration: underline;
}

header nav a:active {
    color: var(--color-white);
}

.menu-toggle {
    display: none;
}

aside {
    position: sticky;
    top: 6rem;
    align-self: start;
    background-color: var(--color-white);
    padding:3rem;
}

aside h2 {
    font-size: var(--font-size-aside);
    margin-bottom: 2rem;
}

aside h2 a {
    font-size: var(--font-size-aside);
}

aside ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

aside a {
    color: var(--color-black);
    font-size: var(--font-size-nav);
}

aside a:hover {
    color: #565656;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-black);
    color: var(--color-white);
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

@media(max-width: 475px) {
    
    header nav a:link {
    color: var(--color-white);
    text-decoration: none;
    font-size: calc(var(--font-size-nav) * 0.8 );
}
}
.center-container {
    display: block;
    text-align: center;
    justify-items: center;
}

.empty {
    background-color: var(--color-black);
    min-width: 2rem;
}

.unknown {
    background-color: #a2a2a2;
}

.partial {
    background-color: #ff9800;
}

.completed {
    background-color: #1be605;
}

.failed {
    background-color: #ff1010;
}

.admin-content td svg {
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
}

.button-row {
    display: flex;
    justify-content: space-between;
}

.button-zurück {
    position: sticky;
    bottom: 0;
    left: 0;
}

#flash-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.6rem;
    font-size: var(--font-size-nav);
    color: var(--color-white);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: var(--font-size-aside);
    cursor: pointer;
    margin-left: 1.6rem;
    padding: 0;
    line-height: 1;
}

.flash-fade-out {
    opacity: 0;
    transition: opacity 0.2s;
}

.login {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: var(--content-height);
    background-color: var(--color-white);
}

.login .form-box {
    padding: var(--spacing-md);
    font-size: var(--font-size-form);
    text-align: center;
}

.login form label {
    font-weight: 400;
}

.login form input {
    display: block;
    font-size: var(--font-size-form);
    margin: var(--spacing-sm) auto 0;
    background-color: var(--color-gray-light);
}

.login button {
    background-color: var(--color-black);
    color: var(--color-white);
    height: var(--button-height);
    width: var(--button-width);
}


@media (max-width: 475px) {

    html {
        min-width: 340px
    }

    .login {
        border: none;
        flex-direction: column;
        text-align: center;
    }

    .login .form-box {
        font-size: 1.25rem;
        width: 100%;
        margin: 0;
    }

    .login form input {
        width: 80%;
        max-width: 18rem;
    }

    .login button {
        margin-left: auto;
        margin-right: auto;
    }

}
.home {
    background-color: var(--color-white);
    min-height: calc(100vh - 5rem - 6rem - 4.5rem);
}

.home h1 {
    margin-top: 1rem;
}

.lernthemen {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    row-gap: 5rem;
    column-gap: 5rem;
    padding: 4rem 5rem 0 5rem;
    min-height: auto;
    margin-bottom: 1rem;
}

.lernthemen-box {
    width: 15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
}

.lernthemen-box-link {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
    gap: 1rem;
}

.img-container {
    width: 12rem;
    overflow: hidden;
}

.img-container img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.lernthemen-box-title {
    text-align: center;
    color: var(--color-white);
    font-size: var(--font-size-h2);
    word-break: break-all;
}

@media (max-width: 475px) {
    
    html {
        min-width: 340px
    }

    nav {
        font-size: 1.2rem;
    }

    .lernthemen {
        margin-bottom: 3rem;
    }
}
.lernseite {
    display: grid;
    grid-template-columns: clamp(300px, 2vw, 500px) clamp(3rem, 4vw, 5rem) 1fr;
    min-height: calc(100vh - 6rem - 4.5rem);
}

.lernseite-box {
    display: block;
    min-height: 100%;
    box-sizing: border-box;
    background-color: var(--color-white);
    padding: 2rem 2rem 0.75rem 2rem;
}

.lernseite-content {
    display: block;
}

.lernseite-content > h2 {
    /* text-align: center; */
    font-size: var(--font-size-content-h2);
    /* min-height: var(--content-height); */
}

.lernseite-content p {
    padding: 0;
}

.lernseite-content img {
    max-height: 25vh;
}

#lernseite-inhalt {
    flex:1;
    max-width: 102.3rem;
    min-height: calc(100vh - 171px - 6rem - 4.5rem);
    margin: 0 auto;
    /* padding: 0 4rem; */
    max-width:1000px;
}

#lernseite-inhalt p img {
    margin: 0 auto;
    display: block;
}

#lernseite-editor {
    display: flex;
    justify-content: center;
}

.toastui-editor-contents {
    margin: 0 auto;
}

.toastui-editor-contents p {
    margin: 0 !important;
}

.empty {
    min-height: var(--content-height);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 1.5rem auto;
}

.video-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

.video-container video {
    width: 100%;
    max-height: 500px;
}

.quiz-completed {
    padding: 1rem;
    justify-items: center;
    margin-top: 2rem;
    min-height: calc(100vh - 187px - 6rem - 4.5rem);
}

.lernseite-quiz-lernseite-box > form {
    display: flex;
    flex-direction: column;
    gap:1rem;
}

.quiz-completed .button-row{
    display: block;
    justify-content: center;
    align-content: center;
    gap: 1rem;
}

.quiz-h1-center {
    text-align: center;
}

.quiz-h1-center h1 {
    font-size: var(--font-size-h1);
    font-weight: 300;
}

.button-row {
    margin: 0;
}

.button-row button:disabled {
    cursor: not-allowed;
    background-color: var(--color-gray-dark);
}

.lernseite-quiz {
    background-color: var(--color-white);
    min-height: var(--content-height);
}

.lernseite-quiz-lernseite-box {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.lernseite-quiz-lernseite-box li {
    list-style: none;
    font-size: var(--font-size-nav);
}

.lernseite-quiz-lernseite-box label {
    display: flex;
    align-items: baseline;
    gap:0.5rem;
}



.menu-toggle {
    display: none;
}

.aside-wrapper {
    height: 100%;
    position: sticky;
}

.aside-content {
    position:sticky;
    top: 6rem;
    background-color: var(--color-white);
}

.aside-content a.is-active {
    font-weight: 700;
}

.toastui-editor-contents {
    font-size: 1rem !important;
}


.lernseite-box {
    flex: 1; /* takes remaining space */
    display: flex;
    flex-direction: column;
}

.lernseite-content {
    flex: 1; /* fills vertical space inside */
    display: flex;
    flex-direction: column;
}

@media (max-width: 733px) {

    html {
        min-width: 340px;
        display: block;
        background-color: var(--color-white);
    }

.lernseite {
    display: flex;
    flex-direction: column;
}

    .aside-wrapper {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .menu-toggle {
        color: var(--color-black);
        display: block;
        font-size: var(--font-size-content-h2);
        background: none;
        border: none;
        cursor: pointer;
        position: fixed;
        left: 0;
        top: 6rem;
        z-index: 9999;

    }


    .aside-content {
        position: fixed;
        top: 6rem;
        left: -250px;
        width: 250px;
        height: calc(100% - 9rem);
        background-color: var(--color-white);
        padding: 2em 1em;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
        z-index: 1200;
    }

    .aside-content.active {
        left: 0;
        z-index: 9999;
    }

    .empty {
        display: none;
    }

    .lernseite-box {
        position:relative;
    }
    
    .lernthemen {
        padding: 0;
        margin-top: 3rem;
    }


    .aside-content {
        height: var(--content-height);
    }

    .overlay {
        position: fixed;
        top: 6rem;
        left: 0;
        width: 100%;
        height: calc(100vh - 6rem - 4.5rem);
        background: rgba(0,0,0,0.3);
        display: none;
        z-index: 900;
    }

    .overlay.active {
        display: block;
    }
}
.admin-content {
    background-color: var(--color-white);
    min-height:  calc(100vh - 16px - 6rem - 4.5rem);
    display: block;
    text-align: center;
}

.admin-content a {
    color: var(--color-black);
}

.admin-content p {
    text-align: left;
}

.admin-content ul {
    text-align: left;
}

.admin-content h2 {
    text-align: left;
}

.admin-content .center-container td form button {
    margin-top: 0;
}

.lernseite-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.lernseite-actions form {
    margin: 0;
}

.admin-structure {
    margin-top: 5em;
    border-radius: 20px;
}

.admin-table {
    display: block;
    margin: 0 auto;
    max-width: 800px
}

.admin-table td form button {
    margin: 0;
}

table {
    margin: 0 auto;
    min-width:max-content;
    padding: 1px;
}

table, th, td {
  border: 1px solid black;
  padding: 2px 4px;
}

th {
    background-color: var(--color-black);
    color: var(--color-white);
}

table button {
    padding-block: 0.25rem;
}

input {
    padding-inline: 0.5rem;
    font-size: inherit;
}


#lernseite-editor {
    margin: 3vh 0;
}

.admin-content img {
    max-height: 20vh;
}

#cover-image-form {
    margin: 1rem 0 1rem 0;
}

.edit-frage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap:1rem
}

.edit-fragen input:not([type="checkbox"]):not([type="radio"]) {
    field-sizing: content; /* Lässt das Input mit dem Text mitwachsen */
  min-width: 200px;      /* Deine gewünschte Mindestbreite */
  max-width: 500px; 
}

.edit-antwortoptionen {
    display: block;
    margin: 0 auto;
    width: fit-content;
}

.edit-fragen > .edit-frage-item {
    margin-bottom: 5vh;
    border: 1px solid var(--color-gray-light);
}

.toastui-editor-defaultUI {
    max-width: 98rem;
}

.video-toolbar-icon::before {
    content: '\25B6';
    font-size: var(--font-size-nav);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.video-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.video-popup {
    background: var(--color-white);
    padding: 2rem;
    min-width: 400px;
    position: relative;
}

.video-popup-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.video-popup-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    cursor: pointer;
    background: var(--color-gray-light);
    color: var(--color-black);
    border: none;
    font-size: var(--font-size-nav);
}

.video-popup-tab.active {
    background: var(--color-black);
    color: var(--color-white);
}

.video-popup-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-popup-body input[type="text"] {
    padding: 0.5rem;
    font-size: var(--font-size-nav);
    width: 100%;
    box-sizing: border-box;
}

.video-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: var(--font-size-aside);
    cursor: pointer;
    color: var(--color-black);
    line-height: 1;
    padding: 0.2rem 0.5rem;
}


.admin-content p {
    margin: 4rem 2rem;
    color: var(--color-black);
}

 .cover-img-container p{

    text-align: center;
}

.delete-lernthema {
    margin-top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-content-quiz-details {
    background-color: var(--color-white);
    min-height: calc(100vh - 16px - 6rem - 4.5rem);
}

.admin-content > h1, .admin-content-quiz-details > h1 {
    font-weight: 300;
    margin-top: 1rem;
}

.quiz-details {
    margin: 0 auto;
}

.admin-content-quiz-details p {
    font-size: var(--font-size-nav);
}

.admin-content-quiz-details h2 {
    margin-top: 2rem;
    font-size: 1.25rem;
}

.admin-content-quiz-details p {
    font-size: 1.25rem;
}

.quiz-details-container {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.failed ul, .completed ul {
    list-style: none;
}

.admin-content-quiz-details .completed {
    background-color: transparent;
    color: green;
}

.admin-content-quiz-details .partial {
    background-color: transparent;
    color: #ff9800;
}

.admin-buttons-container form {
    display: inline;
}

.admin-content-quiz-details .failed {
    background-color: transparent;
    color: red;
}

.admin-content-quiz-details > h1 {
    max-height: var(--font-size-aside);
    text-align: var(--object-position);
    font-weight: 300;
}

.admin-content-quiz-details a {
    color: var(--color-black);
}

.lernthema-overview-progress {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
}

.lernthema-quiz-detail-section {
    border-top: 1px solid var(--color-gray-light);
    margin-top: 2.5rem;
    padding-top: 2rem;
}

.lernthema-quiz-detail-section > h2 {
    margin-top: 0;
}

.quiz-edit {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.quiz-edit h2 {
    margin: 0 auto;
}

.zurück-zur-auswertung p {
    font-size: 1rem;
    margin: 4rem 2rem;
}



@media (max-width: 733px) {

    html {
        min-width: 340px;
        display: block;
        background-color: var(--color-white);
    }

    .toastui-editor-defaultUI {
    width: 100%;
    }
}
.error-page {
    background-color: var(--color-white);
    min-height: var(--content-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-page h2 {
    font-size: var(--font-size-h1);
    font-weight: 300;
    margin: 0;
    color: var(--color-black);
}

.error-page p {
    font-size: var(--font-size-form);
    color: var(--color-black);
}

.error-page .error-action {
    font-size: var(--font-size-nav);
}
