:root {
    --bg: #f4f6f9;

    --border: #d8dee6;
    --card: #ffffff;
    --danger: #b32d41;
    --match: #70ae6b;

    --muted: #6b7280;
    --primary: #3d5eb1;
    --text: #1f2937;

    --header-background: #ffffffe6;
    --danger-border: #fecaca;
    --popup-box-shadow: #00000047;
    color-scheme: light;
    --danger-dark: #a31d31;
    --match-dark: #407e4b;
    --primary-dark: #0d2e81;
    --help-image-background: #ffffff88;

    --important-info: #d4576c;
    --info: #fdfbad;
    --success-info: #70ae6b;
    --normal-info: #91a7e1;
    --popup-overlay-background: #00000073;
    --img-placeholder-background: #2563eb0a;
    --box-shadow: #00000012;
    --primary-shadow: #2563eb26;

    --match-strength: 0%;
    --score-percent: 0%;
}

html.dark {
    --bg: #0f121b;

    --border: #334155;
    --card: #1e293b;
    --danger: #f87171;
    --match: #67a363;

    --muted: #94a3b8;
    --primary: #6192d6;
    --text: #e5e7eb;

    --header-background: #0f172ae6;
    --danger-border: #7f1d1d;
    --popup-box-shadow: #00000099;
    color-scheme: dark;
    --danger-dark: #ef4444;
    --match-dark: #277343;
    --primary-dark: #3162a6;
    --help-image-background: #1e293b88;

    --important-info: #802232;
    --info: #7d7925;
    --success-info: #67a363;
    --normal-info: #586f8f;
    --popup-overlay-background: #00000099;
    --img-placeholder-background: #60a5fa14;
    --box-shadow: #00000066;
    --primary-shadow: #60a5fa33;
}


html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    display: flex;

    flex-direction: column;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    margin: 40px auto;
    max-width: 990px;
    min-height: 100vh;
    padding: 0 20px;
}

h1 {
    font-size: 32px;
    margin: 0 0 24px;
}

button,
.login-button,
.collection-button,
.question-button,
.study-question {
    transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
    font-weight: 600;
    text-decoration: none;
}

button, .login-button {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: var(--card);
    cursor: pointer;
    font-size: 15px;
    padding: 10px 18px;
}

button:hover, .login-button:hover {
    background: var(--primary-dark);
}

textarea,
input {
    border: 2px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    outline: none;
    padding: 12px;
    width: 100%;
}

textarea:focus,
input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-shadow);
}

.card {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 4px 18px var(--box-shadow);
    margin-bottom: 26px;
    padding: 26px;
}

.important-info {
    background: var(--important-info);
    border-radius: 14px;
    box-shadow: 0 4px 18px var(--box-shadow);
    margin-bottom: 26px;
    padding: 26px;
}

.info {
    background: var(--info);
    border-radius: 14px;
    box-shadow: 0 4px 18px var(--box-shadow);
    margin-bottom: 26px;
    padding: 26px;
}

.success-info {
    background: var(--success-info);
    border-radius: 14px;
    box-shadow: 0 4px 18px var(--box-shadow);
    margin-bottom: 26px;
    padding: 26px;
}

.normal-info {
    background: var(--normal-info);
    border-radius: 14px;
    box-shadow: 0 4px 18px var(--box-shadow);
    margin-bottom: 26px;
    padding: 26px;
}

.container, .study-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Home collections */

.collection-row {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto auto auto;
}

.collection-button {
    align-items: center;
    background: var(--card);
    border: 2px solid var(--border);

    border-radius: 12px;
    color: var(--text);
    display: flex;
    font-size: 18px;
    font-weight: 600;
    justify-content: space-between;
    padding: 18px 22px;
    text-decoration: none;
}

.question-count {
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    transition: .2s;
}

.answer-count {
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    white-space: nowrap;
}


.collection-button:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 8px 20px var(--box-shadow);
    color: var(--card);
    transform: translateY(-2px);
}

