:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: #1e293b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.app-shell {
    width: min(100%, 540px);
    background: #ccccdf;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

header {
    padding: 32px 28px 18px;
    background: linear-gradient(135deg, #e7e4eb 0%, #38bdf8 100%);
    color: #3a3535;
}

header h1 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 2.4vw, 2.5rem);
}

header p {
    margin: 0;
    opacity: 0.88;
}

.todo-panel {
    padding: 24px 28px 28px;
}

#todo-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#todo-input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #8ea3c3;
    border-radius: 12px;
    font-size: 1rem;
}

#todo-priority {
    border: 1px solid #90aeda;
    border-radius: 12px;
    padding: 14px 16px;
    background: #8f97ac;
    color: #edeff3;
    font-size: 1rem;
}

#todo-input:focus,
#todo-priority:focus {
    outline: 2px solid #3b82f6;
    border-color: transparent;
}

button[type="submit"],
.filter-button,
#clear-completed {
    border: none;
    border-radius: 12px;
    background: #298bb5;
    color: #fff;
    padding: 14px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.14s ease, background-color 0.14s ease;
}

button[type="submit"]:hover,
.filter-button:hover,
#clear-completed:hover {
    transform: translateY(-1px);
    background: #5b21b6;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-button {
    background: #e2e8f0;
    color: #1e293b;
    padding: 11px 16px;
}

.filter-button.active {
    background: #3b82f6;
    color: #fff;
}

#todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.todo-item.completed {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.task-label {
    flex: 1;
    margin-left: 10px;
    color: #0f172a;
}

.task-label.completed {
    text-decoration: line-through;
    opacity: 0.72;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 10px;
}

.priority-badge.low {
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.priority-badge.medium {
    color: #1d4ed8;
    background: #dbeafe;
    border: 1px solid #93c5fd;
}

.priority-badge.high {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.task-actions button {
    background: transparent;
    color: #475569;
    border: 1px solid transparent;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0;
    font-size: 1rem;
}

.task-actions button:hover {
    background: #e2e8f0;
}



.footer-bar {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#task-count {
    font-weight: 600;
}

@media (max-width: 500px) {
    #todo-form {
        flex-direction: column;
    }

    button[type="submit"],
    .filter-button,
    #clear-completed {
        width: 100%;
    }
}