: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;
    --popup-overlay-background: #00000073;
    --img-placeholder-background: #2563eb0a;
    --box-shadow: #00000012;
    --primary-shadow: #2563eb26;

    --match-strength: 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;
    --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 {
    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;
}

.container {
    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 {
    background: var(--card);
    border: 2px solid var(--danger-border);
    color: var(--danger);
    font-weight: 600;
    height: 100%;
}

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

.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);
}

/* Questions */

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

.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%;
}

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

.question-button {
    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;
}

.answer {
    align-items: center;
    border-bottom: 1px solid #ececec;
    display: flex;
    gap: 12px;
    padding: 12px 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 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-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 {
    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 {
        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;
    max-width: 100%;
    max-height: 450px;
    margin: 12px 0;
    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 {
    background: var(--match);
}
.upload-image-button: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: rgba(0, 0, 0, 0.45);
   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 rgba(0, 0, 0, 0.3);
}

.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 {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .nav-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 {
        font-size: 16px;
        padding: 15px 16px;
        gap: 10px;
    }

    .question-button {
        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 {
        gap: 6px;
    }

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

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

    .collection-button,
    .question-button {
        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);
}

html,
body,
.card,
.page-content,
.auth-box,
#session-timer,
button,
.login-button,
input,
textarea,
.question-button,
.answers,
.popup-box,
.site-header,
.collection-button,
.answer-count,
.help-button,
.error-home-button,
.upload-image-button,
.uploaded-image,
.links,
.important-info,
.info {
    transition: background-color .25s ease,
    color .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}