.delete-button, .image-delete-button {
    background: var(--card);
    border: 2px solid var(--danger-border);
    color: var(--danger);
    font-weight: 600;
    height: 100%;
}

.delete-button:hover, .image-delete-button:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--card);
}

.image-delete-button {
    position: absolute;
    right: 16px;
    bottom: 16px;

    width: 36px;
    height: 36px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--card);
    border: 2px solid var(--danger-border);

    color: var(--danger);
    font-size: 18px;
    font-weight: 700;

    cursor: pointer;
}

.export-button {
    background: var(--card);
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    height: 100%;
}

.export-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--card);
}

#export-type {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    margin-top: 0.4rem;
    margin-bottom: 1rem;
}

#export-type:focus {
    outline: none;
    border-color: var(--primary);
}

.export-description {
    margin-top: 1rem;
    margin-bottom: 1.5rem;

    padding: 1rem;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: color-mix(in srgb, var(--primary) 6%, var(--card));

    color: var(--text);

    font-size: 0.95rem;
    line-height: 1.5;
}

#export-type {
    width: 100%;

    margin-top: .5rem;
    margin-bottom: .5rem;

    padding: .75rem 1rem;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--card);
    color: var(--text);

    font-size: 1rem;
}

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

/* Questions */

.question-block {
    margin-bottom: 2px;
}

.study-explanation {
    display: none;
}

.question-button {
    align-items: center;
    background: var(--card);
    background: color-mix(
            in srgb,
            var(--card),
            var(--match) var(--match-strength)
    );
    border: 2px solid var(--border);
    border-radius: 12px 12px 0 0;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 18px 22px;
    text-align: left;
    width: 100%;
}

.study-question {
    align-items: center;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px 12px 0 0;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 18px 22px;
    text-align: left;
}

.question-button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--card);
}

