﻿:root {
    color-scheme: light;
    --bg-start: #eef7f1;
    --bg-end: #f7fbff;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #10b981;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --border: #d8e0ee;
    --shadow: 0 24px 70px rgba(23, 32, 51, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-content: start center;
    gap: 18px;
    padding: 72px 20px;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.28), transparent 34%),
        linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, black, transparent 70%);
}

h1,
#todoField,
body > button,
#todoList {
    width: min(100%, 520px);
}

h1 {
    margin: 0 0 6px;
    font-size: clamp(2rem, 7vw, 3.5rem);
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

h1::after {
    content: "Organisiert. Klar. Erledigt.";
    display: block;
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    color: var(--muted);
}

#todoField {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

#todoField:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), 0 14px 36px rgba(23, 32, 51, 0.1);
    transform: translateY(-1px);
}

#todoField::placeholder {
    color: #8b95a7;
}

button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    color: white;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background-color 160ms ease;
}

body > button {
    min-height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

button:hover {
    transform: translateY(-2px);
    filter: saturate(1.08);
}

body > button:hover {
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.32);
}

button:active {
    transform: translateY(0);
}

#todoList {
    margin: 12px 0 0;
    padding: 14px;
    list-style: none;
    border: 1px solid rgba(216, 224, 238, 0.75);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

#todoList:not(:has(li)) {
    display: none;
}

#todoList li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.07);
    overflow-wrap: anywhere;
}

#todoList li + li {
    margin-top: 10px;
}

#todoList input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
    cursor: pointer;
}

.todo-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.delete-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    color: white;
    background: var(--danger);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2);
}

.delete-btn:hover {
    background: var(--danger-dark);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.26);
}

#todoList li:has(input[type="checkbox"]:checked) {
    color: var(--muted);
    background: #f5f8fb;
}

#todoList li:has(input[type="checkbox"]:checked) .todo-text {
    text-decoration: line-through;
}

.version-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 8px 12px;
    border: 1px solid rgba(216, 224, 238, 0.75);
    border-radius: 8px;
    color: white;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.12);
    backdrop-filter: blur(18px);
    background: linear-gradient(135deg, var(--accent), var(--primary));
}

.version {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
}

.changelog {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30;
}

.changelog button {
    min-height: 44px;
    padding: 0 18px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.changelog-content {
    position: fixed;
    top: 86px;
    right: 20px;
    z-index: 40;
    width: min(640px, calc(100vw - 40px));
    max-height: calc(100dvh - 118px);
    padding: 0;
    overflow-y: auto;
    border: 1px solid rgba(216, 224, 238, 0.95);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 260ms ease, opacity 180ms ease, visibility 180ms ease;
    scrollbar-color: rgba(37, 99, 235, 0.34) transparent;
    scrollbar-width: thin;
}

.changelog-content.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.changelog-content::-webkit-scrollbar {
    width: 10px;
}

.changelog-content::-webkit-scrollbar-track {
    background: transparent;
}

.changelog-content::-webkit-scrollbar-thumb {
    border: 3px solid rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.34);
}

.changelog-content h2 {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(216, 224, 238, 0.92);
    font-size: 1.5rem;
    line-height: 1.2;
    background:
        linear-gradient(135deg, rgba(238, 247, 241, 0.98), rgba(247, 251, 255, 0.98)),
        rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}

.changelog-content h3 {
    position: sticky;
    top: 63px;
    z-index: 2;
    margin: 0;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(216, 224, 238, 0.78);
    font-size: 0.82rem;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.changelog-content ul {
    margin: 0;
    padding: 16px 24px 22px;
    list-style: none;
    display: grid;
    gap: 12px;
}

.changelog-content li {
    position: relative;
    padding: 16px 16px 16px 48px;
    border: 1px solid rgba(216, 224, 238, 0.86);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.06);
    line-height: 1.5;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.changelog-content li::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 18px;
    width: 12px;
    height: 12px;
    border: 3px solid rgba(255, 255, 255, 0.98);
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.changelog-content h3:nth-of-type(2) + ul li {
    border-left-color: var(--accent);
}

.changelog-content h3:nth-of-type(2) + ul li::before {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.changelog-content strong {
    color: var(--primary-dark);
}

.changelog-content li strong:first-child {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(37, 99, 235, 0.1);
    font-size: 0.86rem;
    line-height: 1.2;
}

.changelog-content h3:nth-of-type(2) + ul li strong:first-child {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}

.changelog-content > button {
    position: sticky;
    bottom: 16px;
    left: 24px;
    min-height: 46px;
    width: calc(100% - 48px);
    margin: 0 24px 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 14px 28px rgba(16, 185, 129, 0.2);
}

@media (max-width: 560px) {
    body {
        padding: 72px 16px 24px;
        place-content: start stretch;
    }

    h1,
    #todoField,
    body > button,
    #todoList {
        width: 100%;
    }

    #todoList li {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .delete-btn {
        margin-left: 34px;
    }

    .changelog {
        top: 14px;
        right: 14px;
    }

    .changelog button {
        min-height: 42px;
        padding: 0 14px;
    }

    .changelog-content {
        inset: 0;
        width: auto;
        max-height: none;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        transform: translateX(100%);
    }

    .changelog-content h2 {
        padding: 70px 18px 16px;
    }

    .changelog-content h3 {
        top: 130px;
        padding: 11px 18px;
    }

    .changelog-content ul {
        padding: 14px 18px 18px;
        gap: 10px;
    }

    .changelog-content li {
        padding: 15px 14px 15px 42px;
        font-size: 0.95rem;
    }

    .changelog-content li::before {
        left: 15px;
    }

    .changelog-content > button {
        bottom: 14px;
        left: 18px;
        width: calc(100% - 36px);
        margin: 2px 18px 18px;
    }

}

#completedList {
    width: min(100%, 520px);
    margin: 12px 0 0;
    padding: 14px;
    list-style: none;
    border: 1px solid rgba(216, 224, 238, 0.75);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

#completedList:not(:has(li)) {
    display: none;
}

#completedList li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--muted);
    background: #f5f8fb;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.07);
    overflow-wrap: anywhere;
}

#completedList li + li {
    margin-top: 10px;
}

#completedList input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
    cursor: pointer;
}

#completedList .todo-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    text-decoration: line-through;
}

@media (max-width: 560px) {
    #completedList {
        width: 100%;
    }

    #completedList li {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

/* Kategorie-Ueberschriften */
body > h2 {
    position: relative;
    width: min(100%, 520px);
    margin: 18px 0 0;
    padding: 14px 18px 14px 46px;
    border: 1px solid rgba(216, 224, 238, 0.78);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
    backdrop-filter: blur(18px);
    font-size: 1.08rem;
    line-height: 1.25;
    font-weight: 700;
}

body > h2::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 18px;
    width: 12px;
    height: 12px;
    border: 3px solid rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    transform: translateY(-50%);
}

body > h2:nth-of-type(2) {
    border-left-color: var(--accent);
    color: var(--muted);
}

body > h2:nth-of-type(2)::before {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

@media (max-width: 560px) {
    body > h2 {
        width: 100%;
    }
}
