:root {
    --bg: #ffffffee;
    --text: #2a2a2a;
    --accent: #6c63ff;
    --card: #f0f0ff;
}

body.dark {
    --bg: #1e1e2f;
    --text: #f0f0f0;
    --accent: #8c82ff;
    --card: #2d2d42;
    background: #141421;
    color: var(--text);
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #8ea8ff, #7d69ff);
    margin: 0;
    padding-bottom: 60px;
}

.wrapper {
    width: 92%;
    margin: 15px auto;
    background: var(--bg);
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(12px);
}

.title {
    text-align: center;
    margin: 10px 0 25px;
    font-size: 24px;
    font-weight: bold;
}

.todo-input-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-input-box input {
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

#add-btn {
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    border: none;
}

#todo-list {
    padding: 0;
    margin-top: 20px;
}

.todo-item {
    background: var(--card);
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.4s;
}

.todo-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.todo-text {
    font-size: 17px;
    font-weight: 600;
}

.todo-deadline {
    font-size: 13px;
    color: #777;
}

.action-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

button {
    padding: 8px 10px;
    border-radius: 8px;
}

.done-btn {
    background: #4caf50;
    color: white;
}

.edit-btn {
    background: #ffa31a;
    color: white;
}

.delete-btn {
    background: #ff4d4d;
    color: white;
}

.theme-toggle {
    text-align: center;
    margin-top: 10px;
}

#theme-btn {
    padding: 10px 20px;
    border-radius: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 430px) {
    .todo-text { font-size: 15px; }
    #add-btn, input { font-size: 15px; }
    .title { font-size: 22px; }
}