.question-button,
.study-question {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.question-meta {
    align-items: center;
    display: flex;
    gap: 12px;
}

.chevron {
    color: var(--muted);
    font-size: 18px;
    transform: rotate(0deg);
    transition: transform .25s ease, color .2s ease;
    user-select: none;
}

.question-button:hover .chevron {
    color: var(--card);
}

.question-button.open .chevron {
    transform: rotate(90deg);
}

.answers {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 0 0 12px 12px;
    border-top: none;
    display: none;
    margin: 0;
    padding: 18px 22px;
}

.study-answers {
    display: block !important;
}

.answer {
    align-items: center;
    border-bottom: 1px solid #ececec;
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.study-answer {
    gpadding: 8px 0;
}

.answer:last-child {
    border-bottom: none;
}

.answer-text {
    flex: 1;
}

.vote-form {
    margin-left: auto;
}

.vote-button {
    border-radius: 50%;
    font-weight: bold;
    height: 36px;
    padding: 0;
    width: 36px;
}

.vote-button.submitted {
    background: var(--match);
    box-shadow: 0 0 0 3px var(--primary-shadow);
}

.vote-info {
    color: var(--muted);
    font-size: 14px;
    min-width: 85px;
    text-align: right;
}

.answer-form {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.answer-form input {
    flex: 1;
}

.answer-form button {
    white-space: nowrap;
}

/* Popup */

.popup-overlay {
    align-items: center;
    background: var(--popup-overlay-background);
    display: none;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 1000;
}

.popup-box {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 14px 40px var(--popup-box-shadow);
    max-width: 460px;
    padding: 28px;
    width: 100%;
}

.error-page {
    margin: 80px auto;
    max-width: 560px;
    text-align: center;
}

.error-code {
    color: var(--primary);
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 16px;
}

.error-page h1 {
    margin-bottom: 12px;
}

.error-page p {
    color: var(--muted);
    margin-bottom: 28px;
}

.home-button, .help-button {
    background: var(--primary);
    border-radius: 10px;
    color: var(--card);
    display: inline-block;
    font-weight: 600;
    padding: 12px 20px;
    text-decoration: none;
}

.home-button:hover, .help-button:hover {
    background: var(--primary-dark);
}

.help-image {
    background: var(--help-image-background);
    border: 2px solid var(--border);
    border-radius: 12px;
    border-radius: 12px;
    box-sizing: border-box;
    color: var(--muted);


    display: block;
    font-weight: 600;
    margin: 18px 0;
    margin: 18px 0;
    max-width: 100%;
    text-align: center;
    width: 100%;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 30px 0;
}

@media (max-width: 650px) {
    body {
        margin: 20px auto;
    }

    .collection-row,
    .answer-form {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .delete-button {
        height: auto;
    }

    .answer {
        flex-wrap: wrap;
    }

    .vote-info {
        min-width: auto;
    }
}

.image-placeholder {
    background: var(--img-placeholder-background);
    border: 2px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-weight: 600;
    margin: 18px 0;
    padding: 40px 20px;
    text-align: center;
}

/* Header */

.site-header {
    backdrop-filter: blur(12px);
    background: var(--header-background);
    border-bottom: 1px solid var(--border);

    box-shadow: 0 2px 12px var(--box-shadow);
    margin: -40px -20px 30px;

    padding: 0 15px;
    position: sticky;

    top: 0;
    z-index: 1000;
}

.header-content {
    align-items: center;
    display: flex;

    height: 75px;

    justify-content: space-between;
    margin: auto;
    max-width: 990px;
}

.nav-links, .nav-dropdown-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px;
}

.nav-dropdown-links {
    display: grid;
}

.nav-links a, .nav-dropdown-links a {
    border-radius: 10px;
    color: var(--text);

    font-weight: 500;

    padding: 10px 14px;
    text-decoration: none;

    transition: background .2s,
    color .2s;
}

.nav-links a:hover, .nav-dropdown-links a:hover {
    background: var(--primary);
    color: var(--card);
}

@media (max-width: 700px) {

    .site-header {
        margin: -20px -20px 25px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        height: auto;
        padding: 15px 0;
    }

    .nav-links, .nav-dropdown-links {
        justify-content: center;
    }
}

#theme-toggle {
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    font-size: 22px;
    padding: 8px;
    transition: background .2s, transform .3s;
}

#theme-toggle:hover {
    background: var(--img-placeholder-background);
}

html.dark #theme-toggle {
    transform: rotate(180deg);
}

/* Footer */

.site-footer {
    align-self: end;
    background: var(--card);

    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px var(--box-shadow);
    margin: 60px -20px -40px;

    padding: 30px 20px;
}

.footer-content {
    align-items: center;
    display: flex;

    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    margin: auto;

    max-width: 990px;
}

.footer-content p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    border-radius: 8px;
    color: var(--muted);

    padding: 6px 10px;
    text-decoration: none;

    transition: background .2s,
    color .2s;
}

.footer-links a:hover {
    background: var(--primary);
    color: var(--card);
}

@media (max-width: 700px) {

    .site-footer {
        margin: 40px -20px -20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

.page-content {
    flex: 1;
}

.auth-box {
    align-items: center;
    gap: 10px;
}

#session-timer {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.small-edit-button {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.small-edit-button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.uploaded-image {
    display: block;
    min-width: 150px;
    min-height: 150px;
    max-width: 100%;
    max-height: 450px;
    margin: 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.question-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0;
}

.question-actions form {
    margin: 0;
}

.upload-image-button, .submit {
    background: var(--match);
}

.upload-image-button:hover, .submit:hover {
    background: var(--match-dark);
}

.cookie-info {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px var(--box-shadow);
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.cookie-info p {
    margin: 0;
}


/*
COOKIES
*/
.cookie-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--popup-overlay-background);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 20px 60px var(--popup-overlay-background);
}

.cookie-modal h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.cookie-modal p {
    color: var(--muted);
    line-height: 1.6;
}

.cookie-note {
    font-size: 0.95rem;
}

.cookie-options {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.cookie-option {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.cookie-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0.15rem 0 0 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.cookie-option label {
    display: block;
    cursor: pointer;
    line-height: 1.5;
}

.cookie-option strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.cookie-option small {
    display: block;
    color: var(--muted);
    margin-top: 0.3rem;
    line-height: 1.4;
}

.cookie-option.disabled {
    opacity: 0.85;
}

.cookie-actions {
    display: grid;
    gap: 0.75rem;
}

.cookie-actions .button {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
}

/* Alles akzeptieren */
.cookie-actions .button.accept {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.cookie-actions .button.accept:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Alles ablehnen */
.cookie-actions .button.reject {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}

.cookie-actions .button.reject:hover {
    background: #15803d;
    border-color: #15803d;
}

/* Auswahl speichern */
.cookie-actions .ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.cookie-links {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.cookie-links a {
    color: var(--muted);
    text-decoration: underline;
}

.cookie-links a:hover {
    color: var(--text);
}

@media (max-width: 600px) {
    .cookie-modal {
        padding: 1.25rem;
        border-radius: 14px;
    }

    .cookie-option {
        grid-template-columns: 22px 1fr;
        gap: 0.75rem;
    }

    .cookie-option input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
}

/*
COOKIES
*/


.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.5px;
}

.logo:hover {
    color: var(--primary-dark);
}

.logo-img {
    width: 38px;
    height: 38px;
    display: block;
}

.logo-dark {
    display: none;
}

/* Darkmode */
html.dark .logo-light {
    display: none;
}

html.dark .logo-dark {
    display: block;
}

/* =========================
   MOBILE RESPONSIVE PATCH
   does not affect desktop
   ========================= */

@media (max-width: 700px) {
    body {
        max-width: none;
        width: 100%;
        box-sizing: border-box;
        padding: 0 14px;
        overflow-x: hidden;
    }

    h1 {
        font-size: 26px;
        line-height: 1.2;
    }

    .card,
    .important-info {
        padding: 20px;
        border-radius: 12px;
    }

    .site-header {
        padding: 0 14px;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        height: auto;
        padding: 14px 0;
    }

    .logo {
        justify-content: center;
        font-size: 22px;
        max-width: 100%;
    }

    .logo span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logo-img {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    .nav-links, .nav-dropdown-links {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .nav-links a, .nav-dropdown-links a {
        flex: 1 1 auto;
        text-align: center;
        font-size: 14px;
        padding: 9px 10px;
    }

    .auth-box {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .login-button,
    #theme-toggle {
        align-self: center;
    }

    .collection-button,
    .question-button,
    .study-question {
        font-size: 16px;
        padding: 15px 16px;
        gap: 10px;
    }

    .question-button,
    .study-question {
        align-items: flex-start;
    }

    .question-meta {
        flex-shrink: 0;
    }

    .answers {
        padding: 16px;
    }

    .answer {
        align-items: flex-start;
    }

    .answer-text {
        min-width: 0;
        word-break: break-word;
    }

    .answer-form {
        flex-direction: column;
    }

    .answer-form button {
        width: 100%;
    }

    .question-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .question-actions form,
    .question-actions button {
        width: 100%;
    }

    .popup-box {
        width: calc(100% - 28px);
        max-width: none;
        padding: 22px;
        box-sizing: border-box;
    }

    .uploaded-image {
        max-height: 320px;
    }

    .cookie-info {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cookie-info button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    body {
        padding: 0 10px;
    }

    h1 {
        font-size: 23px;
    }

    .card,
    .important-info {
        padding: 16px;
    }

    .logo {
        font-size: 19px;
        gap: 0.45rem;
    }

    .logo-img {
        width: 30px;
        height: 30px;
    }

    .nav-links, .nav-dropdown-links {
        gap: 6px;
    }

    .nav-links a, .nav-dropdown-links a {
        font-size: 13px;
        padding: 8px;
    }

    button,
    .login-button {
        font-size: 14px;
        padding: 9px 14px;
    }

    .collection-button,
    .question-button,
    .study-question {
        font-size: 15px;
        padding: 13px 14px;
    }

    .answer {
        gap: 8px;
    }

    .vote-button {
        width: 34px;
        height: 34px;
    }

    .vote-info {
        font-size: 13px;
        text-align: left;
    }

    .footer-content {
        gap: 12px;
    }

    .footer-links {
        gap: 6px;
    }

    .footer-links a {
        font-size: 13px;
        padding: 6px 8px;
    }
}

.links {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--muted);
    font-size: 1.0rem;
}

.links a {
    color: var(--muted);
    text-decoration: underline;
}

.links a:hover {
    color: var(--text);
}

.study-answer-option {
    display: grid;
    grid-template-columns: auto 1fr;
    width: 100%;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.study-answer-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0.15rem 0 0 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.study-answer-option label {
    display: block;
    cursor: pointer;
    line-height: 1.5;
}

.study-answer-option.disabled {
    opacity: 0.85;
    cursor: default;
}

.study-answer-option.disabled input {
    opacity: 1;
    accent-color: inherit;
}

.study-answer.study-correct {
    border-color: var(--match);
}

.study-answer.study-wrong {
    border-color: var(--danger);
}

.study-answer-option input[data-wrong="true"] {
    accent-color: var(--danger);
    content: "✕";
}

.study-answer-option input[data-wrong="false"] {
    accent-color: var(--match);
}

.study-answer-option.study-wrong {
    background: color-mix(in srgb, var(--danger) 18%, var(--card));
    border-color: var(--danger);
}

.study-answer-option.study-correct {
    background: color-mix(in srgb, var(--match) 25%, var(--card));
    border-color: var(--match);
}

.study-statistic {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
    font-size: 0.9rem;
}

.study-stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.study-stat-row[data-is-correct="true"] {
    color: var(--match);
    font-weight: 700;
}

.study-total-votes,
.study-no-vote-info {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.study-answer-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.study-answer-navigation > :first-child {
    justify-self: start;
}

.study-answer-navigation > :nth-child(2) {
    justify-self: center;
}

.study-answer-navigation > :last-child {
    justify-self: end;
}

button:disabled,
button.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

.study-solution-button, .study-evaluation-button {
    background: var(--match);
}

.study-solution-button:hover, .study-evaluation-button:hover {
    background: var(--match-dark);
}

.study-stat-answer {
    min-width: 0;
}

.study-stat-bar {
    height: 6px;
    margin-top: 4px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.study-stat-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
}

.study-stat-row[data-is-correct="true"] .study-stat-bar-fill {
    background: var(--match);
}

.study-evaluation-table {
    width: 100%;
    border-collapse: collapse;
}

.study-evaluation-table th,
.study-evaluation-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.study-evaluation-table th:last-child,
.study-evaluation-table td:last-child {
    text-align: right;
}

.study-evaluation-table-wrapper {
    overflow-x: auto;
}

.study-result-bar {
    display: flex;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
    margin: 1rem 0 0.75rem;
}

.study-result-segment.study-result-bar {
    height: 100%;
    min-width: 0;
}

.study-result-segment.correct {
    background: var(--match);
}

.study-result-segment.partial {
    background: var(--primary);
}

.study-result-segment.wrong {
    background: var(--danger);
}

.study-result-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.study-evaluation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.4rem;
}

.study-evaluation-table th {
    text-align: left;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.study-evaluation-table td {
    padding: 0.75rem;
    background: color-mix(
            in srgb,
            var(--danger) calc(100% - var(--score-percent)),
            var(--match) var(--score-percent)
    );
}

.study-evaluation-table td:first-child {
    border-radius: 10px 0 0 10px;
}

.study-evaluation-table td:last-child {
    border-radius: 0 10px 10px 0;
    text-align: right;
}

.study-evaluation-row.correct td {
    background: color-mix(in srgb, var(--match) 50%, var(--card));
}

.study-evaluation-row.wrong td {
    background: color-mix(in srgb, var(--danger) 50%, var(--card));
}

.study-result-segment.percent-correct {
    background: var(--match);
}

.study-result-segment.percent-wrong {
    background: var(--danger);
}


.profile-message {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-radius: 0.5rem;
}

.profile-message-success {
    color: var(--match);
    background: var(--card);
    border-color: var(--match-dark);
}

.profile-message-error {
    color: var(--danger);
    background: var(--card);
    border-color: var(--danger-border);
}

.field-error {
    margin: 0.4rem 0 0;
    color: var(--danger);
    font-size: 0.9rem;
}

.field-success {
    margin: 0.4rem 0 0;
    color: var(--match);
    font-size: 0.9rem;
}

.input-error {
    border-color: var(--danger-border);
    outline-color: var(--danger);
}

.input-success {
    border-color: var(--match-dark);
    outline-color: var(--match);
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.profile-edit-section[hidden] {
    display: none;
}

.profile-message {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-radius: 0.5rem;
}

.profile-message[hidden] {
    display: none;
}

.profile-popup[hidden] {
    display: none;
}

.profile-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--popup-overlay-background);
}

.profile-popup .popup-box {
    position: relative;
    width: min(100%, 520px);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.popup-close-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.popup-open {
    overflow: hidden;
}

.password-input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.password-input-wrapper input {
    flex: 1;
    min-width: 0;
}

.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 3rem;
}

.password-toggle-button {
    flex: 0 0 auto;
    white-space: nowrap;
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 2rem;
    height: 2rem;
    padding: 0;

    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
}

.password-toggle-button:hover {
    background: var(--box-shadow);
    color: var(--muted);
}

.password-toggle-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.nav-dropdown {
    align-items: center;
    display: inline-flex;
    position: relative;
}

.nav-dropdown-toggle {
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 40px;
    justify-content: center;
    padding: 8px;
    width: 40px;
}

.nav-dropdown-toggle:hover {
    background: var(--primary);
    color: var(--card);
}

.nav-dropdown-toggle span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 21px;
}

.nav-dropdown-menu {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 28px var(--popup-box-shadow);
    min-width: 220px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 2000;
}

.nav-dropdown-menu[hidden] {
    display: none;
}

.nav-dropdown-menu a {
    padding: 10px 12px;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
    background: var(--primary);
    color: var(--card);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.study-overview {
    position: sticky;
    top: 0;
    z-index: 20;

    margin-bottom: 1rem;
    padding: 0.75rem;

    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
}

.study-overview-scroll, .help-tag-scroll {
    display: flex;
    gap: 0.45rem;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 0.15rem 0.15rem 0.45rem;

    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.study-overview-button {
    flex: 0 0 auto;

    min-width: 2.25rem;
    height: 2.25rem;

    white-space: nowrap;

    padding: 0 0.5rem;
    margin: 3px;

    color: var(--text);
    background: var(--card);

    border: 2px solid var(--border);
    border-radius: 8px;

    font-weight: 700;
    cursor: pointer;

    transition: transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.study-overview-button:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.study-overview-button.active {
    outline: 3px solid color-mix(
            in srgb,
            var(--primary) 35%,
            transparent
    );

    outline-offset: 2px;
}

.study-overview-button.answered {
    color: var(--primary);
    background: color-mix(
            in srgb,
            var(--primary) 12%,
            var(--card)
    );
    border-color: var(--primary);
}

.study-overview-button.correct {
    color: var(--text);
    background: color-mix(
            in srgb,
            var(--match) 45%,
            var(--card)
    );
    border-color: var(--match);
}

.study-overview-button.partial {
    color: var(--text);
    background: color-mix(
            in srgb,
            var(--primary) 35%,
            var(--card)
    );
    border-color: var(--primary);
}

.study-overview-button.wrong {
    color: var(--text);
    background: color-mix(
            in srgb,
            var(--danger) 35%,
            var(--card)
    );
    border-color: var(--danger);
}

@media (max-width: 600px) {
    .study-overview {
        padding: 0.6rem;
        border-radius: 10px;
    }

    .study-overview-button {
        min-width: 2rem;
        height: 2rem;

        padding: 0 0.4rem;
        font-size: 0.85rem;
    }
}

.uploaded-image-wrapper {
    min-width: 150px;
    min-height: 150px;

    position: relative;
    display: inline-block;
}

.image-viewer {
    position: fixed;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    background: var(--popup-overlay-background);

    z-index: 5000;

    cursor: zoom-out;
    overflow: hidden;
}

.image-viewer.open {
    display: flex;
}

.image-viewer img {
    max-width: 90vw;
    max-height: 90vh;

    object-fit: contain;

    cursor: zoom-in;

    transform: scale(1);
    transition: transform .15s ease;
}

#image-viewer-img {
    max-width: 90vw;
    max-height: 90vh;

    cursor: grab;

    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
    touch-action: none;

    /* WICHTIG: keine Animation beim Ziehen */
    transition: none;
}

.image-download-button {
    position: absolute;
    top: 16px;
    right: 16px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 8px;

    color: var(--muted);

    font-size: 18px;
    font-weight: 800;

    text-decoration: none;

    cursor: pointer;
}

.image-download-button:hover {
    background: var(--muted);
    border-color: var(--muted);
    color: var(--card);
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--card);
}

.settings-title {
    font-weight: 600;
}

.settings-description {
    margin-top: 2px;

    font-size: .9rem;
    color: var(--text);
}

.settings-row input[type="checkbox"] {
    width: 18px;
    height: 18px;

    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #ccc;
    border-radius: 24px;
    transition: 0.2s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

.form-grid {
    display:block;
    grid-template-columns:1fr 1fr;
    gap:15px;
}


.form-grid .full {
    grid-column:1 / -1;
}

.announcement-card {
    margin-bottom:20px;
}

.announcement-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.status {
    padding:5px 12px;
    border-radius:20px;
    font-size:.85rem;
}

.status.active {
    background: var(--card);
    color: var(--match);
}

.status.inactive {
    background: var(--card);
    color: var(--important-info);
}

.announcement-meta {
    opacity:.7;
    margin-top:10px;
}

.button-row {
    display:flex;
    gap:10px;
    margin-top:15px;
}
.help-tag-button input {
    display: none;
}

.help-tag-button span {

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 14px;

    border-radius: 20px;

    background: var(--card);

    min-width: 2.25rem;
    height: 2.25rem;

    white-space: nowrap;

    color: var(--text);
    background: var(--card);

    border: 2px solid var(--border);

    font-weight: 700;

    transition: transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.help-tag-button:hover span {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.help-tag-button input:checked + span {
    background: var(--primary);
    color: var(--card);
}

html,
body,
.card,
.page-content,
.auth-box,
#session-timer,
button,
.login-button,
input,
textarea,
.question-button,
.study-question,
.study-answers,
.answers,
.delete-button,
.image-delete-button,
.popup-box,
.site-header,
.collection-button,
.answer-count,
.help-button,
.error-home-button,
.upload-image-button,
.uploaded-image,
.nav-dropdown-menu,
.nav-dropdown-toggle,
.nav-dropdown,
.nav-dropdown-links,
.nav-links,
.links,
.important-info,
.info,
.normal-info,
.success-info,
.study-solution-button,
.study-evaluation-button,
.study-result-legend,
.study-result-segment,
.study-evaluation-table-wrapper,
.study-evaluation-table,
.study-stat-row,
.study-stat-bar-fill,
.study-stat-bar,
.study-stat-answer,
.study-overview-button,
.study-overview-scroll,
.help-tag-scroll,
.help-tag-button,
.study-overview,
.site-footer,
.footer-content,
.footer-links,
.profile-message,
.profile-message-success,
.profile-message-error,
.field-error,
.field-success,
.input-error,
.input-success,
.image-download-button,
.image-viewer,
.settings-group,
.settings-row,
.settings-title,
.settings-description,
.switch,
.password-toggle-button {
    transition: background-color .25s ease,
    color .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}